public class DefaultFoldingStructureProvider extends java.lang.Object implements IFoldingStructureProvider, IXtextModelListener
IFoldingStructureProvider
/Modifier and Type | Class and Description |
---|---|
class |
DefaultFoldingStructureProvider.ProjectionChangeListener
Internal projection listener.
|
Constructor and Description |
---|
DefaultFoldingStructureProvider() |
Modifier and Type | Method and Description |
---|---|
protected void |
addProjectionAnnotation(boolean allowCollapse,
org.eclipse.jface.text.Position foldingRegion,
java.util.Map<org.eclipse.jface.text.source.projection.ProjectionAnnotation,org.eclipse.jface.text.Position> additionsMap) |
protected void |
calculateProjectionAnnotationModel(boolean allowCollapse) |
protected org.eclipse.jface.text.source.projection.ProjectionAnnotation |
createProjectionAnnotation(boolean isCollapsed,
org.eclipse.jface.text.Position foldedRegion) |
protected void |
handleProjectionDisabled() |
protected void |
handleProjectionEnabled() |
void |
initialize()
(Re-)initializes the structure provided by the receiver.
|
void |
install(XtextEditor editor,
org.eclipse.jface.text.source.projection.ProjectionViewer viewer)
Installs this structure provider on the given editor and viewer.
|
protected boolean |
isInstalled()
Returns
true if the provider is installed, false otherwise. |
protected org.eclipse.jface.text.source.Annotation[] |
mergeFoldingRegions(java.util.Collection<FoldedPosition> foldedPositions,
org.eclipse.jface.text.source.projection.ProjectionAnnotationModel projectionAnnotationModel) |
void |
modelChanged(XtextResource resource) |
void |
uninstall()
Uninstalls this structure provider.
|
protected void |
updateFoldingRegions(boolean allowCollapse,
org.eclipse.jface.text.source.projection.ProjectionAnnotationModel model,
java.util.Collection<FoldedPosition> foldedPositions,
org.eclipse.jface.text.source.Annotation[] deletions) |
public void install(XtextEditor editor, org.eclipse.jface.text.source.projection.ProjectionViewer viewer)
IFoldingStructureProvider
viewer
and enable / disable generation of projection structure accordingly.install
in interface IFoldingStructureProvider
editor
- the editor that this provider works onviewer
- the projection viewer that displays the annotations created by this structure providerpublic void initialize()
IFoldingStructureProvider
initialize
in interface IFoldingStructureProvider
public void uninstall()
IFoldingStructureProvider
uninstall
in interface IFoldingStructureProvider
protected final boolean isInstalled()
true
if the provider is installed, false
otherwise.true
if the provider is installed, false
otherwisepublic void modelChanged(XtextResource resource)
modelChanged
in interface IXtextModelListener
IXtextModelListener.modelChanged(org.eclipse.xtext.resource.XtextResource)
protected void handleProjectionEnabled()
protected void handleProjectionDisabled()
protected void calculateProjectionAnnotationModel(boolean allowCollapse)
protected org.eclipse.jface.text.source.Annotation[] mergeFoldingRegions(java.util.Collection<FoldedPosition> foldedPositions, org.eclipse.jface.text.source.projection.ProjectionAnnotationModel projectionAnnotationModel)
protected void updateFoldingRegions(boolean allowCollapse, org.eclipse.jface.text.source.projection.ProjectionAnnotationModel model, java.util.Collection<FoldedPosition> foldedPositions, org.eclipse.jface.text.source.Annotation[] deletions)
protected void addProjectionAnnotation(boolean allowCollapse, org.eclipse.jface.text.Position foldingRegion, java.util.Map<org.eclipse.jface.text.source.projection.ProjectionAnnotation,org.eclipse.jface.text.Position> additionsMap)
protected org.eclipse.jface.text.source.projection.ProjectionAnnotation createProjectionAnnotation(boolean isCollapsed, org.eclipse.jface.text.Position foldedRegion)