Package muntjac :: Package event :: Module field_events :: Class TextChangeEvent
[hide private]
[frames] | no frames]

Class TextChangeEvent

source code

      object --+        
               |        
util.EventObject --+    
                   |    
  ui.component.Event --+
                       |
                      TextChangeEvent

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 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 ITextChangeNotifiers 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.


See Also:
ITextChangeListener, ITextChangeNotifier, TextField.setTextChangeEventMode
Instance Methods [hide private]
 
__init__(self, source)
Constructs a new event with the specified source component.
source code
 
getText(self)
Returns: the text content of the field after the TextChangeEvent
source code
 
getCursorPosition(self)
Returns: the cursor position during after the TextChangeEvent
source code

Inherited from ui.component.Event: getComponent

Inherited from util.EventObject: getSource

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, source)
(Constructor)

source code 

Constructs a new event with the specified source component.

Parameters:
  • source - the source component of the event
Overrides: object.__init__
(inherited documentation)

getText(self)

source code 
Returns:
the text content of the field after the TextChangeEvent

getCursorPosition(self)

source code 
Returns:
the cursor position during after the TextChangeEvent