Class NonRuleBasedDamagerRepairer
java.lang.Object
org.libreoffice.ide.eclipse.core.editors.syntax.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 UNO-IDL document repairer. This is used by the UNO-IDL editor. In order to fully understand the editor
mechanisms, please report to Eclipse plugin developer's guide.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.eclipse.jface.text.TextAttributeThe default text attribute if non is returned as data by the current token.protected org.eclipse.jface.text.IDocumentThe document this object works on . -
Constructor Summary
ConstructorsConstructorDescriptionNonRuleBasedDamagerRepairer(org.eclipse.jface.text.TextAttribute defaultTextAttribute) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddRange(org.eclipse.jface.text.TextPresentation presentation, int offset, int length, org.eclipse.jface.text.TextAttribute attr) Adds style information to the given text presentation.voidcreatePresentation(org.eclipse.jface.text.TextPresentation pPresentation, org.eclipse.jface.text.ITypedRegion pRegion) protected intendOfLineOf(int offset) Returns the end offset of the line that contains the specified offset.org.eclipse.jface.text.IRegiongetDamageRegion(org.eclipse.jface.text.ITypedRegion partition, org.eclipse.jface.text.DocumentEvent event, boolean documentPartitioningChanged) voidsetDocument(org.eclipse.jface.text.IDocument document)
-
Field Details
-
mDocument
protected org.eclipse.jface.text.IDocument mDocumentThe document this object works on . -
mDefaultTextAttribute
protected org.eclipse.jface.text.TextAttribute mDefaultTextAttributeThe default text attribute if non is returned as data by the current token.
-
-
Constructor Details
-
NonRuleBasedDamagerRepairer
public NonRuleBasedDamagerRepairer(org.eclipse.jface.text.TextAttribute defaultTextAttribute) Default constructor.- Parameters:
defaultTextAttribute- the attribute to assign to default text
-
-
Method Details
-
setDocument
public void setDocument(org.eclipse.jface.text.IDocument document) - Specified by:
setDocumentin interfaceorg.eclipse.jface.text.presentation.IPresentationDamager- Specified by:
setDocumentin interfaceorg.eclipse.jface.text.presentation.IPresentationRepairer
-
endOfLineOf
protected int endOfLineOf(int offset) throws org.eclipse.jface.text.BadLocationException Returns the end offset of the line that contains the specified offset. 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) - Specified by:
getDamageRegionin interfaceorg.eclipse.jface.text.presentation.IPresentationDamager
-
createPresentation
public void createPresentation(org.eclipse.jface.text.TextPresentation pPresentation, org.eclipse.jface.text.ITypedRegion pRegion) - Specified by:
createPresentationin interfaceorg.eclipse.jface.text.presentation.IPresentationRepairer
-
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
-