Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse JDT Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.jdt.ui
Class StandardJavaElementContentProvider

    java.lang.Object
      org.eclipse.jdt.ui.StandardJavaElementContentProvider

All Implemented Interfaces:
  IContentProvider, IStructuredContentProvider, ITreeContentProvider, IWorkingCopyProvider

Direct Known Subclasses:
  JavaElementContentProvider

public class StandardJavaElementContentProvider
extends Object
implements ITreeContentProvider, IWorkingCopyProvider

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.

Since:
  2.0

Field Summary
`protected boolean` | `fProvideMembers`
`protected boolean` | `fProvideWorkingCopy`
`protected static Object[]` | `NO_CHILDREN`

Constructor Summary
`StandardJavaElementContentProvider()` Creates a new content provider.
`StandardJavaElementContentProvider(boolean provideMembers)` Creates a new `StandardJavaElementContentProvider`.
`StandardJavaElementContentProvider(boolean provideMembers, boolean provideWorkingCopy)` Deprecated. Use `StandardJavaElementContentProvider(boolean)` instead. Since 3.0 compilation unit children are always provided as working copies. The Java Model does not support the 'original' mode anymore.

Method Summary
`protected static Object[]` | `concatenate(Object[] a1, Object[] a2)` Note: This method is for internal use only.
`void` | `dispose()`
`protected boolean` | `exists(Object element)` Note: This method is for internal use only.
`Object[]` | `getChildren(Object element)`
`Object[]` | `getElements(Object parent)`
`protected Object[]` | `getJavaProjects(IJavaModel jm)` Note: This method is for internal use only.
`protected Object[]` | `getPackageFragmentRoots(IJavaProject project)` Note: This method is for internal use only.
`Object` | `getParent(Object element)`
`boolean` | `getProvideMembers()` Returns whether members are provided when asking for a compilation units or class file for its children.
`boolean` | `getProvideWorkingCopy()` Deprecated. Since 3.0 compilation unit children are always provided as working copies. The Java model does not support the 'original' mode anymore.
`boolean` | `hasChildren(Object element)`
`void` | `inputChanged(Viewer viewer, Object oldInput, Object newInput)`
`protected Object` | `internalGetParent(Object element)` Note: This method is for internal use only.
`protected boolean` | `isClassPathChange(IJavaElementDelta delta)` Note: This method is for internal use only.
`protected boolean` | `isPackageFragmentEmpty(IJavaElement element)` Note: This method is for internal use only.
`protected boolean` | `isProjectPackageFragmentRoot(IPackageFragmentRoot root)` Note: This method is for internal use only.
`boolean` | `providesWorkingCopies()` Returns `true` if the content provider returns working copy elements; otherwise `false` is returned.
`void` | `setProvideMembers(boolean b)` Sets whether the content provider is supposed to return members when asking a compilation unit or class file for its children.
`void` | `setProvideWorkingCopy(boolean b)` Deprecated. Since 3.0 compilation unit children are always provided from the working copy. The Java model offers a unified world and does not support the 'original' mode anymore.
`protected Object` | `skipProjectPackageFragmentRoot(IPackageFragmentRoot root)` Note: This method is for internal use only.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### NO_CHILDREN

    protected static final Object[] NO_CHILDREN

### fProvideMembers

    protected boolean fProvideMembers

### fProvideWorkingCopy

    protected boolean fProvideWorkingCopy

Constructor Detail

### StandardJavaElementContentProvider

    public StandardJavaElementContentProvider()

  Creates a new content provider. The content provider does not provide members of compilation units or class files.

### StandardJavaElementContentProvider

    public StandardJavaElementContentProvider(boolean provideMembers,
                                              boolean provideWorkingCopy)

  Deprecated. Use `StandardJavaElementContentProvider(boolean)` instead. Since 3.0 compilation unit children are always provided as working copies. The Java Model does not support the 'original' mode anymore.

### StandardJavaElementContentProvider

    public StandardJavaElementContentProvider(boolean provideMembers)

  Creates a new `StandardJavaElementContentProvider`.

Parameters:
  `provideMembers` - if `true` members below compilation units and class files are provided.

Method Detail

### getProvideMembers

    public boolean getProvideMembers()

  Returns whether members are provided when asking for a compilation units or class file for its children.

  Returns:
    `true` if the content provider provides members; otherwise `false` is returned

### setProvideMembers

    public void 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. If `false` compilation units and class files are the leaves provided by this content provider.

### getProvideWorkingCopy

    public boolean getProvideWorkingCopy()

  Deprecated. Since 3.0 compilation unit children are always provided as working copies. The Java model does not support the 'original' mode anymore.

### setProvideWorkingCopy

    public void setProvideWorkingCopy(boolean b)

  Deprecated. Since 3.0 compilation unit children are always provided from the working copy. The Java model offers a unified world and does not support the 'original' mode anymore.

### providesWorkingCopies

    public boolean providesWorkingCopies()

  Description copied from interface: `IWorkingCopyProvider`
  Returns `true` if the content provider returns working copy elements; otherwise `false` is returned.

  Specified by:
    `providesWorkingCopies` in interface `IWorkingCopyProvider`
  Returns:
    whether working copy elements are provided.

### getElements

    public Object[] getElements(Object parent)

  Specified by:
    `getElements` in interface `IStructuredContentProvider`

### inputChanged

    public void inputChanged(Viewer viewer,
                             Object oldInput,
                             Object newInput)

  Specified by:
    `inputChanged` in interface `IContentProvider`

### dispose

    public void dispose()

  Specified by:
    `dispose` in interface `IContentProvider`

### getChildren

    public Object[] getChildren(Object element)

  Specified by:
    `getChildren` in interface `ITreeContentProvider`

### hasChildren

    public boolean hasChildren(Object element)

  Specified by:
    `hasChildren` in interface `ITreeContentProvider`

### getParent

    public Object getParent(Object element)

  Specified by:
    `getParent` in interface `ITreeContentProvider`

### getPackageFragmentRoots

    protected Object[] getPackageFragmentRoots(IJavaProject project)
                                        throws JavaModelException

  Note: This method is for internal use only. Clients should not call this method.

  Throws:
    `JavaModelException`

### getJavaProjects

    protected Object[] getJavaProjects(IJavaModel jm)
                                throws JavaModelException

  Note: This method is for internal use only. Clients should not call this method.

  Throws:
    `JavaModelException`

### isClassPathChange

    protected boolean isClassPathChange(IJavaElementDelta delta)

  Note: This method is for internal use only. Clients should not call this method.

### skipProjectPackageFragmentRoot

    protected Object skipProjectPackageFragmentRoot(IPackageFragmentRoot root)

  Note: This method is for internal use only. Clients should not call this method.

### isPackageFragmentEmpty

    protected boolean isPackageFragmentEmpty(IJavaElement element)
                                      throws JavaModelException

  Note: This method is for internal use only. Clients should not call this method.

  Throws:
    `JavaModelException`

### isProjectPackageFragmentRoot

    protected boolean isProjectPackageFragmentRoot(IPackageFragmentRoot root)

  Note: This method is for internal use only. Clients should not call this method.

### exists

    protected boolean exists(Object element)

  Note: This method is for internal use only. Clients should not call this method.

### internalGetParent

    protected Object internalGetParent(Object element)

  Note: This method is for internal use only. Clients should not call this method.

### concatenate

    protected static Object[] concatenate(Object[] a1,
                                          Object[] a2)

  Note: This method is for internal use only. Clients should not call this method.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse JDT Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) IBM Corp. and others 2000, 2004. All Rights Reserved.