org.eclipse.wst.jsdt.ui.text.folding
Class DefaultJavaFoldingStructureProvider

java.lang.Object
  extended by org.eclipse.wst.jsdt.ui.text.folding.DefaultJavaFoldingStructureProvider
All Implemented Interfaces:
IJavaFoldingStructureProvider, IJavaFoldingStructureProviderExtension

public class DefaultJavaFoldingStructureProvider
extends java.lang.Object
implements IJavaFoldingStructureProvider, IJavaFoldingStructureProviderExtension

Updates the projection model of a class file or compilation unit.

Clients may instantiate or subclass. Subclasses must make sure to always call the superclass' code when overriding methods that are marked with "subclasses may extend".

Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.


Constructor Summary
DefaultJavaFoldingStructureProvider()
          Creates a new folding provider.
 
Method Summary
 void collapseComments()
          Collapses all comments.
 void collapseElements(IJavaScriptElement[] elements)
          Collapses the given elements.
 void collapseMembers()
          Collapses all members except for top level types.
 void expandElements(IJavaScriptElement[] elements)
          Expands the given elements.
 void initialize()
          (Re-)initializes the structure provided by the receiver.
 void install(ITextEditor editor, ProjectionViewer viewer)
          Installs this structure provider on the given editor and viewer. Subclasses may extend.
 void uninstall()
          Uninstalls this structure provider. Subclasses may extend.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultJavaFoldingStructureProvider

public DefaultJavaFoldingStructureProvider()
Creates a new folding provider. It must be installed on an editor/viewer pair before it can be used, and uninstalled when not used any longer.

The projection state may be reset by calling initialize().

Method Detail

install

public void install(ITextEditor editor,
                    ProjectionViewer viewer)
Installs this structure provider on the given editor and viewer. Implementations should listen to the projection events generated by viewer and enable / disable generation of projection structure accordingly.

Subclasses may extend.

Specified by:
install in interface IJavaFoldingStructureProvider
Parameters:
editor - the editor that this provider works on
viewer - the projection viewer that displays the annotations created by this structure provider

uninstall

public void uninstall()
Uninstalls this structure provider. Any references to editors or viewers should be cleared.

Subclasses may extend.

Specified by:
uninstall in interface IJavaFoldingStructureProvider

initialize

public final void initialize()
Description copied from interface: IJavaFoldingStructureProvider
(Re-)initializes the structure provided by the receiver.

Specified by:
initialize in interface IJavaFoldingStructureProvider

collapseMembers

public final void collapseMembers()
Description copied from interface: IJavaFoldingStructureProviderExtension
Collapses all members except for top level types.

Specified by:
collapseMembers in interface IJavaFoldingStructureProviderExtension

collapseComments

public final void collapseComments()
Description copied from interface: IJavaFoldingStructureProviderExtension
Collapses all comments.

Specified by:
collapseComments in interface IJavaFoldingStructureProviderExtension

collapseElements

public final void collapseElements(IJavaScriptElement[] elements)
Description copied from interface: IJavaFoldingStructureProviderExtension
Collapses the given elements.

Specified by:
collapseElements in interface IJavaFoldingStructureProviderExtension
Parameters:
elements - the JavaScript elements to collapse (the array and its elements must not be modified)

expandElements

public final void expandElements(IJavaScriptElement[] elements)
Description copied from interface: IJavaFoldingStructureProviderExtension
Expands the given elements.

Specified by:
expandElements in interface IJavaFoldingStructureProviderExtension
Parameters:
elements - the JavaScript elements to expand (the array and its elements must not be modified)