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
Modifier and TypeFieldDescriptionprotected TextAttribute
The default text attribute if non is returned as data by the current token.protected IDocument
The document this object works on. -
Constructor Summary
ConstructorDescriptionNonRuleBasedDamagerRepairer
(TextAttribute defaultTextAttribute) Constructor for NonRuleBasedDamagerRepairer. -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.getDamageRegion
(ITypedRegion partition, DocumentEvent event, boolean documentPartitioningChanged) void
setDocument
(IDocument document)
-
Field Details
-
fDocument
The document this object works on. -
fDefaultTextAttribute
The default text attribute if non is returned as data by the current token.
-
-
Constructor Details
-
NonRuleBasedDamagerRepairer
Constructor for NonRuleBasedDamagerRepairer.- Parameters:
defaultTextAttribute
- a TextAttribute
-
-
Method Details
-
setDocument
- Specified by:
setDocument
in interfaceIPresentationDamager
- Specified by:
setDocument
in interfaceIPresentationRepairer
- Parameters:
document
- an IDocument- See Also:
-
endOfLineOf
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:
-
createPresentation
- Specified by:
createPresentation
in interfaceIPresentationRepairer
- Parameters:
presentation
- the TextPresentationregion
- an ITypedRegion- See Also:
-
addRange
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
-