Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.jface.text
Class TextEvent


java.lang.Object
  extended by 
org.eclipse.jface.text.TextEvent

public class TextEvent
extends Object

This event is sent to implementers of ITextListener. It represents a change applied to text viewer. The change is specified as a replace command using offset, length, inserted text, and replaced text. The text viewer issues a text event after the viewer has been changed either in response to a change of the viewer's document or when the viewer's visual content has been changed. In the first case, the text event also carries the original document event. Depending on the viewer's presentation mode, the text event coordinates are different from the document event's coordinates.

An empty text event usually indicates a change of the viewer's redraw state.

Clients other than text viewer's don't create instances of this class.

See Also:
ITextListener, ITextViewer, DocumentEvent

Constructor Summary
protected TextEvent (int offset, int length, String text, String replacedText, DocumentEvent event, boolean viewerRedrawState)
          Creates a new TextEvent based on the specification.
 
Method Summary
  DocumentEvent getDocumentEvent ()
          Returns the corresponding document event that caused the viewer change
 int getLength ()
          Returns the length of the event.
 int getOffset ()
          Returns the offset of the event.
  String getReplacedText ()
          Returns the text replaced by this event.
  String getText ()
          Returns the text of the event.
 boolean getViewerRedrawState ()
          Returns the viewer's redraw state.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextEvent

protected TextEvent(int offset,
                    int length,
                    
String text,
                    
String replacedText,
                    
DocumentEvent event,
                    boolean viewerRedrawState)
Creates a new TextEvent based on the specification.

Parameters:
offset - the offset
length - the length
text - the inserted text
replacedText - the replaced text
event - the associated document event or null if none
viewerRedrawState - the redraw state of the viewer
Method Detail

getOffset

public int getOffset()
Returns the offset of the event.

Returns:
the offset of the event

getLength

public int getLength()
Returns the length of the event.

Returns:
the length of the event

getText

public 
String getText()
Returns the text of the event.

Returns:
the text of the event

getReplacedText

public 
String getReplacedText()
Returns the text replaced by this event.

Returns:
the text replaced by this event

getDocumentEvent

public 
DocumentEvent getDocumentEvent()
Returns the corresponding document event that caused the viewer change

Returns:
the corresponding document event, null if a visual change only

getViewerRedrawState

public boolean getViewerRedrawState()
Returns the viewer's redraw state.

Returns:
true if the viewer's redraw state is true
Since:
2.0

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire