Name

richtexteditarea

Synopsis

LZX: richtexteditarea
JavaScript: lz.richtexteditarea
Type: Class
Access: public
Topic: Incubator.Rich Text Editor
Declared in: lps/components/incubator/rich-text/richtexteditarea.lzx

Description

A view which contains the text area for a rich text editor. Combine with a richtexttoolbar to make an actual editor.

Superclass Chain

richtexteditarea

Known Subclasses

Details

Properties (18)

currentformat
<attribute name="currentformat" />
public var currentformat;
The current format in which text should be added, and which the toolbar should reflect. Everyone interested in the current format should look at this attribute to see what it is.
defaultfontcolor
<attribute name="defaultfontcolor" value="0x000000" />
public var defaultfontcolor;
Default font color
defaultfontname
<attribute name="defaultfontname" type="string" value="Verdana" />
public var defaultfontname : String;
Default font name
defaultfontsize
<attribute name="defaultfontsize" type="number" value="11" />
public var defaultfontsize : Number;
Default size of text
editortype
<attribute name="editortype" type="string" value="flash-html" />
public var editortype : String;
Attribute indicating the type of HTML content produced by editor.
_esel
<attribute name="_esel" value="0" />
private var _esel;
End in selectionregion.
_fieldhasfocus
<attribute name="_fieldhasfocus" value="false" />
private var _fieldhasfocus;
True if the input text associated with this RTE has focus.
_ignorenextfocus
<attribute name="_ignorenextfocus" value="false" />
private var _ignorenextfocus;
True if the next onfocus should be ignored.
indentsize
<attribute name="indentsize" value="35" />
public var indentsize;
The size in points of an indent
insertionpoint
<attribute name="insertionpoint" value="0" />
public var insertionpoint;
The current index of the insertion point. Should be -1 if there's no insertion point.
isHTML
<attribute name="isHTML" value="false" />
public var isHTML;
Indicates whether there's formatting on the text contained by this editor.
linkpanel
<attribute name="linkpanel" />
public var linkpanel;
Reference to the hyperlink creation dialog. This attribute should be set by users, if there is an associated link panel
_mousedownorigin
<attribute name="_mousedownorigin" value="null" />
private var _mousedownorigin;
the component on which a mousedown originated, if the mouse is currently down
_shouldresettoolbar
<attribute name="_shouldresettoolbar" value="true" />
private var _shouldresettoolbar;
Whether to inform toolbar of changes in the caret position.
_ssel
<attribute name="_ssel" value="0" />
private var _ssel;
Start in selection region.
startformat
<attribute name="startformat" />
public var startformat;
toolbar
<attribute name="toolbar" />
public var toolbar;
Reference to the toolbar associated with this editor. For the toolbar to show the correct format when the insertion point moves, this attribute must be set by users.
toolbarplacement
<attribute name="toolbarplacement" value="null" />
public var toolbarplacement;
The placement for the toolbar in the richtexteditor.

Methods (18)

_caretmove()
<method name="_caretmove" />
private function _caretmove();
Called whenever the caret (aka insertion point) moves in this text field. // see [BUG ZIM-1268]
_containsOnlyWhitespace()
<method name="_containsOnlyWhitespace" />
private function _containsOnlyWhitespace() : boolean;
Returns whether the string passed in is entirely whitespace
_containsView()
<method name="_containsView" args="v" />
private function _containsView(v) : string;
Returns whether the passed in node is a child of this view or of the toolbar.
delegateInitSelection()
<method name="delegateInitSelection" />
public function delegateInitSelection();
Initialize the selection region on focus event
delegateRestoreSelection()
<method name="delegateRestoreSelection" />
public function delegateRestoreSelection();
Restore the selection region, but do it in the next "frame." This is necessary because Flash is frame-based and can't handle certain selection changes in a single "frame."
_focussel()
<method name="_focussel" />
private function _focussel();
Called by a delegate after we get focus, to get rid of the default select of everything, and instead just move the insertion point to the end and make sure the insertion point is formatted properly.
_formatAtInsertion()
<method name="_formatAtInsertion" args="ip" />
private function _formatAtInsertion(ip : Number);
Helper method for applyFormat() to apply format at insertion point. Only do this if the message is html already.
_handleLostMouseDown()
<method name="_handleLostMouseDown" />
private function _handleLostMouseDown();
Handle the case where a mouse drag began on the RTE but the mouse up was not on the RTE.
init()
<method name="init" />
private function init();
reset()
<method name="reset" />
public function reset();
Reset the values of the richtexteditor.
_resetFormatToDefaults()
<method name="_resetFormatToDefaults" args="fmt" />
private function _resetFormatToDefaults(fmt : textformat);
Helper method to set an textformat to its default for this richtexteditor.
_restoreSelection()
<method name="_restoreSelection" />
private function _restoreSelection();
Restore last selection region. Note: this must be called from a delegate in an idle event after* flash completes the "frame" in which the selection or focus changed.
saveSelectionRegion()
<method name="saveSelectionRegion" />
public function saveSelectionRegion();
Save selected region.
setCurrentFormat()
<method name="setCurrentFormat" args="fmt, inCaretMove" />
public function setCurrentFormat(fmt : textformat, inCaretMove : boolean);
Change the format of the selection by attributes contained in TextFormat object.
setFormatAttribute()
<method name="setFormatAttribute" args="attr, val" />
public function setFormatAttribute(attr : string, val : string);
Change the format of the selection by just one attribute. This allows the selection to keep non-uniform formats on attributes which are not being adjusted. That is: select "pear, cherry", where pear is green and cherry is red. Change the font to helvetica using the combo box. Now it's all helvetica, but pear is still green and cherry is still red. If no text is currently selected, format the insertion point. This handles character formatting only. Not paragraph formatting. See setParagraphAttribute.
setLinkPanel()
<method name="setLinkPanel" args="lp" />
public function setLinkPanel(lp);
Hook this editor up to a link panel, so that the linkpanel will be hidden when the editor is reset
setSelection()
<method name="setSelection" args="ns, ne" />
public function setSelection(ns, ne);
setToolbar()
<method name="setToolbar" args="tb" />
public function setToolbar(tb);
Hook this editor up to a toolbar, so that the toolbar's ui will stay synchronized with the format at the insertion point of this editor.

LZX Synopsis

<class name="lz.richtexteditarea">
  <attribute name=" currentformat " />
  <attribute name=" defaultfontcolor " value="0x000000" />
  <attribute name=" defaultfontname " type="string" value="Verdana" />
  <attribute name=" defaultfontsize " type="number" value="11" />
  <attribute name=" editortype " type="string" value="flash-html" />
  <attribute name=" _esel " value="0" />
  <attribute name=" _fieldhasfocus " value="false" />
  <attribute name=" _ignorenextfocus " value="false" />
  <attribute name=" indentsize " value="35" />
  <attribute name=" insertionpoint " value="0" />
  <attribute name=" isHTML " value="false" />
  <attribute name=" linkpanel " />
  <attribute name=" _mousedownorigin " value="null" />
  <attribute name=" _shouldresettoolbar " value="true" />
  <attribute name=" _ssel " value="0" />
  <attribute name=" startformat " />
  <attribute name=" toolbar " />
  <attribute name=" toolbarplacement " value="null" />
  <method name=" _caretmove " />
  <method name=" _containsOnlyWhitespace " />
  <method name=" _containsView " args="v" />
  <method name=" delegateInitSelection " />
  <method name=" delegateRestoreSelection " />
  <method name=" _focussel " />
  <method name=" _formatAtInsertion " args="ip" />
  <method name=" _handleLostMouseDown " />
  <method name=" init " />
  <method name=" reset " />
  <method name=" _resetFormatToDefaults " args="fmt" />
  <method name=" _restoreSelection " />
  <method name=" saveSelectionRegion " />
  <method name=" setCurrentFormat " args="fmt, inCaretMove" />
  <method name=" setFormatAttribute " args="attr, val" />
  <method name=" setLinkPanel " args="lp" />
  <method name=" setSelection " args="ns, ne" />
  <method name=" setToolbar " args="tb" />
</class>

JavaScript Synopsis

public lz.richtexteditarea {
  public var currentformat ;
  public var defaultfontcolor ;
  public var defaultfontname  : String;
  public var defaultfontsize  : Number;
  public var editortype  : String;
  private var _esel ;
  private var _fieldhasfocus ;
  private var _ignorenextfocus ;
  public var indentsize ;
  public var insertionpoint ;
  public var isHTML ;
  public var linkpanel ;
  private var _mousedownorigin ;
  private var _shouldresettoolbar ;
  private var _ssel ;
  public var startformat ;
  public var toolbar ;
  public var toolbarplacement ;
  prototype private function _caretmove ();
  prototype private function _containsOnlyWhitespace () : boolean;
  prototype private function _containsView (v) : string;
  prototype public function delegateInitSelection ();
  prototype public function delegateRestoreSelection ();
  prototype private function _focussel ();
  prototype private function _formatAtInsertion (ip : Number);
  prototype private function _handleLostMouseDown ();
  prototype private function init ();
  prototype public function reset ();
  prototype private function _resetFormatToDefaults (fmt : textformat);
  prototype private function _restoreSelection ();
  prototype public function saveSelectionRegion ();
  prototype public function setCurrentFormat (fmt : textformat, inCaretMove : boolean);
  prototype public function setFormatAttribute (attr : string, val : string);
  prototype public function setLinkPanel (lp);
  prototype public function setSelection (ns, ne);
  prototype public function setToolbar (tb);
}