com.vaadin.event
Class FieldEvents.TextChangeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.vaadin.ui.Component.Event
          extended by com.vaadin.event.FieldEvents.TextChangeEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AbstractTextField.TextChangeEventImpl
Enclosing interface:
FieldEvents

public abstract static class FieldEvents.TextChangeEvent
extends Component.Event

TextChangeEvents are fired when the user is editing the text content of a field. Most commonly text change events are triggered by typing text with keyboard, but e.g. pasting content from clip board to a text field also triggers an event.

TextChangeEvents differ from Field.ValueChangeEvents so that they are triggered repeatedly while the end user is filling the field. ValueChangeEvents are not fired until the user for example hits enter or focuses another field. Also note the difference that TextChangeEvents are only fired if the change is triggered from the user, while ValueChangeEvents are also fired if the field value is set by the application code.

The FieldEvents.TextChangeNotifiers implementation may decide when exactly TextChangeEvents are fired. TextChangeEvents are not necessary fire for example on each key press, but buffered with a small delay. The TextField component supports different modes for triggering TextChangeEvents.

Since:
6.5
See Also:
FieldEvents.TextChangeListener, FieldEvents.TextChangeNotifier, TextField#setTextChangeEventMode(com.vaadin.ui.TextField.TextChangeEventMode), Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
FieldEvents.TextChangeEvent(Component source)
           
 
Method Summary
abstract  int getCursorPosition()
           
abstract  String getText()
           
 
Methods inherited from class com.vaadin.ui.Component.Event
getComponent
 
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

FieldEvents.TextChangeEvent

public FieldEvents.TextChangeEvent(Component source)
Method Detail

getText

public abstract String getText()
Returns:
the text content of the field after the FieldEvents.TextChangeEvent

getCursorPosition

public abstract int getCursorPosition()
Returns:
the cursor position during after the FieldEvents.TextChangeEvent


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.