Class NonRuleBasedDamagerRepairer
- java.lang.Object
-
- de.uka.ipd.sdq.pcm.gmf.resource.editors.NonRuleBasedDamagerRepairer
-
- All Implemented Interfaces:
IPresentationDamager
,IPresentationRepairer
public class NonRuleBasedDamagerRepairer extends Object implements IPresentationDamager, IPresentationRepairer
A non rules based damage repairer.
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description NonRuleBasedDamagerRepairer(TextAttribute defaultTextAttribute)
Constructor for NonRuleBasedDamagerRepairer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
-
-
Field Detail
-
fDocument
protected IDocument fDocument
The document this object works on.
-
fDefaultTextAttribute
protected TextAttribute fDefaultTextAttribute
The default text attribute if non is returned as data by the current token.
-
-
Constructor Detail
-
NonRuleBasedDamagerRepairer
public NonRuleBasedDamagerRepairer(TextAttribute defaultTextAttribute)
Constructor for NonRuleBasedDamagerRepairer.- Parameters:
defaultTextAttribute
- a TextAttribute
-
-
Method Detail
-
setDocument
public void setDocument(IDocument document)
- Specified by:
setDocument
in interfaceIPresentationDamager
- Specified by:
setDocument
in interfaceIPresentationRepairer
- Parameters:
document
- an IDocument- See Also:
IPresentationRepairer.setDocument(IDocument)
-
endOfLineOf
protected int endOfLineOf(int offset) throws 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:
BadLocationException
- if offset is invalid in the current document
-
getDamageRegion
public IRegion getDamageRegion(ITypedRegion partition, DocumentEvent event, boolean documentPartitioningChanged)
- Specified by:
getDamageRegion
in interfaceIPresentationDamager
- Parameters:
partition
- and ITypedRegiondocumentPartitioningChanged
- true if the partitioning has changedevent
- an event Notification- Returns:
- partition
- See Also:
IPresentationDamager.getDamageRegion(ITypedRegion, DocumentEvent, boolean)
-
createPresentation
public void createPresentation(TextPresentation presentation, ITypedRegion region)
- Specified by:
createPresentation
in interfaceIPresentationRepairer
- Parameters:
presentation
- the TextPresentationregion
- an ITypedRegion- See Also:
IPresentationRepairer.createPresentation(TextPresentation, ITypedRegion)
-
addRange
protected void addRange(TextPresentation presentation, int offset, int length, 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
-
-