JC Text Editor Methods
Overview | Properties | Methods | Events
Method | Description |
JCTextEditor |
Creates a new JCTextEditor instance. Parameters initObj:Object - default = null |
addControl |
Adds a new control into the text editor component.
Parameters type:String - The type of control that should be added. Possible values are Font, Size, Color, Bold, Italic, Underline, LeftAlign, CenterAlign, RightAlign, JustifyAlign and Link. control:DisplayObject - default = null. A reference to an already existing control in the display list that should be used, instead of the component's standard control. The custom control will not be removed from the place it already is and it will continue to have the same object as parent. position:int - (default = -1). The index where the new control should be added. The first position has the index of 0. The default value is -1 which means that the new control will be added at the last position in the control list. |
getControl |
Retrieves the control used for the settings specified in the type parameter.
Parameters type:String - The type of control to look for. Possible values are Font, Size, Color, Bold, Italic, Underline, LeftAlign, CenterAlign, RightAlign, JustifyAlign and Link. Returns BaseControl - A reference to the desired control. |
getSelectionText |
Returns the selected text from the text field. If the component has no target text field, then the function will return an empty String.
Returns String - The selected text from the text field. |
getTextFormat |
Returns the text format currently used by the component.
Returns TextFormat - The text format currently used by the component. |
removeAll | Removes all the controls displayed in the text editor. |
removeControl |
Removes the specified type of control.
Parameters type:String - The type of control to remove. Possible values are Font, Size, Color, Bold, Italic, Underline, LeftAlign, CenterAlign, RightAlign, JustifyAlign and Link. |
setFocusBack |
Sets the focus and selection back to the target text field. If there was a text selected before the text field lost focus, that text will be reselected.
Parameters setFocus:Boolean - default = true. A boolean value that specifies whether to set focus to the target text field (true) or, in some cases, to set the selection back to the text, but without setting the focus to the text field (false). |
setParagraphTextFormat |
Sets a new text format for the current paragraph in the target text field.
Parameters fmt:TextFormat - The TextFormat object that will be applied. |
setTextFormat |
Sets a new text format on the target text field that will be used as current text format when entering new text in the text field.
Parameters fmt:TextFormat - The new text format that will be applied on the text field. |
updateProperties | Updates the controls from the component, with the text format settings currently applied on the target text field. |
Overview | Properties | Methods | Events