| Package | ardisia.components.richTextEditor |
| Class | public class RichTextEditor |
| Inheritance | RichTextEditor spark.components.supportClasses.SkinnableComponent |
View the technical documentation on the Ardisia Labs website for more information.
DESIGN NOTES| Property | Defined By | ||
|---|---|---|---|
| editManager : EditManager [read-only]
EditManager attached to the "target". | RichTextEditor | ||
| enableKeyboardShortcuts : Boolean
True to enable keyboard shortcuts for certain functions when the
target has focus. | RichTextEditor | ||
| fontFamilies : Array
Array of font names to list in the fontFamilyPart list. | RichTextEditor | ||
| indentPixels : Number = 48
The number of pixels to increment or decrement the indent for a textline
when the relevant buttons are clicked. | RichTextEditor | ||
| selectionHighlighting : String
The "selectionHighlighting" style that will be applied to the target. | RichTextEditor | ||
| target : RichEditableText
The RichEditableText control to edit. | RichTextEditor | ||
| undoManager : UndoManager [read-only]
UndoManager attached to the "target". | RichTextEditor | ||
| Method | Defined By | ||
|---|---|---|---|
exportAsHTML():Object
Return the target textflow as XML. | RichTextEditor | ||
exportAsXML():Object
Return the target textflow as HTML. | RichTextEditor | ||
updateToolbar():void
Based on the current SelectionState. | RichTextEditor | ||
| Method | Defined By | ||
|---|---|---|---|
autoKernPartHandler(event:Event):void
Handles events for the auto kern button skin part. | RichTextEditor | ||
boldBtnPartHandler(event:Event):void
Handles events for the bold button skin part. | RichTextEditor | ||
breakLinkBtnPartHandler(event:Event):void
Handles events for the break link skin part. | RichTextEditor | ||
changeAfterParagraph():void
Change the indent after paragraphs. | RichTextEditor | ||
changeAutoKern():void
Changes the kerning for the selected text. | RichTextEditor | ||
changeBeforeParagraph():void
Change the indent before a paragraph. | RichTextEditor | ||
changeColor():void
Change the color for the selected text. | RichTextEditor | ||
changeFont():void
Change the font for the selected text. | RichTextEditor | ||
changeFontSize():void
Change the font for the selected text. | RichTextEditor | ||
changeFontWeight():void
Change the font weight for the selected text. | RichTextEditor | ||
changeIndent(increment:Boolean = true):void
Changes the textline indent. | RichTextEditor | ||
changeItalic():void
Change the italic state for the selected text. | RichTextEditor | ||
changeLetterSpacing():void
Changes the letter spacing for the selected text. | RichTextEditor | ||
changeLineHeight():void
Changes the line height for the selected text. | RichTextEditor | ||
changeLink(createLink:Boolean):void
Changes the hyperlinks applied to the selected text. | RichTextEditor | ||
changeList(type:String):void
Add/remove lists. | RichTextEditor | ||
changeParagraphIndent():void
Change the paragraph indent. | RichTextEditor | ||
changeStrikeThrough():void
Change the strikethrough state for the selected text. | RichTextEditor | ||
changeTextAlignment(alignment:String = null):void
Change the text alignment state for the selected text. | RichTextEditor | ||
changeUnderline():void
Change the underline state for the selected text. | RichTextEditor | ||
clearBtnPartHandler(event:Event):void
Handles events for the clear formatting skin part. | RichTextEditor | ||
closeCreateLinkPanel():void
Close the create link skin part. | RichTextEditor | ||
colorPickerPartHandler(event:Event):void
Handles events for the color picker skin part. | RichTextEditor | ||
decrementIndentBtnPartHandler(event:Event):void
Handles events for the decrement indent skin part. | RichTextEditor | ||
fontFamilyPartHandler(event:Event):void
Handles events for the font family skin part. | RichTextEditor | ||
fontSizePartHandler(event:Event):void
Handles events for the font size skin part. | RichTextEditor | ||
getSelectedParagraphs():Array
Return an array of all the selected ParagraphElements. | RichTextEditor | ||
incrementIndentBtnPartHandler(event:Event):void
Handles events for the increment indent skin part. | RichTextEditor | ||
italicBtnPartHandler(event:Event):void
Handles events for the italic button skin part. | RichTextEditor | ||
letterSpacingBtnPartHandler(event:Event):void
Handles events for the letter spacing button skin part. | RichTextEditor | ||
lineHeightBtnPartHandler(event:Event):void
Handles events for the line height button skin part. | RichTextEditor | ||
listDecimalBtnPartHandler(event:Event):void
Handles events for the list decimal skin part. | RichTextEditor | ||
listDiscBtnPartHandler(event:Event):void
Handles events for the list disc skin part. | RichTextEditor | ||
noListItems(paragraphs:Array):Boolean
Test whether all selected paragraphs are children of ListItemElement
FlowElements. | RichTextEditor | ||
openCreateLinkPanel():void
Creates the create link panel skin part. | RichTextEditor | ||
openCreateLinkPanelBtnPartHandler(event:Event):void
Handles events for the create link skin part. | RichTextEditor | ||
paraIndentBtnPartHandler(event:Event):void
Handles events for the paragraph indent skin part. | RichTextEditor | ||
redo():void
Redo the last undone change to state. | RichTextEditor | ||
redoBtnPartHandler(event:Event):void
Handles events for the redo button skin part. | RichTextEditor | ||
removeFormatting():void
Removes the formatting applied to the selected text. | RichTextEditor | ||
spaceAfterParagraphBtnPartHandler(event:Event):void
Handles events for the paragraph space skin part. | RichTextEditor | ||
spaceBeforeParagraphBtnPartHandler(event:Event):void
Handles events for the paragraph pre indent skin part. | RichTextEditor | ||
strikeThroughBtnPartHandler(event:Event):void
Handles events for the strikethrough button skin part. | RichTextEditor | ||
systemManagerHandler(event:Event):void
Handles events on the systemManager. | RichTextEditor | ||
targetEventHandler(event:Event):void
Handles events on the target event dispatcher. | RichTextEditor | ||
textAlignmentBarPartHandler(event:Event):void
Handles events for the text alignment button bar skin part. | RichTextEditor | ||
underlineBtnPartHandler(event:Event):void
Handles events for the underline button skin part. | RichTextEditor | ||
undo():void
Undo the last change to state. | RichTextEditor | ||
undoBtnPartHandler(event:Event):void
Handles events for the undo button skin part. | RichTextEditor | ||
updateFontFamilyPart():void
Updates the font family skin part. | RichTextEditor | ||
This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.
| Skin Part | Description | Defined By | ||
|---|---|---|---|---|
autoKernPart:spark.components.supportClasses.ToggleButtonBase | Required: false Part Type: Static Checkbox to enable or disable automatic kerning. | RichTextEditor | ||
boldBtnPart:spark.components.supportClasses.ToggleButtonBase | Required: false Part Type: Static Button that changes the font weight property. | RichTextEditor | ||
breakLinkBtnPart:spark.components.supportClasses.ButtonBase | Required: false Part Type: Static Button that breaks the hyper link for the selected text. | RichTextEditor | ||
clearBtnPart:spark.components.supportClasses.ButtonBase | Required: false Part Type: Static Button that clears the formatting for the selected text. | RichTextEditor | ||
colorPickerPart:ColorPicker | Required: false Part Type: Static ColorPicker that changes the text color property. | RichTextEditor | ||
createLinkPanelFactoryPart:mx.core.IFactory | Required: false Part Type: Dynamic Dynamic skin part that allows the user to set the url and target for hyperlinks. The IFactory must return an object of type ICreateLinkPanel | RichTextEditor | ||
decrementIndentBtnPart:spark.components.supportClasses.ButtonBase | Required: false Part Type: Static Button that decrements the indent for the selected state. Changes the indent by the number defined by the "indentPixels" property. TLF bug: for lists, the list element (E.G. the bullet point) will not indent along with the text. Use the "paraIndentBtnPart" to indent lists. | RichTextEditor | ||
fontFamilyPart:spark.components.supportClasses.ListBase | Required: false Part Type: Static List that changes the font for the selected text. | RichTextEditor | ||
fontSizePart:SliderField | Required: false Part Type: Static SliderField that changes the font size property. | RichTextEditor | ||
incrementIndentBtnPart:spark.components.supportClasses.ButtonBase | Required: false Part Type: Static Button that increments the line indent for the selected state. Changes the indent by the number defined by the "indentPixels" property. TLF bug: for lists, the list element (E.G. the bullet point) will not indent along with the text. Use the "paraIndentBtnPart" to indent lists. | RichTextEditor | ||
italicBtnPart:spark.components.supportClasses.ToggleButtonBase | Required: false Part Type: Static Button that changes the font style (italic) property. | RichTextEditor | ||
letterSpacingBtnPart:SliderField | Required: false Part Type: Static SliderField that changes the letter spacing for the selected text. Expresses spacing as a number of pixels. | RichTextEditor | ||
lineHeightBtnPart:SliderField | Required: false Part Type: Static SliderField that changes the line height of the selected text. Expresses line height in percentages. | RichTextEditor | ||
listDecimalBtnPart:spark.components.supportClasses.ToggleButtonBase | Required: false Part Type: Static Button that inserts a decimal list for the selected text. | RichTextEditor | ||
listDiscBtnPart:spark.components.supportClasses.ToggleButtonBase | Required: false Part Type: Static Button that inserts a disc list for the selected text. | RichTextEditor | ||
openCreateLinkPanelBtnPart:spark.components.supportClasses.ButtonBase | Required: false Part Type: Static Button that opens the control created by the createLinkPanelFactoryPart. | RichTextEditor | ||
paraIndentBtnPart:SliderField | Required: false Part Type: Static SliderField that changes the paragraph indent for the selected state. Only TLF property that indents lists. TextIndent will only indent the text contained within a ListItemElement, not the list disc itself. Use this property to indent the text and the disc. | RichTextEditor | ||
redoBtnPart:spark.components.supportClasses.ButtonBase | Required: false Part Type: Static Button that redos the last text operation. | RichTextEditor | ||
spaceAfterParagraphBtnPart:SliderField | Required: false Part Type: Static SliderField that changes the spacing after the end of a paragraph for the selected text. | RichTextEditor | ||
spaceBeforeParagraphBtnPart:SliderField | Required: false Part Type: Static SliderField that changes the spacing before the begin of a paragraph for the selected text. | RichTextEditor | ||
strikeThroughBtnPart:spark.components.supportClasses.ToggleButtonBase | Required: false Part Type: Static Button that changes the strikethrough property. | RichTextEditor | ||
textAlignmentBarPart:spark.components.supportClasses.ButtonBarBase | Required: false Part Type: Static Button bar that selects the text alignment. | RichTextEditor | ||
underlineBtnPart:spark.components.supportClasses.ToggleButtonBase | Required: false Part Type: Static Button that changes the font underline property. | RichTextEditor | ||
undoBtnPart:spark.components.supportClasses.ButtonBase | Required: false Part Type: Static Button that undos the last text operation. | RichTextEditor | ||
To skin the component, implement a skin that defines the following states. Although you must implement all skin states, a skin state can be empty. An empty skin state specifies no changes to the default skin state.
| Skin State | Description | Defined By | ||
|---|---|---|---|---|
disabled | RichTextEditor | |||
normal | RichTextEditor | |||
| editManager | property |
editManager:EditManager [read-only] EditManager attached to the "target". Necessary to make the requested changes and to enable undo/redo.
The default value is EditManager.
public function get editManager():EditManager| enableKeyboardShortcuts | property |
enableKeyboardShortcuts:BooleanTrue to enable keyboard shortcuts for certain functions when the target has focus.
Shortcuts:
The default value is true.
public function get enableKeyboardShortcuts():Boolean public function set enableKeyboardShortcuts(value:Boolean):void| fontFamilies | property |
fontFamilies:ArrayArray of font names to list in the fontFamilyPart list. Does not automatically add any listed embedded fonts.
The default value is ["Arial", "Georgia", "Times New Roman", "Verdana", "Tahoma"].
public function get fontFamilies():Array public function set fontFamilies(value:Array):void| indentPixels | property |
public var indentPixels:Number = 48The number of pixels to increment or decrement the indent for a textline when the relevant buttons are clicked.
The default value is 48.
| selectionHighlighting | property |
selectionHighlighting:StringThe "selectionHighlighting" style that will be applied to the target.
The default value is TextSelectionHighlighting.ALWAYS.
public function get selectionHighlighting():String public function set selectionHighlighting(value:String):void| target | property |
target:RichEditableTextThe RichEditableText control to edit.
The default value is null.
public function get target():RichEditableText public function set target(value:RichEditableText):void| undoManager | property |
undoManager:UndoManager [read-only] UndoManager attached to the "target". Necessary to enable undo/redo.
The default value is UndoManager.
public function get undoManager():UndoManager| autoKernPartHandler | () | method |
protected function autoKernPartHandler(event:Event):voidHandles events for the auto kern button skin part.
Parameters
event:Event — the Event that triggered the handler
|
| boldBtnPartHandler | () | method |
protected function boldBtnPartHandler(event:Event):voidHandles events for the bold button skin part.
Parameters
event:Event — the Event that triggered the handler
|
| breakLinkBtnPartHandler | () | method |
protected function breakLinkBtnPartHandler(event:Event):voidHandles events for the break link skin part.
Parameters
event:Event — the Event that triggered the handler
|
| changeAfterParagraph | () | method |
protected function changeAfterParagraph():voidChange the indent after paragraphs.
| changeAutoKern | () | method |
protected function changeAutoKern():voidChanges the kerning for the selected text.
| changeBeforeParagraph | () | method |
protected function changeBeforeParagraph():voidChange the indent before a paragraph.
| changeColor | () | method |
protected function changeColor():voidChange the color for the selected text.
| changeFont | () | method |
protected function changeFont():voidChange the font for the selected text.
| changeFontSize | () | method |
protected function changeFontSize():voidChange the font for the selected text.
| changeFontWeight | () | method |
protected function changeFontWeight():voidChange the font weight for the selected text.
| changeIndent | () | method |
protected function changeIndent(increment:Boolean = true):voidChanges the textline indent.
Parameters
increment:Boolean (default = true) — true to increment, false to decrement the indent
|
| changeItalic | () | method |
protected function changeItalic():voidChange the italic state for the selected text.
| changeLetterSpacing | () | method |
protected function changeLetterSpacing():voidChanges the letter spacing for the selected text.
| changeLineHeight | () | method |
protected function changeLineHeight():voidChanges the line height for the selected text.
| changeLink | () | method |
protected function changeLink(createLink:Boolean):voidChanges the hyperlinks applied to the selected text.
Parameters
createLink:Boolean — true to create a link, false to remove links
|
| changeList | () | method |
protected function changeList(type:String):voidAdd/remove lists. Supports listStyleType disc and decimal out of the box.
Parameters
type:String (default = NaN) — the type of list to create
|
| changeParagraphIndent | () | method |
protected function changeParagraphIndent():voidChange the paragraph indent.
| changeStrikeThrough | () | method |
protected function changeStrikeThrough():voidChange the strikethrough state for the selected text.
| changeTextAlignment | () | method |
protected function changeTextAlignment(alignment:String = null):voidChange the text alignment state for the selected text.
Parameters
alignment:String (default = null) — the index in the textAlignmentBarPart to apply
|
| changeUnderline | () | method |
protected function changeUnderline():voidChange the underline state for the selected text.
| clearBtnPartHandler | () | method |
protected function clearBtnPartHandler(event:Event):voidHandles events for the clear formatting skin part.
Parameters
event:Event — the Event that triggered the handler
|
| closeCreateLinkPanel | () | method |
protected function closeCreateLinkPanel():voidClose the create link skin part.
| colorPickerPartHandler | () | method |
protected function colorPickerPartHandler(event:Event):voidHandles events for the color picker skin part.
Parameters
event:Event — the Event that triggered the handler
|
| decrementIndentBtnPartHandler | () | method |
protected function decrementIndentBtnPartHandler(event:Event):voidHandles events for the decrement indent skin part.
Parameters
event:Event — the Event that triggered the handler
|
| exportAsHTML | () | method |
public function exportAsHTML():ObjectReturn the target textflow as XML.
ReturnsObject — Object XML string
|
| exportAsXML | () | method |
public function exportAsXML():ObjectReturn the target textflow as HTML.
ReturnsObject — Object HTML string
|
| fontFamilyPartHandler | () | method |
protected function fontFamilyPartHandler(event:Event):voidHandles events for the font family skin part.
Parameters
event:Event — the Event that triggered the handler
|
| fontSizePartHandler | () | method |
protected function fontSizePartHandler(event:Event):voidHandles events for the font size skin part.
Parameters
event:Event — the Event that triggered the handler
|
| getSelectedParagraphs | () | method |
protected function getSelectedParagraphs():ArrayReturn an array of all the selected ParagraphElements.
ReturnsArray — array of Paragraph flow elements
|
| incrementIndentBtnPartHandler | () | method |
protected function incrementIndentBtnPartHandler(event:Event):voidHandles events for the increment indent skin part.
Parameters
event:Event — the Event that triggered the handler
|
| italicBtnPartHandler | () | method |
protected function italicBtnPartHandler(event:Event):voidHandles events for the italic button skin part.
Parameters
event:Event — the Event that triggered the handler
|
| letterSpacingBtnPartHandler | () | method |
protected function letterSpacingBtnPartHandler(event:Event):voidHandles events for the letter spacing button skin part.
Parameters
event:Event — the Event that triggered the handler
|
| lineHeightBtnPartHandler | () | method |
protected function lineHeightBtnPartHandler(event:Event):voidHandles events for the line height button skin part.
Parameters
event:Event — the Event that triggered the handler
|
| listDecimalBtnPartHandler | () | method |
protected function listDecimalBtnPartHandler(event:Event):voidHandles events for the list decimal skin part.
Parameters
event:Event — the Event that triggered the handler
|
| listDiscBtnPartHandler | () | method |
protected function listDiscBtnPartHandler(event:Event):voidHandles events for the list disc skin part.
Parameters
event:Event — the Event that triggered the handler
|
| noListItems | () | method |
protected function noListItems(paragraphs:Array):BooleanTest whether all selected paragraphs are children of ListItemElement FlowElements.
Parameters
paragraphs:Array |
Boolean — boolean
|
| openCreateLinkPanel | () | method |
protected function openCreateLinkPanel():voidCreates the create link panel skin part.
| openCreateLinkPanelBtnPartHandler | () | method |
protected function openCreateLinkPanelBtnPartHandler(event:Event):voidHandles events for the create link skin part.
Parameters
event:Event — the Event that triggered the handler
|
| paraIndentBtnPartHandler | () | method |
protected function paraIndentBtnPartHandler(event:Event):voidHandles events for the paragraph indent skin part.
Parameters
event:Event — the Event that triggered the handler
|
| redo | () | method |
protected function redo():voidRedo the last undone change to state.
| redoBtnPartHandler | () | method |
protected function redoBtnPartHandler(event:Event):voidHandles events for the redo button skin part.
Parameters
event:Event — the Event that triggered the handler
|
| removeFormatting | () | method |
protected function removeFormatting():voidRemoves the formatting applied to the selected text.
| spaceAfterParagraphBtnPartHandler | () | method |
protected function spaceAfterParagraphBtnPartHandler(event:Event):voidHandles events for the paragraph space skin part.
Parameters
event:Event — the Event that triggered the handler
|
| spaceBeforeParagraphBtnPartHandler | () | method |
protected function spaceBeforeParagraphBtnPartHandler(event:Event):voidHandles events for the paragraph pre indent skin part.
Parameters
event:Event — the Event that triggered the handler
|
| strikeThroughBtnPartHandler | () | method |
protected function strikeThroughBtnPartHandler(event:Event):voidHandles events for the strikethrough button skin part.
Parameters
event:Event — the Event that triggered the handler
|
| systemManagerHandler | () | method |
protected function systemManagerHandler(event:Event):voidHandles events on the systemManager.
Parameters
event:Event — the Event that triggered the handler
|
| targetEventHandler | () | method |
protected function targetEventHandler(event:Event):voidHandles events on the target event dispatcher.
Parameters
event:Event — the Event that triggered the handler
|
| textAlignmentBarPartHandler | () | method |
protected function textAlignmentBarPartHandler(event:Event):voidHandles events for the text alignment button bar skin part.
Parameters
event:Event — the Event that triggered the handler
|
| underlineBtnPartHandler | () | method |
protected function underlineBtnPartHandler(event:Event):voidHandles events for the underline button skin part.
Parameters
event:Event — the Event that triggered the handler
|
| undo | () | method |
protected function undo():voidUndo the last change to state.
| undoBtnPartHandler | () | method |
protected function undoBtnPartHandler(event:Event):voidHandles events for the undo button skin part.
Parameters
event:Event — the Event that triggered the handler
|
| updateFontFamilyPart | () | method |
protected function updateFontFamilyPart():voidUpdates the font family skin part.
| updateToolbar | () | method |
public function updateToolbar():voidBased on the current SelectionState. All the buttons and controls are updated to reflect the selection's TextLayoutFormat.