Package muntjac :: Package ui :: Module rich_text_area :: Class RichTextArea
[hide private]
[frames] | no frames]

Class RichTextArea

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 --+
                                                         |
                                                        RichTextArea

A simple RichTextArea to edit HTML format text.

Note, that using TextField.setMaxLength method in RichTextArea may produce unexpected results as formatting is counted into length of field.

Instance Methods [hide private]
 
__init__(self, *args)
Constructs an empty RichTextArea with optional caption, value and/or data source.
source code
 
paintContent(self, target)
Paints any needed component-specific things to the given UIDL stream.
source code
 
setReadOnly(self, readOnly)
Changes the readonly state and throw read-only status change events.
source code
 
selectAll(self)
Selects all text in the rich text area.
source code
 
getFormattedValue(self)
Gets the formatted string value.
source code
 
getValue(self)
Gets the current value of the field.
source code
 
changeVariables(self, source, variables)
Called when one or more variables handled by the implementing class are changed.
source code
 
getType(self) source code
 
getNullRepresentation(self)
Gets the null-string representation.
source code
 
isNullSettingAllowed(self)
Is setting nulls with null-string representation allowed.
source code
 
setNullRepresentation(self, nullRepresentation)
Sets the null-string representation.
source code
 
setNullSettingAllowed(self, nullSettingAllowed)
Sets the null conversion mode.
source code
 
getFormat(self)
Gets the value formatter of TextField.
source code
 
setFormat(self, frmt)
Gets the value formatter of TextField.
source code
 
isEmpty(self)
Is the field empty?
source code

Inherited from abstract_field.AbstractField: __str__, addCallback, addListener, 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, removeCallback, removeListener, removeShortcutListener, removeValidator, setCurrentBufferedSourceException, setInternalValue, setInvalidAllowed, setInvalidCommitted, setPropertyDataSource, setReadThrough, setRequired, setRequiredError, setTabIndex, setValidationVisible, setValue, 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, setHeight, 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 an empty RichTextArea with optional caption, value and/or data source.

Parameters:
  • args - tuple of the form
    • ()
    • (caption)
      1. the caption for the editor.
    • (dataSource)
      1. the data source for the editor value
    • (caption, dataSource)
      1. the caption for the editor.
      2. the data source for the editor value
    • (caption, value)
      1. the caption for the editor.
      2. the initial text content of the editor.
Overrides: object.__init__

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)

setReadOnly(self, readOnly)

source code 

Changes the readonly state and throw read-only status change events.

Parameters:
  • readOnly - a boolean value specifying whether the component is put read-only mode or not
Overrides: component.IComponent.setReadOnly
(inherited documentation)

selectAll(self)

source code 

Selects all text in the rich text area. As a side effect, focuses the rich text area.

getFormattedValue(self)

source code 

Gets the formatted string value. Sets the field value by using the assigned Format.

Returns:
the Formatted value.

See Also: setFormat

Deprecated:  

getValue(self)

source code 

Gets the current value of the field.

This is the visible, modified and possible invalid value the user have entered to the field. In the read-through mode, the abstract buffer is also updated and validation is performed.

Note that the object returned is compatible with getType(). For example, if the type is String, this returns Strings even when the underlying datasource is of some other type. In order to access the datasources native type, use getPropertyDatasource().getValue() instead.

Note that when you extend AbstractField, you must reimplement this method if datasource.getValue() is not assignable to class returned by getType() AND getType() is not String. In case of Strings, getValue() calls datasource.toString() instead of datasource.getValue().

Returns:
the current value of the field.
Overrides: abstract_field.AbstractField.getValue
(inherited documentation)

changeVariables(self, source, variables)

source code 

Called when one or more variables handled by the implementing class are changed.

Parameters:
  • source - the Source of the variable change. This is the origin of the event. For example in Web Adapter this is the request.
  • variables - the Mapping from variable names to new variable values.
Overrides: terminal.variable_owner.IVariableOwner.changeVariables
(inherited documentation)

getType(self)

source code 
Overrides: abstract_field.AbstractField.getType

getNullRepresentation(self)

source code 

Gets the null-string representation.

The null-valued strings are represented on the user interface by replacing the null value with this string. If the null representation is set null (not 'null' string), painting null value throws exception.

The default value is string 'null'.

Returns:
the string textual representation for null strings.

See Also: TextField.isNullSettingAllowed

isNullSettingAllowed(self)

source code 

Is setting nulls with null-string representation allowed.

If this property is true, writing null-representation string to text field always sets the field value to real null. If this property is false, null setting is not made, but the null values are maintained. Maintenance of null-values is made by only converting the textfield contents to real null, if the text field matches the null-string representation and the current value of the field is null.

By default this setting is false

Returns:
Should the null-string represenation be always converted to null-values.

See Also: TextField.getNullRepresentation

setNullRepresentation(self, nullRepresentation)

source code 

Sets the null-string representation.

The null-valued strings are represented on the user interface by replacing the null value with this string. If the null representation is set null (not 'null' string), painting null value throws exception.

The default value is string 'null'

Parameters:
  • nullRepresentation - Textual representation for null strings.

See Also: TextField.setNullSettingAllowed

setNullSettingAllowed(self, nullSettingAllowed)

source code 

Sets the null conversion mode.

If this property is true, writing null-representation string to text field always sets the field value to real null. If this property is false, null setting is not made, but the null values are maintained. Maintenance of null-values is made by only converting the textfield contents to real null, if the text field matches the null-string representation and the current value of the field is null.

By default this setting is false.

Parameters:
  • nullSettingAllowed - Should the null-string representation be always converted to null-values.

See Also: TextField.getNullRepresentation

getFormat(self)

source code 

Gets the value formatter of TextField.

Returns:
the format used to format the value.

Deprecated: replaced by PropertyFormatter

setFormat(self, frmt)

source code 

Gets the value formatter of TextField.

Parameters:
  • frmt - the format used to format the value. Null disables the formatting.

Deprecated: replaced by PropertyFormatter

isEmpty(self)

source code 

Is the field empty?

In general, "empty" state is same as null. As an exception, TextField also treats empty string as "empty".

Overrides: abstract_field.AbstractField.isEmpty
(inherited documentation)