Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Can Eclipse automatically remove empty packages?
Can Eclipse automatically remove empty packages? [message #176629] Mon, 06 September 2004 02:05 Go to next message
Eclipse UserFriend
Originally posted by: yilin.microshit.com

When I delete the last class file in a package, conceptually, the
package no longer exist, however Eclipse still keeps the empty package
folder and show it on the Package Explorer. I find this behavior
comfusing and annoying, since I have to manually delete these empty
packages. Furthermore, on the Package Explorer, empty packages appear
just like packages that contains other packages but no files, which can
mistakenly be deleted.

For this reason, I'm wondering if there's a wya to either automatically
remove empty packages, or make this behavior less confusing.

Thanks.
Re: Can Eclipse automatically remove empty packages? [message #176644 is a reply to message #176629] Mon, 06 September 2004 03:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chabert.fimasys.fr

Hello,

I don't know a way to delete automatically an empty package, but you can
hide the empty packages in the package explorer. In the package explorer
filters, you can set the elements you want to exclude from the view.
Empty packages are one of the filters criteria. Packages containing no
classes but other packages are still shown (it is another filters
criteria). Of course, these empty directories are still on file system...

Sylvain


yilin wrote:
> When I delete the last class file in a package, conceptually, the
> package no longer exist, however Eclipse still keeps the empty package
> folder and show it on the Package Explorer. I find this behavior
> comfusing and annoying, since I have to manually delete these empty
> packages. Furthermore, on the Package Explorer, empty packages appear
> just like packages that contains other packages but no files, which can
> mistakenly be deleted.
>
> For this reason, I'm wondering if there's a wya to either automatically
> remove empty packages, or make this behavior less confusing.
>
> Thanks.
Re: Can Eclipse automatically remove empty packages? [message #176728 is a reply to message #176629] Mon, 06 September 2004 16:25 Go to previous message
Eclipse UserFriend
>When I delete the last class file in a package, conceptually, the
>package no longer exist, however Eclipse still keeps the empty package
>folder and show it on the Package Explorer. I find this behavior
>comfusing and annoying, since I have to manually delete these empty
>packages. Furthermore, on the Package Explorer, empty packages appear
>just like packages that contains other packages but no files, which can
>mistakenly be deleted.

I thought, that empty packages are painted in another style, but could
be wrong here.
What version are you using?
Hm just added an empty package test with new|package to a source
folder. There is no package test visible at all. But a folder is
created, funny.

How often do you have empty packages to be annoyed?

>For this reason, I'm wondering if there's a wya to either automatically
>remove empty packages, or make this behavior less confusing.

A package requires a sub folder (at least javac enforces this).
Furthermore below a "package" can be resources (eg. images), so jdt
should not delete packer folder when there no classes within.

Some further thoughts about it.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=72479

martin
Previous Topic:Speed with very large codebases in eclipse
Next Topic:How to add a builder for javanature.
Goto Forum:
  


Current Time: Wed Apr 30 03:24:40 EDT 2025

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

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

Back to the top