Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Packages and folders in Package explorer
Packages and folders in Package explorer [message #195934] Sat, 24 February 2007 13:53 Go to next message
Eclipse UserFriend
Originally posted by: emf.NOSPAM.email.com

I have downloaded a folder, named Book, from the Internet that contains
folders for each chapter of a book, like ch01, and each of these
contains java files with the source codes of programs.

I have a project named CIS101, where I have packages for the projects of
each chapter of the book, like pr01 etc.

I would like to have the folder Book inside CIS101 as an archive, for
reference. I have tried to do this in 2 ways: by creating a package
called Book in CIS101 or by creating a folder with the same name. In
each case, when I try to put ch01 in Book, the folder ch01 is created
inside CIS101, however in the package explorer it appears as Book.ch01.
I would like to have it appear inside Book, so when I want to have to
see at the programs I would have to click the + in front of Book etc.

That is, I would like to be able to collapse ch01, ch02 etc inside Book
like this:

- Book
- ch01
program01
program02
...
- ch02
program01
...

instead of

+ Book.ch01
+ Book.ch02
....

How can I do this?

Thanks,

Eustace

--
JavaScript Date Calculator
http://www.geocities.com/emfrilingos/tm/datecalc.html
Re: Packages and folders in Package explorer [message #195960 is a reply to message #195934] Sat, 24 February 2007 16:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Eustace,

It sounds like you should bring up the properties for the project, and
use Java Build Path's Source folder tab to add source folders at the
nesting level you want.


Eustace wrote:
> I have downloaded a folder, named Book, from the Internet that
> contains folders for each chapter of a book, like ch01, and each of
> these contains java files with the source codes of programs.
>
> I have a project named CIS101, where I have packages for the projects
> of each chapter of the book, like pr01 etc.
>
> I would like to have the folder Book inside CIS101 as an archive, for
> reference. I have tried to do this in 2 ways: by creating a package
> called Book in CIS101 or by creating a folder with the same name. In
> each case, when I try to put ch01 in Book, the folder ch01 is created
> inside CIS101, however in the package explorer it appears as
> Book.ch01. I would like to have it appear inside Book, so when I want
> to have to see at the programs I would have to click the + in front of
> Book etc.
>
> That is, I would like to be able to collapse ch01, ch02 etc inside
> Book like this:
>
> - Book
> - ch01
> program01
> program02
> ...
> - ch02
> program01
> ...
>
> instead of
>
> + Book.ch01
> + Book.ch02
> ...
>
> How can I do this?
>
> Thanks,
>
> Eustace
>
Re: Packages and folders in Package explorer [message #196169 is a reply to message #195960] Mon, 26 February 2007 06:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: emf.NOSPAM.email.com

On 2007.02.24 11:55 Ed Merks wrote:
> Eustace,
>
> It sounds like you should bring up the properties for the project, and
> use Java Build Path's Source folder tab to add source folders at the
> nesting level you want.
>
Dear Ed.

Thanks for your reply. I did rightclicked on CIS101, selected
Properties, in the Properties for CIS101 dialog I clicked on Java Build
Path, selected the Source tab. Now:

I selected CIS101 and clicked Add Folder... At the Source Folder
Selection, CIS101 is selected. I click Create New Folder dialog I write
in the Folder Name textbox: Book. I click Next and then Finish. So I
created a folder Book inside CIS101. So far so good.

Now, however, I want to create inside folder Book a subfolder ch01. So I
rightclick on Book, select New > Folder, Folder Name:. Here I enter
ch01, click Finish, but I do not get the desired result. ch01 was
created nested in Book, but it does not look like a folder, and besides
a similar ch01 was created nested directly under CIS101. If I rightclick
this second ch01 and select Delete, a dialog asks me:

Are you sure you want to delete package ch01?

I thought I had created a folder, not a package, but anyway I click yes,
but still it is not deleted. To delete it I have first to delete (again
package though I had created it as a folder) ch01 from Book, and then
delete the first one.

How do I create a *folder*, not a package, inside Book, without having
anything created directly inside CIS101? And then, how can I create or
copy java *files* inside it without eclipse considering them as
programs? There should be some way to do this.

What I want to do with CIS101 I had done somehow in another package, and
comparing the 2 I suspect that it has something to do with CIS101
Properties, Source tab, select CIS101/Book, Excluded > Edit, but I would
like some specific information.

Thanks,

Eustace




>
> Eustace wrote:
>> I have downloaded a folder, named Book, from the Internet that
>> contains folders for each chapter of a book, like ch01, and each of
>> these contains java files with the source codes of programs.
>>
>> I have a project named CIS101, where I have packages for the projects
>> of each chapter of the book, like pr01 etc.
>>
>> I would like to have the folder Book inside CIS101 as an archive, for
>> reference. I have tried to do this in 2 ways: by creating a package
>> called Book in CIS101 or by creating a folder with the same name. In
>> each case, when I try to put ch01 in Book, the folder ch01 is created
>> inside CIS101, however in the package explorer it appears as
>> Book.ch01. I would like to have it appear inside Book, so when I want
>> to have to see at the programs I would have to click the + in front of
>> Book etc.
>>
>> That is, I would like to be able to collapse ch01, ch02 etc inside
>> Book like this:
>>
>> - Book
>> - ch01
>> program01
>> program02
>> ...
>> - ch02
>> program01
>> ...
>>
>> instead of
>>
>> + Book.ch01
>> + Book.ch02
>> ...
>>
>> How can I do this?
>>
>> Thanks,
>>
>> Eustace
>>
Re: Packages and folders in Package explorer [message #196224 is a reply to message #196169] Mon, 26 February 2007 12:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Eustace,

I'm a little confused about exactly what your desired goal is. You can
create whatever folder structure you want directly by creating folders
with New->Folder. At some point you need to tell JDT which folders act
as the root of your Java source. The folder structure under that root
will represent root Java package names, i.e., typically a source folder
will contain folders called "org", and "com". From the source folder
down, the folders have to match the qualified Java package name of the
..java sources. Each folder that contains .java files will be
represented as a flat "package" with a + in front of it. You can use
the upper right icon to change "Package Presentation->Hierarchical".
What you are trying to achieve has to work within these bounds...


Eustace wrote:
> On 2007.02.24 11:55 Ed Merks wrote:
>> Eustace,
>>
>> It sounds like you should bring up the properties for the project,
>> and use Java Build Path's Source folder tab to add source folders at
>> the nesting level you want.
>>
> Dear Ed.
>
> Thanks for your reply. I did rightclicked on CIS101, selected
> Properties, in the Properties for CIS101 dialog I clicked on Java
> Build Path, selected the Source tab. Now:
>
> I selected CIS101 and clicked Add Folder... At the Source Folder
> Selection, CIS101 is selected. I click Create New Folder dialog I
> write in the Folder Name textbox: Book. I click Next and then Finish.
> So I created a folder Book inside CIS101. So far so good.
>
> Now, however, I want to create inside folder Book a subfolder ch01. So
> I rightclick on Book, select New > Folder, Folder Name:. Here I enter
> ch01, click Finish, but I do not get the desired result. ch01 was
> created nested in Book, but it does not look like a folder, and
> besides a similar ch01 was created nested directly under CIS101. If I
> rightclick this second ch01 and select Delete, a dialog asks me:
>
> Are you sure you want to delete package ch01?
>
> I thought I had created a folder, not a package, but anyway I click
> yes, but still it is not deleted. To delete it I have first to delete
> (again package though I had created it as a folder) ch01 from Book,
> and then delete the first one.
>
> How do I create a *folder*, not a package, inside Book, without having
> anything created directly inside CIS101? And then, how can I create or
> copy java *files* inside it without eclipse considering them as
> programs? There should be some way to do this.
>
> What I want to do with CIS101 I had done somehow in another package,
> and comparing the 2 I suspect that it has something to do with CIS101
> Properties, Source tab, select CIS101/Book, Excluded > Edit, but I
> would like some specific information.
>
> Thanks,
>
> Eustace
>
>
>
>
>>
>> Eustace wrote:
>>> I have downloaded a folder, named Book, from the Internet that
>>> contains folders for each chapter of a book, like ch01, and each of
>>> these contains java files with the source codes of programs.
>>>
>>> I have a project named CIS101, where I have packages for the
>>> projects of each chapter of the book, like pr01 etc.
>>>
>>> I would like to have the folder Book inside CIS101 as an archive,
>>> for reference. I have tried to do this in 2 ways: by creating a
>>> package called Book in CIS101 or by creating a folder with the same
>>> name. In each case, when I try to put ch01 in Book, the folder ch01
>>> is created inside CIS101, however in the package explorer it appears
>>> as Book.ch01. I would like to have it appear inside Book, so when I
>>> want to have to see at the programs I would have to click the + in
>>> front of Book etc.
>>>
>>> That is, I would like to be able to collapse ch01, ch02 etc inside
>>> Book like this:
>>>
>>> - Book
>>> - ch01
>>> program01
>>> program02
>>> ...
>>> - ch02
>>> program01
>>> ...
>>>
>>> instead of
>>>
>>> + Book.ch01
>>> + Book.ch02
>>> ...
>>>
>>> How can I do this?
>>>
>>> Thanks,
>>>
>>> Eustace
>>>
Re: Packages and folders in Package explorer [message #196359 is a reply to message #196169] Mon, 26 February 2007 19:35 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse5.rizzoweb.com

Eustace,
I strongly recommend you spend an hour or two going through 2 tutorials
that come with Eclipse. They will help you a lot in understanding how to
set up projects and use Eclipse to its full potential.
Here is the online version of one of these tutorials:
http://help.eclipse.org/help32/topic/org.eclipse.jdt.doc.use r/gettingStarted/qs-ProjectConfiguration.htm

It is also available in your local Eclipse installation by choosing Help
Contents from the Eclipse menu.

Hope this helps,
Eric
Previous Topic:New install with security questions
Next Topic:detecting the end of POST_CHANGE event?
Goto Forum:
  


Current Time: Sat Apr 27 01:19:25 GMT 2024

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

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

Back to the top