public class NonRuleBasedDamagerRepairer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected TextAttribute |
fDefaultTextAttribute
The default text attribute if non is returned as data by the current token
|
protected IDocument |
fDocument
The document this object works on
|
Constructor and Description |
---|
NonRuleBasedDamagerRepairer(TextAttribute defaultTextAttribute)
Constructor for NonRuleBasedDamagerRepairer.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addRange(TextPresentation presentation,
int offset,
int length,
TextAttribute attr)
Adds style information to the given text presentation.
|
void |
createPresentation(TextPresentation presentation,
ITypedRegion region) |
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.
|
IRegion |
getDamageRegion(ITypedRegion partition,
DocumentEvent event,
boolean documentPartitioningChanged) |
void |
setDocument(IDocument document) |
protected IDocument fDocument
protected TextAttribute fDefaultTextAttribute
public NonRuleBasedDamagerRepairer(TextAttribute defaultTextAttribute)
public void setDocument(IDocument document)
IPresentationRepairer#setDocument(IDocument)
protected int endOfLineOf(int offset) throws BadLocationException
offset
- the offset whose line end offset must be computedBadLocationException
- if offset is invalid in the current documentpublic IRegion getDamageRegion(ITypedRegion partition, DocumentEvent event, boolean documentPartitioningChanged)
IPresentationDamager#getDamageRegion(ITypedRegion, DocumentEvent, boolean)
public void createPresentation(TextPresentation presentation, ITypedRegion region)
IPresentationRepairer#createPresentation(TextPresentation, ITypedRegion)
protected void addRange(TextPresentation presentation, int offset, int length, TextAttribute attr)
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