How to auto-create for import the folders from java package? [message #332255] |
Tue, 14 October 2008 18:37  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.03496 seconds