Class NonRuleBasedDamagerRepairer
java.lang.Object
org.apache.uima.taeconfigurator.editors.xml.NonRuleBasedDamagerRepairer
- All Implemented Interfaces:
org.eclipse.jface.text.presentation.IPresentationDamager
,org.eclipse.jface.text.presentation.IPresentationRepairer
public class NonRuleBasedDamagerRepairer
extends Object
implements org.eclipse.jface.text.presentation.IPresentationDamager, org.eclipse.jface.text.presentation.IPresentationRepairer
The Class NonRuleBasedDamagerRepairer.
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.eclipse.jface.text.TextAttribute
The default text attribute if non is returned as data by the current token.protected org.eclipse.jface.text.IDocument
The document this object works on. -
Constructor Summary
ConstructorDescriptionNonRuleBasedDamagerRepairer
(org.eclipse.jface.text.TextAttribute defaultTextAttribute) Constructor for NonRuleBasedDamagerRepairer. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addRange
(org.eclipse.jface.text.TextPresentation presentation, int offset, int length, org.eclipse.jface.text.TextAttribute attr) Adds style information to the given text presentation.void
createPresentation
(org.eclipse.jface.text.TextPresentation presentation, org.eclipse.jface.text.ITypedRegion region) Creates the presentation.protected int
endOfLineOf
(int offset) Returns the end offset of the line that contains the specified offset or if the offset is inside a line delimiter, the end offset of the next line.org.eclipse.jface.text.IRegion
getDamageRegion
(org.eclipse.jface.text.ITypedRegion partition, org.eclipse.jface.text.DocumentEvent event, boolean documentPartitioningChanged) Gets the damage region.void
setDocument
(org.eclipse.jface.text.IDocument document) Sets the document.
-
Field Details
-
fDocument
protected org.eclipse.jface.text.IDocument fDocumentThe document this object works on. -
fDefaultTextAttribute
protected org.eclipse.jface.text.TextAttribute fDefaultTextAttributeThe default text attribute if non is returned as data by the current token.
-
-
Constructor Details
-
NonRuleBasedDamagerRepairer
public NonRuleBasedDamagerRepairer(org.eclipse.jface.text.TextAttribute defaultTextAttribute) Constructor for NonRuleBasedDamagerRepairer.- Parameters:
defaultTextAttribute
- the default text attribute
-
-
Method Details
-
setDocument
public void setDocument(org.eclipse.jface.text.IDocument document) Sets the document.- Specified by:
setDocument
in interfaceorg.eclipse.jface.text.presentation.IPresentationDamager
- Specified by:
setDocument
in interfaceorg.eclipse.jface.text.presentation.IPresentationRepairer
- Parameters:
document
- the new document- See Also:
-
endOfLineOf
protected int endOfLineOf(int offset) throws org.eclipse.jface.text.BadLocationException Returns the end offset of the line that contains the specified offset or if the offset is inside a line delimiter, the end offset of the next line.- Parameters:
offset
- the offset whose line end offset must be computed- Returns:
- the line end offset for the given offset
- Throws:
org.eclipse.jface.text.BadLocationException
- if offset is invalid in the current document
-
getDamageRegion
public org.eclipse.jface.text.IRegion getDamageRegion(org.eclipse.jface.text.ITypedRegion partition, org.eclipse.jface.text.DocumentEvent event, boolean documentPartitioningChanged) Gets the damage region.- Specified by:
getDamageRegion
in interfaceorg.eclipse.jface.text.presentation.IPresentationDamager
- Parameters:
partition
- the partitionevent
- the eventdocumentPartitioningChanged
- the document partitioning changed- Returns:
- the damage region
- See Also:
-
createPresentation
public void createPresentation(org.eclipse.jface.text.TextPresentation presentation, org.eclipse.jface.text.ITypedRegion region) Creates the presentation.- Specified by:
createPresentation
in interfaceorg.eclipse.jface.text.presentation.IPresentationRepairer
- Parameters:
presentation
- the presentationregion
- the region- See Also:
-
addRange
protected void addRange(org.eclipse.jface.text.TextPresentation presentation, int offset, int length, org.eclipse.jface.text.TextAttribute attr) Adds style information to the given text presentation.- Parameters:
presentation
- the text presentation to be extendedoffset
- the offset of the range to be styledlength
- the length of the range to be styledattr
- the attribute describing the style of the range to be styled
-