org.eclipse.wst.jsdt.ui
Class StandardJavaScriptElementContentProvider

java.lang.Object
  extended by org.eclipse.wst.jsdt.ui.StandardJavaScriptElementContentProvider
All Implemented Interfaces:
IWorkingCopyProvider

public class StandardJavaScriptElementContentProvider
extends java.lang.Object
implements IWorkingCopyProvider

A base content provider for JavaScriptelements. It provides access to the JavaScriptelement hierarchy without listening to changes in the JavaScriptmodel. If updating the presentation on JavaScript model change is required than clients have to subclass, listen to JavaScript model changes and have to update the UI using corresponding methods provided by the JFace viewers or their own UI presentation.

The following JavaScript element hierarchy is surfaced by this content provider:

JavaScript model (IJavaScriptModel)
   JavaScript project (IJavaScriptProject)
      package fragment root (IPackageFragmentRoot)
         package fragment (IPackageFragment)
            compilation unit (IJavaScriptUnit)
            binary class file (IClassFile)
 

Note that when the entire JavaScript project is declared to be package fragment root, the corresponding package fragment root element that normally appears between the JavaScript project and the package fragments is automatically filtered out.


Constructor Summary
StandardJavaScriptElementContentProvider()
          Creates a new content provider.
StandardJavaScriptElementContentProvider(boolean provideMembers)
          Creates a new StandardJavaScriptElementContentProvider.
 
Method Summary
 void dispose()
           
 java.lang.Object[] getChildren(java.lang.Object element)
           
 java.lang.Object[] getElements(java.lang.Object parent)
           
 java.lang.Object getParent(java.lang.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 JavaScript model does not support the 'original' mode anymore.
 boolean hasChildren(java.lang.Object element)
           
 void inputChanged(Viewer viewer, java.lang.Object oldInput, java.lang.Object newInput)
           
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardJavaScriptElementContentProvider

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


StandardJavaScriptElementContentProvider

public StandardJavaScriptElementContentProvider(boolean provideMembers)
Creates a new StandardJavaScriptElementContentProvider.

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 JavaScript model 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 java.lang.Object[] getElements(java.lang.Object parent)

inputChanged

public void inputChanged(Viewer viewer,
                         java.lang.Object oldInput,
                         java.lang.Object newInput)

dispose

public void dispose()

getChildren

public java.lang.Object[] getChildren(java.lang.Object element)

hasChildren

public boolean hasChildren(java.lang.Object element)

getParent

public java.lang.Object getParent(java.lang.Object element)