public class DefaultSemanticHighlightingCalculator extends java.lang.Object implements ISemanticHighlightingCalculator
Constructor and Description |
---|
DefaultSemanticHighlightingCalculator() |
Modifier and Type | Method and Description |
---|---|
protected void |
doProvideHighlightingFor(XtextResource resource,
IHighlightedPositionAcceptor acceptor,
CancelIndicator cancelIndicator)
Actual implementation of the semantic highlighting calculation.
|
protected boolean |
highlightElement(org.eclipse.emf.ecore.EObject object,
IHighlightedPositionAcceptor acceptor,
CancelIndicator cancelIndicator) |
protected void |
highlightElementRecursively(org.eclipse.emf.ecore.EObject element,
IHighlightedPositionAcceptor acceptor,
CancelIndicator cancelIndicator) |
protected void |
highlightFeature(IHighlightedPositionAcceptor acceptor,
org.eclipse.emf.ecore.EObject object,
org.eclipse.emf.ecore.EStructuralFeature feature,
java.lang.String... styleIds)
Highlights an object at the position of the given
EStructuralFeature |
protected void |
highlightNode(IHighlightedPositionAcceptor acceptor,
INode node,
java.lang.String... styleIds)
Highlights the non-hidden parts of
node with the styles given by the styleIds |
protected void |
highlightTasks(XtextResource resource,
IHighlightedPositionAcceptor acceptor) |
void |
provideHighlightingFor(XtextResource resource,
IHighlightedPositionAcceptor acceptor,
CancelIndicator cancelIndicator) |
protected void |
searchAndHighlightElements(XtextResource resource,
IHighlightedPositionAcceptor acceptor,
CancelIndicator cancelIndicator) |
public DefaultSemanticHighlightingCalculator()
public void provideHighlightingFor(XtextResource resource, IHighlightedPositionAcceptor acceptor, CancelIndicator cancelIndicator)
provideHighlightingFor
in interface ISemanticHighlightingCalculator
resource
- the resource that will be highlighted. May be null
in some rare cases.acceptor
- used to announce the mapping from text-range to the style's id. The acceptor will never be null
.cancelIndicator
- used to determine whether we should stop searching for highlighting positions
(use OperationCanceledManager
to check)protected void doProvideHighlightingFor(XtextResource resource, IHighlightedPositionAcceptor acceptor, CancelIndicator cancelIndicator)
Actual implementation of the semantic highlighting calculation. It is ensured, that the given resource is not
null
and refers to an initialized parse result.
By default this will visit the elements in the resource recursively and call
highlightElement(EObject, IHighlightedPositionAcceptor, CancelIndicator)
for each of them. As the
last step, tasks will be highlighted.
Clients can override this method if the default recursive approach does not fit their use case
resource
- a valid to-be-processed resource. Is never null
.acceptor
- the acceptor. Is never null
.protected void searchAndHighlightElements(XtextResource resource, IHighlightedPositionAcceptor acceptor, CancelIndicator cancelIndicator)
protected void highlightElementRecursively(org.eclipse.emf.ecore.EObject element, IHighlightedPositionAcceptor acceptor, CancelIndicator cancelIndicator)
protected boolean highlightElement(org.eclipse.emf.ecore.EObject object, IHighlightedPositionAcceptor acceptor, CancelIndicator cancelIndicator)
protected void highlightTasks(XtextResource resource, IHighlightedPositionAcceptor acceptor)
protected void highlightFeature(IHighlightedPositionAcceptor acceptor, org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.String... styleIds)
EStructuralFeature
protected void highlightNode(IHighlightedPositionAcceptor acceptor, INode node, java.lang.String... styleIds)
node
with the styles given by the styleIds