Class ProjectionSupport
- java.lang.Object
-
- org.eclipse.jface.text.source.projection.ProjectionSupport
-
public class ProjectionSupport extends Object
Supports the configuration of projection capabilities aProjectionViewer
.This class is not intended to be subclassed. Clients are supposed to configure and use it as is.
- Since:
- 3.0
- Restriction:
- This class is not intended to be subclassed by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static Object
PROJECTION
Key of the projection annotation model inside the visual annotation model.
-
Constructor Summary
Constructors Constructor Description ProjectionSupport(ProjectionViewer viewer, IAnnotationAccess annotationAccess, ISharedTextColors sharedTextColors)
Creates new projection support for the given projection viewer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSummarizableAnnotationType(String annotationType)
Marks the given annotation type to be considered when creating summaries for collapsed regions of the projection viewer.void
dispose()
Disposes this projection support.protected void
doDisableProjection()
Removes the projection ruler column and the painter from the projection viewer.protected void
doEnableProjection()
Enables projection mode.<T> T
getAdapter(ISourceViewer viewer, Class<T> required)
Implements the contract ofIAdaptable.getAdapter(java.lang.Class)
by forwarding the adapter requests to the given viewer.void
install()
Installs this projection support on its viewer.void
removeSummarizableAnnotationType(String annotationType)
Marks the given annotation type to be ignored when creating summaries for collapsed regions of the projection viewer.void
setAnnotationPainterDrawingStrategy(AnnotationPainter.IDrawingStrategy strategy)
Sets the drawing strategy that the projection support's annotation painter uses to draw the indication of collapsed regions onto the projection viewer's text widget.void
setHoverControlCreator(IInformationControlCreator creator)
Sets the hover control creator that is used for the annotation hovers that are shown in the projection viewer's projection ruler column.void
setInformationPresenterControlCreator(IInformationControlCreator creator)
Sets the information presenter control creator that is used for the annotation hovers that are shown in the projection viewer's projection ruler column.
-
-
-
Field Detail
-
PROJECTION
public static final Object PROJECTION
Key of the projection annotation model inside the visual annotation model. Also internally used as key for the projection drawing strategy.
-
-
Constructor Detail
-
ProjectionSupport
public ProjectionSupport(ProjectionViewer viewer, IAnnotationAccess annotationAccess, ISharedTextColors sharedTextColors)
Creates new projection support for the given projection viewer. Initially, no annotation types are summarized. A default hover control creator and a default drawing strategy are used.- Parameters:
viewer
- the projection viewerannotationAccess
- the annotation accesssharedTextColors
- the shared text colors to use
-
-
Method Detail
-
addSummarizableAnnotationType
public void addSummarizableAnnotationType(String annotationType)
Marks the given annotation type to be considered when creating summaries for collapsed regions of the projection viewer.A summary is an annotation that gets created out of all annotations with a type that has been registered through this method and that are inside the folded region.
- Parameters:
annotationType
- the annotation type to consider
-
removeSummarizableAnnotationType
public void removeSummarizableAnnotationType(String annotationType)
Marks the given annotation type to be ignored when creating summaries for collapsed regions of the projection viewer. This method has only an effect whenaddSummarizableAnnotationType
has been called before for the give annotation type.A summary is an annotation that gets created out of all annotations with a type that has been registered through this method and that are inside the folded region.
- Parameters:
annotationType
- the annotation type to remove
-
setHoverControlCreator
public void setHoverControlCreator(IInformationControlCreator creator)
Sets the hover control creator that is used for the annotation hovers that are shown in the projection viewer's projection ruler column.- Parameters:
creator
- the hover control creator
-
setInformationPresenterControlCreator
public void setInformationPresenterControlCreator(IInformationControlCreator creator)
Sets the information presenter control creator that is used for the annotation hovers that are shown in the projection viewer's projection ruler column.- Parameters:
creator
- the information presenter control creator- Since:
- 3.3
-
setAnnotationPainterDrawingStrategy
public void setAnnotationPainterDrawingStrategy(AnnotationPainter.IDrawingStrategy strategy)
Sets the drawing strategy that the projection support's annotation painter uses to draw the indication of collapsed regions onto the projection viewer's text widget. Whennull
is passed in, the drawing strategy is reset to the default. In order to avoid any representation useAnnotationPainter.NullStrategy
.- Parameters:
strategy
- the drawing strategy ornull
to reset the strategy to the default- Since:
- 3.1
-
install
public void install()
Installs this projection support on its viewer.
-
dispose
public void dispose()
Disposes this projection support.
-
doEnableProjection
protected void doEnableProjection()
Enables projection mode. If not yet done, installs the projection ruler column in the viewer's vertical ruler and installs a painter that indicate the locations of collapsed regions.
-
doDisableProjection
protected void doDisableProjection()
Removes the projection ruler column and the painter from the projection viewer.
-
getAdapter
public <T> T getAdapter(ISourceViewer viewer, Class<T> required)
Implements the contract ofIAdaptable.getAdapter(java.lang.Class)
by forwarding the adapter requests to the given viewer.- Parameters:
viewer
- the viewerrequired
- the required class of the adapter- Returns:
- the adapter or
null
-
-