Class MergingHighlightedPositionAcceptor
- java.lang.Object
-
- org.eclipse.xtext.ide.editor.syntaxcoloring.MergingHighlightedPositionAcceptor
-
- All Implemented Interfaces:
IHighlightedPositionAcceptor,ISemanticHighlightingCalculator
public class MergingHighlightedPositionAcceptor extends java.lang.Object implements IHighlightedPositionAcceptor, ISemanticHighlightingCalculator
Accepts a bunch of positions and creates a list of positions from them that do not overlap.- Since:
- 2.9
-
-
Constructor Summary
Constructors Constructor Description MergingHighlightedPositionAcceptor(ISemanticHighlightingCalculator delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPosition(int offset, int length, java.lang.String... ids)Associates a text range with a style.java.util.List<LightweightPosition>getPositions()voidmergePositions()protected LightweightPositionnewPosition(int offset, int length, int timestamp, java.lang.String... ids)protected LightweightPositionnewPosition(int offset, int length, int timestamp, LightweightPosition.IntToStringArray[] ids)voidprovideHighlightingFor(org.eclipse.xtext.resource.XtextResource resource, IHighlightedPositionAcceptor acceptor, org.eclipse.xtext.util.CancelIndicator cancelIndicator)
-
-
-
Constructor Detail
-
MergingHighlightedPositionAcceptor
public MergingHighlightedPositionAcceptor(ISemanticHighlightingCalculator delegate)
-
-
Method Detail
-
addPosition
public void addPosition(int offset, int length, java.lang.String... ids)Description copied from interface:IHighlightedPositionAcceptorAssociates a text range with a style.- Specified by:
addPositionin interfaceIHighlightedPositionAcceptor- Parameters:
offset- the offset of the range.length- the length of the range.ids- the ids of the highlighting style, that should be applied.
-
newPosition
protected LightweightPosition newPosition(int offset, int length, int timestamp, java.lang.String... ids)
-
newPosition
protected LightweightPosition newPosition(int offset, int length, int timestamp, LightweightPosition.IntToStringArray[] ids)
-
provideHighlightingFor
public void provideHighlightingFor(org.eclipse.xtext.resource.XtextResource resource, IHighlightedPositionAcceptor acceptor, org.eclipse.xtext.util.CancelIndicator cancelIndicator)- Specified by:
provideHighlightingForin interfaceISemanticHighlightingCalculator- Parameters:
resource- the resource that will be highlighted. May benullin some rare cases.acceptor- used to announce the mapping from text-range to the style's id. The acceptor will never benull.cancelIndicator- used to determine whether we should stop searching for highlighting positions (useOperationCanceledManagerto check)
-
mergePositions
public void mergePositions()
-
getPositions
public java.util.List<LightweightPosition> getPositions()
-
-