public class StandardJavaElementContentProvider implements ITreeContentProvider,IWorkingCopyProvider(Code)
A base content provider for Java elements. It provides access to the
Java element hierarchy without listening to changes in the Java model.
If updating the presentation on Java model change is required than
clients have to subclass, listen to Java model changes and have to update
the UI using corresponding methods provided by the JFace viewers or their
own UI presentation.
The following Java element hierarchy is surfaced by this content provider:
Java model (IJavaModel)
Java project (IJavaProject)
package fragment root (IPackageFragmentRoot)
package fragment (IPackageFragment)
compilation unit (ICompilationUnit)
binary class file (IClassFile)
Note that when the entire Java project is declared to be package fragment root,
the corresponding package fragment root element that normally appears between the
Java project and the package fragments is automatically filtered out.
StandardJavaElementContentProvider(boolean provideMembers) Creates a new StandardJavaElementContentProvider.
Parameters: provideMembers - if true members below compilation units and class files are provided.
setProvideMembers(boolean b) Sets whether the content provider is supposed to return members
when asking a compilation unit or class file for its children.
Parameters: b - if true then members are provided.
Evaluates all children of a given
IFolder . Clients can override this method.
Parameters: folder - The folder to evaluate the children for. The children of the given package fragment. exception: CoreException - if the folder does not exist. since: 3.3
Evaluates all children of a given
IPackageFragment . Clients can override this method.
Parameters: fragment - The fragment to evaluate the children for. The children of the given package fragment. exception: JavaModelException - if the package fragment does not exist or if anexception occurs while accessing its corresponding resource since: 3.3
Evaluates all children of a given
IPackageFragmentRoot . Clients can override this method.
Parameters: root - The root to evaluate the children for. The children of the root exception: JavaModelException - if the package fragment root does not exist or if anexception occurs while accessing its corresponding resource since: 3.3
Evaluates all children of a given
IJavaProject . Clients can override this method.
Parameters: project - The Java project to evaluate the children for. The children of the project. Typically these are package fragment roots but can also be other elements. exception: JavaModelException - if the Java project does not exist or if anexception occurs while accessing its corresponding resource
Returns whether members are provided when asking
for a compilation units or class file for its children.
true if the content provider provides members; otherwise false is returned
Sets whether the content provider is supposed to return members
when asking a compilation unit or class file for its children.
Parameters: b - if true then members are provided. If false compilation units and class files are theleaves provided by this content provider.
setProvideWorkingCopy
public void setProvideWorkingCopy(boolean b)(Code)