Class ProjectionSupport
java.lang.Object
org.eclipse.jface.text.source.projection.ProjectionSupport
Supports the configuration of projection capabilities a
ProjectionViewer
.
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
Modifier and TypeFieldDescriptionstatic final Object
Key of the projection annotation model inside the visual annotation model. -
Constructor Summary
ConstructorDescriptionProjectionSupport
(ProjectionViewer viewer, IAnnotationAccess annotationAccess, ISharedTextColors sharedTextColors) Creates new projection support for the given projection viewer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Removes the projection ruler column and the painter from the projection viewer.protected void
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
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
Sets the hover control creator that is used for the annotation hovers that are shown in the projection viewer's projection ruler column.void
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 Details
-
PROJECTION
Key of the projection annotation model inside the visual annotation model. Also internally used as key for the projection drawing strategy.
-
-
Constructor Details
-
Method Details
-
addSummarizableAnnotationType
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
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
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
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
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
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
-