Eclipse Platform
2.0

org.eclipse.jface.text
Class DocumentEvent

java.lang.Object
  |
  +--org.eclipse.jface.text.DocumentEvent

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:
IDocument

Constructor Summary
DocumentEvent(IDocument doc, int offset, int length, String text)
          Creates a new document event.
 
Method Summary
 IDocument getDocument()
          Returns the changed document.
 int getLength()
          Returns the length of the replaced text.
 int getOffset()
          Returns the offset of the change
 String getText()
          Returns the text that has been inserted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentEvent

public DocumentEvent(IDocument doc,
                     int offset,
                     int length,
                     String text)
Creates a new document event.

Parameters:
doc - the changed document
offset - the offset of the replaced text
length - the length of the replaced text
text - the substitution text
Method Detail

getDocument

public IDocument getDocument()
Returns the changed document.

Returns:
the changed document

getOffset

public int getOffset()
Returns the offset of the change

Returns:
the offset of the change

getLength

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

Returns:
the length of the replaced text

getText

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

Returns:
the text that has been inserted

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.