Class NonRuleBasedDamagerRepairer

  • All Implemented Interfaces:
    org.eclipse.jface.text.presentation.IPresentationDamager, org.eclipse.jface.text.presentation.IPresentationRepairer

    public class NonRuleBasedDamagerRepairer
    extends java.lang.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

      Fields 
      Modifier and Type Field Description
      protected org.eclipse.jface.text.TextAttribute mDefaultTextAttribute
      The default text attribute if non is returned as data by the current token.
      protected org.eclipse.jface.text.IDocument mDocument
      The document this object works on .
    • Constructor Summary

      Constructors 
      Constructor Description
      NonRuleBasedDamagerRepairer​(org.eclipse.jface.text.TextAttribute pDefaultTextAttribute)
      Default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addRange​(org.eclipse.jface.text.TextPresentation pPresentation, int pOffset, int pLength, org.eclipse.jface.text.TextAttribute pAttr)
      Adds style information to the given text presentation.
      void createPresentation​(org.eclipse.jface.text.TextPresentation pPresentation, org.eclipse.jface.text.ITypedRegion pRegion)
      protected int endOfLineOf​(int pOffset)
      Returns the end offset of the line that contains the specified offset.
      org.eclipse.jface.text.IRegion getDamageRegion​(org.eclipse.jface.text.ITypedRegion pPartition, org.eclipse.jface.text.DocumentEvent pEvent, boolean pDocumentPartitioningChanged)
      void setDocument​(org.eclipse.jface.text.IDocument pDocument)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mDocument

        protected org.eclipse.jface.text.IDocument mDocument
        The document this object works on .
      • mDefaultTextAttribute

        protected org.eclipse.jface.text.TextAttribute mDefaultTextAttribute
        The default text attribute if non is returned as data by the current token.
    • Constructor Detail

      • NonRuleBasedDamagerRepairer

        public NonRuleBasedDamagerRepairer​(org.eclipse.jface.text.TextAttribute pDefaultTextAttribute)
        Default constructor.
        Parameters:
        pDefaultTextAttribute - the attribute to assign to default text
    • Method Detail

      • setDocument

        public void setDocument​(org.eclipse.jface.text.IDocument pDocument)
        Specified by:
        setDocument in interface org.eclipse.jface.text.presentation.IPresentationDamager
        Specified by:
        setDocument in interface org.eclipse.jface.text.presentation.IPresentationRepairer
      • endOfLineOf

        protected int endOfLineOf​(int pOffset)
                           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:
        pOffset - 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 pPartition,
                                                              org.eclipse.jface.text.DocumentEvent pEvent,
                                                              boolean pDocumentPartitioningChanged)
        Specified by:
        getDamageRegion in interface org.eclipse.jface.text.presentation.IPresentationDamager
      • createPresentation

        public void createPresentation​(org.eclipse.jface.text.TextPresentation pPresentation,
                                       org.eclipse.jface.text.ITypedRegion pRegion)
        Specified by:
        createPresentation in interface org.eclipse.jface.text.presentation.IPresentationRepairer
      • addRange

        protected void addRange​(org.eclipse.jface.text.TextPresentation pPresentation,
                                int pOffset,
                                int pLength,
                                org.eclipse.jface.text.TextAttribute pAttr)
        Adds style information to the given text presentation.
        Parameters:
        pPresentation - the text presentation to be extended
        pOffset - the offset of the range to be styled
        pLength - the length of the range to be styled
        pAttr - the attribute describing the style of the range to be styled