How to auto-create for import the folders from java package? [message #332255] |
Tue, 14 October 2008 18:37 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 #332263 is a reply to message #332255] |
Wed, 15 October 2008 08:40 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 Go to previous message](theme/Solstice/images/up.png) |
Ed Merks![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=ed.merks%40gmail.com) Messages: 33196 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/
|
|
|
Powered by
FUDForum. Page generated in 0.06156 seconds