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 JDT
Release 3.5

org.eclipse.jdt.core
Class BufferChangedEvent


java.lang.Object
  extended by 

java.util.EventObject
      extended by 
org.eclipse.jdt.core.BufferChangedEvent
All Implemented Interfaces:
Serializable

public class BufferChangedEvent
extends EventObject

A buffer changed event describes how a buffer has changed. These events are used in IBufferChangedListener notifications.

For text insertions, getOffset is the offset of the first inserted character, getText is the inserted text, and getLength is 0.

For text removals, getOffset is the offset of the first removed character, getText is null, and getLength is the length of the text that was removed.

For replacements (including IBuffer.setContents), getOffset is the offset of the first replaced character, getText is the replacement text, and getLength is the length of the original text that was replaced.

When a buffer is closed, getOffset is 0, getLength is 0, and getText is null.

Instances of this class are automatically created by the Java model.

See Also:
IBuffer, Serialized Form
Restriction:
This class is not intended to be subclassed by clients.
Restriction:
This class is not intended to be instantiated by clients.

Field Summary
 
Fields inherited from class java.util. EventObject
source
 
Constructor Summary
BufferChangedEvent ( IBuffer buffer, int offset, int length, String text)
          Creates a new buffer changed event indicating that the given buffer has changed.
 
Method Summary
  IBuffer getBuffer ()
          Returns the buffer which has changed.
 int getLength ()
          Returns the length of text removed or replaced in the buffer, or 0 if text has been inserted into the buffer.
 int getOffset ()
          Returns the index of the first character inserted, removed, or replaced in the buffer.
  String getText ()
          Returns the text that was inserted, the replacement text, or null if text has been removed.
 
Methods inherited from class java.util. EventObject
getSource, toString
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BufferChangedEvent

public BufferChangedEvent(
IBuffer buffer,
                          int offset,
                          int length,
                          
String text)
Creates a new buffer changed event indicating that the given buffer has changed.

Parameters:
buffer - the given buffer
offset - the given offset
length - the given length
text - the given text
Method Detail

getBuffer

public 
IBuffer getBuffer()
Returns the buffer which has changed.

Returns:
the buffer affected by the change

getLength

public int getLength()
Returns the length of text removed or replaced in the buffer, or 0 if text has been inserted into the buffer.

Returns:
the length of the original text fragment modified by the buffer change ( 0 in case of insertion).

getOffset

public int getOffset()
Returns the index of the first character inserted, removed, or replaced in the buffer.

Returns:
the source offset of the textual manipulation in the buffer

getText

public 
String getText()
Returns the text that was inserted, the replacement text, or null if text has been removed.

Returns:
the text corresponding to the buffer change ( null in case of deletion).

Eclipse JDT
Release 3.5

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

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