Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to auto-create for import the folders from java package?
How to auto-create for import the folders from java package? [message #332255] Tue, 14 October 2008 18:37 Go to next message
Eclipse UserFriend
Originally posted by: mstev.ozone.com

Assume I want to import some java source into an existing project.
Say, the java source have an entry

package aaa.bbb.ccc;

at the top.

As far as I can see I have to create the folder structure

<PRJ_FOLDER>\src\aaa\bbb\ccc

manually BEFORE I import the java sources.

Is there really NO AUTO-DETECT of the used packages and afterwards
AUTO_CREATION of the folder structure when importing java classes?

Pia
Re: How to auto-create for import the folders from java package? [message #332258 is a reply to message #332255] Tue, 14 October 2008 20:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Pia Stevens wrote:
> Assume I want to import some java source into an existing project.
> Say, the java source have an entry
>
> package aaa.bbb.ccc;
>
> at the top.
>
> As far as I can see I have to create the folder structure
>
> <PRJ_FOLDER>\src\aaa\bbb\ccc
>
> manually BEFORE I import the java sources.
>
> Is there really NO AUTO-DETECT of the used packages and afterwards
> AUTO_CREATION of the folder structure when importing java classes?

Yes. First just import the file into your project; it will be imported
into the default package but with an error marked on the package
statement. Hover your mouse over the red squiggly error marker and in
the tooltip you'll see a link for "Move myfile.java to package aa.bb.cc"
You can also put the cursor anywhere on the package statement line and
use Ctrl+1 (QuickFix) to invoke the same pop-up list of options.

Hope this helps,
Eric
Re: How to auto-create for import the folders from java package? [message #332262 is a reply to message #332255] Wed, 15 October 2008 07:48 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Pia Stevens wrote:
> Assume I want to import some java source into an existing project.
> Say, the java source have an entry
>
If it is only one file simply select and copy the source text and paste
it into the project.

Dani
> package aaa.bbb.ccc;
>
> at the top.
>
> As far as I can see I have to create the folder structure
>
> <PRJ_FOLDER>\src\aaa\bbb\ccc
>
> manually BEFORE I import the java sources.
>
> Is there really NO AUTO-DETECT of the used packages and afterwards
> AUTO_CREATION of the folder structure when importing java classes?
>
> Pia
>
Re: How to auto-create for import the folders from java package? [message #332263 is a reply to message #332255] Wed, 15 October 2008 08:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: 4cs6fcg02.sneakemail.com

Pia Stevens schreef:
> Assume I want to import some java source into an existing project.
> Say, the java source have an entry
>
> package aaa.bbb.ccc;
>
> at the top.
>
> As far as I can see I have to create the folder structure
>
> <PRJ_FOLDER>\src\aaa\bbb\ccc
>
> manually BEFORE I import the java sources.
>
> Is there really NO AUTO-DETECT of the used packages and afterwards
> AUTO_CREATION of the folder structure when importing java classes?

Normally, if you have a file that is in package aaa.bbb.ccc, it will be
in folder aaa/bbb/ccc, so why not just import the folders themselves?
You can choose which file in the folders you want. That is, in the
import wizard, choose as the /base/ folder the folder below aaa, and
then check aaa for import.

H.
--
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
Re: How to auto-create for import the folders from java package? [message #332345 is a reply to message #332255] Mon, 20 October 2008 09:58 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33183
Registered: July 2009
Senior Member
Pia,

If you import Java sources, you generally would import the "aaa" folder
into your Java project's "src" folder. Note that if you copy the
contents of a file, and then paste it to the "src" folder, JDT will
create the right folder structure.


Pia Stevens wrote:
> Assume I want to import some java source into an existing project.
> Say, the java source have an entry
>
> package aaa.bbb.ccc;
>
> at the top.
>
> As far as I can see I have to create the folder structure
>
> <PRJ_FOLDER>\src\aaa\bbb\ccc
>
> manually BEFORE I import the java sources.
>
> Is there really NO AUTO-DETECT of the used packages and afterwards
> AUTO_CREATION of the folder structure when importing java classes?
>
> Pia
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:How to provide a specific tab-style to move between editable cells
Next Topic:Is there an auto-indent/format feature for *.xml files in Eclipse?
Goto Forum:
  


Current Time: Wed Jul 17 17:02:29 GMT 2024

Powered by FUDForum. Page generated in 0.03725 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top