Package muntjac :: Package ui :: Module text_field :: Class TextField
[hide private]
[frames] | no frames]

Class TextField

source code

                            object --+                        
                                     |                        
                   util.IEventListener --+                    
                                         |                    
             terminal.paintable.IPaintable --+                
                                             |                
                                object --+   |                
                                         |   |                
    terminal.variable_owner.IVariableOwner --+                
                                             |                
                                object --+   |                
                                         |   |                
               terminal.sizeable.ISizeable --+                
                                             |                
                          component.IComponent --+            
                                                 |            
                                    object --+   |            
                                             |   |            
  event.method_event_source.IMethodEventSource --+            
                                                 |            
              abstract_component.AbstractComponent --+        
                                                     |        
                                object --+           |        
                                         |           |        
                   data.buffered.IBuffered --+       |        
                                             |       |        
                                object --+   |       |        
                                         |   |       |        
             data.validatable.IValidatable --+       |        
                                             |       |        
            data.buffered.IBufferedValidatable --+   |        
                                                 |   |        
                                    object --+   |   |        
                                             |   |   |        
            data.property.IValueChangeNotifier --+   |        
                                                 |   |        
                                    object --+   |   |        
                                             |   |   |        
            data.property.IValueChangeListener --+   |        
                                                 |   |        
                                object --+       |   |        
                                         |       |   |        
                     data.property.IViewer --+   |   |        
                                             |   |   |        
                         data.property.IEditor --+   |        
                                                 |   |        
                        object --+               |   |        
                                 |               |   |        
               util.IEventListener --+           |   |        
                                     |           |   |        
         terminal.paintable.IPaintable --+       |   |        
                                         |       |   |        
                            object --+   |       |   |        
                                     |   |       |   |        
terminal.variable_owner.IVariableOwner --+       |   |        
                                         |       |   |        
                            object --+   |       |   |        
                                     |   |       |   |        
           terminal.sizeable.ISizeable --+       |   |        
                                         |       |   |        
                      component.IComponent --+   |   |        
                                             |   |   |        
                          component.IFocusable --+   |        
                                                 |   |        
                                      field.IField --+        
                                                     |        
                                        object --+   |        
                                                 |   |        
                    event.action.IShortcutNotifier --+        
                                                     |        
                                        object --+   |        
                                                 |   |        
       data.property.IReadOnlyStatusChangeNotifier --+        
                                                     |        
                                        object --+   |        
                                                 |   |        
       data.property.IReadOnlyStatusChangeListener --+        
                                                     |        
                          abstract_field.AbstractField --+    
                                                         |    
                                            object --+   |    
                                                     |   |    
                      event.field_events.IBlurNotifier --+    
                                                         |    
                                            object --+   |    
                                                     |   |    
                     event.field_events.IFocusNotifier --+    
                                                         |    
                                            object --+   |    
                                                     |   |    
                event.field_events.ITextChangeNotifier --+    
                                                         |    
                     abstract_text_field.AbstractTextField --+
                                                             |
                                                            TextField
Known Subclasses:

A text editor component that can be bound to any bindable IProperty. The text editor supports both multiline and single line modes, default is one-line mode.

Since TextField extends AbstractField it implements the IBuffered interface. A TextField is in write-through mode by default, so AbstractField.setWriteThrough must be called to enable buffering.


Authors:
Vaadin Ltd., Richard Lincoln

Version: 1.1.2

Instance Methods [hide private]
 
__init__(self, *args)
Constructs a TextField with optional caption, dataSource and/or value.
source code
 
isSecret(self)
Gets the secret property.
source code
 
setSecret(self, secret)
Sets the secret property on and off.
source code
 
paintContent(self, target)
Paints any needed component-specific things to the given UIDL stream.
source code
 
getRows(self)
Gets the number of rows in the editor.
source code
 
setRows(self, rows)
Sets the number of rows in the editor.
source code
 
isWordwrap(self)
Tests if the editor is in word-wrap mode.
source code
 
setWordwrap(self, wordwrap)
Sets the editor's word-wrap mode on or off.
source code
 
setHeight(self, height, unit=None)
Sets the height of the TextField instance.
source code

Inherited from abstract_text_field.AbstractTextField: addCallback, addListener, changeVariables, firePendingTextChangeEvent, getColumns, getCurrentTextContent, getCursorPosition, getFormat, getFormattedValue, getInputPrompt, getMaxLength, getNullRepresentation, getTextChangeEventMode, getTextChangeTimeout, getType, getValue, handleInputEventTextChange, isEmpty, isNullSettingAllowed, removeCallback, removeListener, selectAll, setColumns, setCursorPosition, setFormat, setInputPrompt, setInternalValue, setMaxLength, setNullRepresentation, setNullSettingAllowed, setSelectionRange, setTextChangeEventMode, setTextChangeTimeout, setValue

Inherited from abstract_field.AbstractField: __str__, addShortcutListener, addValidator, attach, commit, detach, discard, fireReadOnlyStatusChange, fireValueChange, focus, getActionManager, getErrorMessage, getPropertyDataSource, getRequiredError, getTabIndex, getValidators, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isReadThrough, isRequired, isValid, isValidationVisible, isWriteThrough, readOnlyStatusChange, readValueFromProperty, removeShortcutListener, removeValidator, setCurrentBufferedSourceException, setInvalidAllowed, setInvalidCommitted, setPropertyDataSource, setReadOnly, setReadThrough, setRequired, setRequiredError, setTabIndex, setValidationVisible, setWriteThrough, shouldHideErrors, validate, valueChange

Inherited from abstract_component.AbstractComponent: __getstate__, __setstate__, addStyleName, childRequestedRepaint, fireComponentErrorEvent, fireComponentEvent, fireEvent, fireRequestRepaintEvent, getApplication, getCSSHeight, getCSSWidth, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getHeight, getHeightUnits, getIcon, getListeners, getLocale, getParent, getStyle, getStyleName, getWidth, getWidthUnits, getWindow, handleError, hasListeners, isEnabled, isImmediate, isVisible, paint, parseStringSize, registerCallback, registerListener, removeStyleName, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setErrorHandler, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, setWidth, setWidthUnits, withdrawCallback, withdrawListener

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

Class Methods [hide private]

Inherited from abstract_field.AbstractField: constructField

Class Variables [hide private]
  CLIENT_WIDGET = None
hash(x)

Inherited from abstract_component.AbstractComponent: SIZE_PATTERN

Inherited from terminal.sizeable.ISizeable: SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS, UNIT_SYMBOLS

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args)
(Constructor)

source code 

Constructs a TextField with optional caption, dataSource and/or value.

Parameters:
  • args - tuple of the form
    • ()
    • (caption)
      1. the caption string for the editor
    • (dataSource)
      1. the IProperty to be edited with this editor
    • (caption, dataSource)
      1. the caption string for the editor
      2. the IProperty to be edited with this editor
    • (caption, text)
      1. the caption string for the editor
      2. the initial text content of the editor
Overrides: object.__init__

isSecret(self)

source code 

Gets the secret property. If a field is used to enter secret information the information is not echoed to display.

Returns:
True if the field is used to enter secret information, False otherwise.

Deprecated: Use PasswordField instead for secret text input.

setSecret(self, secret)

source code 

Sets the secret property on and off. If a field is used to enter secret information the information is not echoed to display.

Parameters:
  • secret - the value specifying if the field is used to enter secret information.

Deprecated: Use PasswordField instead for secret text input.

paintContent(self, target)

source code 

Paints any needed component-specific things to the given UIDL stream. The more general paint method handles all general attributes common to all components, and it calls this method to paint any component-specific attributes to the UIDL stream.

Parameters:
  • target - the target UIDL stream where the component should paint itself to
Raises:
Overrides: abstract_component.AbstractComponent.paintContent
(inherited documentation)

getRows(self)

source code 

Gets the number of rows in the editor. If the number of rows is set to 0, the actual number of displayed rows is determined implicitly by the adapter.

Returns:
number of explicitly set rows.

Deprecated: Use TextArea for a multi-line text input.

setRows(self, rows)

source code 

Sets the number of rows in the editor.

Parameters:
  • rows - the number of rows for this editor.

Deprecated: Use TextArea for a multi-line text input.

isWordwrap(self)

source code 

Tests if the editor is in word-wrap mode.

Returns:
True if the component is in the word-wrap mode, False if not.

Deprecated: Use TextArea for a multi-line text input.

setWordwrap(self, wordwrap)

source code 

Sets the editor's word-wrap mode on or off.

Parameters:
  • wordwrap - the boolean value specifying if the editor should be in word-wrap mode after the call or not.

Deprecated: Use TextArea for a multi-line text input.

setHeight(self, height, unit=None)

source code 

Sets the height of the TextField instance.

Setting height for TextField also has a side-effect that puts TextField into multiline mode (aka "textarea"). Multiline mode can also be achieved by calling setRows. The height value overrides the number of rows set by setRows.

If you want to set height of single line TextField, call setRows with value 0 after setting the height. Setting rows to 0 resets the side-effect.

You should use TextArea instead of TextField for multiline text input.

Parameters:
  • args - tuple of the form
    • (height)
      1. the height of the object in units specified by heightUnits property or the height of the component using string presentation. String presentation is similar to what is used in Cascading Style Sheets. Size can be length or percentage of available size.
    • (height, unit)
      1. the height of the object.
      2. the unit used for the width. Possible values include UNITS_PIXELS, UNITS_POINTS, UNITS_PICAS, UNITS_EM, UNITS_EX, UNITS_MM, UNITS_CM, UNITS_INCH, UNITS_PERCENTAGE.
Overrides: terminal.sizeable.ISizeable.setHeight