Class DocumentEvent

  • Direct Known Subclasses:

    public class DocumentEvent
    extends Object
    Specification of changes applied to documents. All changes are represented as replace commands, i.e. specifying a document range whose text gets replaced with different text. In addition to this information, the event also contains the changed document.
    See Also:
    • Field Detail

      • fDocument

        public IDocument fDocument
        The changed document
      • fOffset

        public int fOffset
        The document offset
      • fLength

        public int fLength
        Length of the replaced document text
      • fText

        public String fText
        Text inserted into the document
      • fModificationStamp

        public long fModificationStamp
        The modification stamp of the document when firing this event.
        3.1 and public since 3.3
    • Constructor Detail

      • DocumentEvent

        public DocumentEvent​(IDocument doc,
                             int offset,
                             int length,
                             String text)
        Creates a new document event.
        doc - the changed document
        offset - the offset of the replaced text
        length - the length of the replaced text
        text - the substitution text
      • DocumentEvent

        public DocumentEvent()
        Creates a new, not initialized document event.
    • Method Detail

      • getDocument

        public IDocument getDocument()
        Returns the changed document.
        the changed document
      • getOffset

        public int getOffset()
        Returns the offset of the change.
        the offset of the change
      • getLength

        public int getLength()
        Returns the length of the replaced text.
        the length of the replaced text
      • getText

        public String getText()
        Returns the text that has been inserted.
        the text that has been inserted