Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » List sub packages of a IPackageFragment
List sub packages of a IPackageFragment [message #880862] Sun, 03 June 2012 03:18 Go to next message
Davide M is currently offline Davide M
Messages: 17
Registered: April 2012
Junior Member
Hi,

is possible to have the list of direct sub packages of a IPackageFragment?
Or I need to browse all the IPackageFragment in a project and
check if it is a direct subpackage?

Thanks in advance for any help!

Re: List sub packages of a IPackageFragment [message #880900 is a reply to message #880862] Sun, 03 June 2012 05:51 Go to previous message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 927
Registered: July 2009
Senior Member
Davide M wrote on Sun, 03 June 2012 09:18
is possible to have the list of direct sub packages of a IPackageFragment?

The Java model doesn't have this information since semantically speaking Java doesn't have a concept of "sub packages".

Davide M wrote
Or I need to browse all the IPackageFragment in a project and
check if it is a direct subpackage?


Exactly. This is what, e.g., the package explorer does, see method getHierarchicalPackageChildren() in http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerContentProvider.java

Stephan
Previous Topic:New to Eclipse, not sure what version is right for my app.
Next Topic:Unexpected binding returned
Goto Forum:
  


Current Time: Wed Apr 23 20:57:13 EDT 2014

Powered by FUDForum. Page generated in 0.01521 seconds