Package | flashx.textLayout.edit |
Class | public class EditManager |
Inheritance | EditManager SelectionManager Object |
Implements | IEditManager |
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
To enable text flow editing, assign an EditManager object to the interactionManager
property of the TextFlow object. The edit manager handles changes to the text (such as insertions,
deletions, and format changes). Changes are reversible if the edit manager has an undo manager. The edit
manager triggers the recomposition and display of the text flow, as necessary.
The EditManager class supports the following keyboard shortcuts:
Keys | Result |
---|---|
ctrl-z | undo |
ctrl-y | redo |
ctrl-backspace | deletePreviousWord |
ctrl-delete | deleteNextWord |
alt+delete | deleteNextWord |
ctrl+alt-delete | deleteNextWord |
ctrl-shift-hyphen | insert discretionary hyphen |
ctrl+backspace | deletePreviousWord |
alt+backspace | deletePreviousWord |
ctrl+alt-backspace | deletePreviousWord |
INSERT | toggles overWriteMode |
backspace | deletePreviousCharacter |
ENTER | if textFlow.configuration.manageEnterKey in a list it creates a new list item, otherwise creates a new paragraph |
shift-ENTER | if textFlow.configuration.manageEnterKey creates a new paragraph |
TAB | if textFlow.configuration.manageTabKey in a list it creates nested list, otherwise inserts a TAB or overwrites next character with a TAB |
shift-TAB | if textFlow.configuration.manageTabKey in the first item of a list it moves the item out of the list (promotes it) |
Note: The following keys do not work on Windows: alt-backspace, alt-delete, ctrl+alt-backspace, and ctrl+alt-delete. These keys do not generate an event for the runtime.
See also
Property | Defined By | ||
---|---|---|---|
absoluteEnd : int [read-only]
The text position of the end of the selection, as an offset from the start of the text flow. | SelectionManager | ||
absoluteStart : int [read-only]
The text position of the start of the selection, as an offset from the start of the text flow. | SelectionManager | ||
activeCellPosition : CellCoordinates Active end of the current cell selection, as coordinates within the table. | SelectionManager | ||
activePosition : int [read-only]
The active point of the selection. | SelectionManager | ||
allowDelayedOperations : Boolean | EditManager | ||
anchorCellPosition : CellCoordinates Anchor point of the current cell selection, as coordinates within the table. | SelectionManager | ||
anchorPosition : int [read-only]
The anchor point of the selection. | SelectionManager | ||
currentCellSelectionFormat : SelectionFormat [read-only]
The current Cell SelectionFormat object. | SelectionManager | ||
currentSelectionFormat : SelectionFormat [read-only]
The current SelectionFormat object. | SelectionManager | ||
currentTable : TableElement | SelectionManager | ||
delayUpdates : Boolean | EditManager | ||
editingMode : String [read-only]
The editing mode. | SelectionManager | ||
focused : Boolean [read-only]
Indicates whether a container in the text flow has the focus. | SelectionManager | ||
focusedCellSelectionFormat : SelectionFormat
The SelectionFormat object used to draw cell selections in a focused container. | SelectionManager | ||
focusedSelectionFormat : SelectionFormat
The SelectionFormat object used to draw the selection in a focused container. | SelectionManager | ||
inactiveCellSelectionFormat : SelectionFormat
The SelectionFormat object used to draw cell selections when they are not in the active window. | SelectionManager | ||
inactiveSelectionFormat : SelectionFormat
The SelectionFormat object used to draw the selection when it is not in the active window. | SelectionManager | ||
overwriteMode : Boolean = false [static]
Indicates whether overwrite mode is on or off. | EditManager | ||
selectionType : String [read-only]
Indicates the type of selection. | SelectionManager | ||
SelectTable : String = selectTable [static]
Cursor for selection of table
| SelectionManager | ||
SelectTableColumn : String = selectTableColumn [static]
Cursor for selection of table column
| SelectionManager | ||
selectTableCursorDrawCommands : Vector.<int> | SelectionManager | ||
selectTableCursorPoints : Vector.<Number> | SelectionManager | ||
SelectTableRow : String = selectTableRow [static]
Cursor for selection of table row
| SelectionManager | ||
subManager : ISelectionManager
The ISelectionManager object used to for cell selections nested within the TextFlow managed by this ISelectionManager. | SelectionManager | ||
superManager : ISelectionManager
The ISelectionManager object used to manage the parent TextFlow of this ISelectionManager (i.e. | SelectionManager | ||
textFlow : TextFlow
The TextFlow object managed by this selection manager. | SelectionManager | ||
undoManager : IUndoManager [read-only]
The IUndoManager assigned to this edit manager. | EditManager | ||
unfocusedCellSelectionFormat : SelectionFormat
The SelectionFormat object used to draw cell selections when they are not in a focused container, but are in
the active window. | SelectionManager | ||
unfocusedSelectionFormat : SelectionFormat
The SelectionFormat object used to draw the selection when it is not in a focused container, but is in
the active window. | SelectionManager | ||
windowActive : Boolean [read-only]
Indicates whether the window associated with the text flow is active. | SelectionManager |
Method | Defined By | ||
---|---|---|---|
EditManager(undoManager:IUndoManager = null)
Creates an EditManager object. | EditManager | ||
activateHandler(event:Event):void
Processes an activate event. | SelectionManager | ||
Applies container styles to any containers in the selection. | EditManager | ||
applyFormat(leafFormat:ITextLayoutFormat, paragraphFormat:ITextLayoutFormat, containerFormat:ITextLayoutFormat, operationState:SelectionState = null):void
Changes the formats of the specified (or current) selection. | EditManager | ||
applyFormatToElement(targetElement:FlowElement, format:ITextLayoutFormat, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void
Applies styles to the specified element. | EditManager | ||
Changes the format applied to the leaf elements in the
specified (or current) selection. | EditManager | ||
applyLink(href:String, targetString:String = null, extendToLinkBoundary:Boolean = false, operationState:SelectionState = null):LinkElement
Transforms a selection into a link, or a link into normal text. | EditManager | ||
Applies paragraph styles to any paragraphs in the selection. | EditManager | ||
Transforms text into a TCY run, or a TCY run into non-TCY text. | EditManager | ||
beginCompositeOperation():void
Begins a new group of operations. | EditManager | ||
changeElementID(newID:String, targetElement:FlowElement, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void
Changes the ID of an element. | EditManager | ||
changeStyleName(newName:String, targetElement:FlowElement, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void Deprecated Since 2.0: Please Use applyFormatToElement
Changes the styleName of an element or part of an element. | EditManager | ||
changeTypeName(newName:String, targetElement:FlowElement, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void
Changes the typeName of an element or part of an element. | EditManager | ||
clearFormat(leafFormat:ITextLayoutFormat, paragraphFormat:ITextLayoutFormat, containerFormat:ITextLayoutFormat, operationState:SelectionState = null):void
Undefines formats of the specified (or current) selection. | EditManager | ||
clearFormatOnElement(targetElement:FlowElement, format:ITextLayoutFormat, operationState:SelectionState = null):void
Undefines styles to the specified element. | EditManager | ||
clearSelection():void
Clears the selection shapes. | SelectionManager | ||
createDiv(parent:FlowGroupElement = null, format:ITextLayoutFormat = null, operationState:SelectionState = null):DivElement Creates a new DivElement that contains the entire range specified in the operationState at the lowest
common parent element that contains both the start and end points of the range. | EditManager | ||
createList(parent:FlowGroupElement = null, format:ITextLayoutFormat = null, operationState:SelectionState = null):ListElement Creates a new ListElement that contains the entire range specified in the operationState at the lowest
common parent element that contains both the start and end points of the range. | EditManager | ||
createSelectTableColumnCursor():MouseCursorData
Create a select table column cursor
| SelectionManager | ||
createSelectTableCursor():MouseCursorData
Create a select table cursor
| SelectionManager | ||
createSelectTableRowCursor():MouseCursorData
Create a select row cursor
| SelectionManager | ||
createSubParagraphGroup(parent:FlowGroupElement = null, format:ITextLayoutFormat = null, operationState:SelectionState = null):SubParagraphGroupElement Creates a new SubParagraphGroupElement that contains the entire range specified in the operationState at the lowest
common parent element that contains both the start and end points of the range. | EditManager | ||
Deletes the selected area and returns the deleted area in a TextScrap object. | EditManager | ||
deactivateHandler(event:Event):void
Processes a deactivate event. | SelectionManager | ||
deleteNextCharacter(operationState:SelectionState = null):void
Deletes a range of text, or, if a point selection is given, deletes the next character. | EditManager | ||
deleteNextWord(operationState:SelectionState = null):void
Deletes the next word. | EditManager | ||
deletePreviousCharacter(operationState:SelectionState = null):void
Deletes a range of text, or, if a point selection is given, deletes the previous character. | EditManager | ||
deletePreviousWord(operationState:SelectionState = null):void
Deletes the previous word. | EditManager | ||
deleteText(operationState:SelectionState = null):void
Deletes a range of text. | EditManager | ||
deselect():void | SelectionManager | ||
doOperation(operation:FlowOperation):void [override]
Executes a FlowOperation. | EditManager | ||
editHandler(event:Event):void
Processes an edit event. | SelectionManager | ||
endCompositeOperation():void
Ends a group of operations. | EditManager | ||
flushPendingOperations():void | SelectionManager | ||
focusChangeHandler(event:FocusEvent):void
Processes a focusChange event. | SelectionManager | ||
focusInHandler(event:FocusEvent):void
Processes a focusIn event. | SelectionManager | ||
focusOutHandler(event:FocusEvent):void
Processes a focusOut event. | SelectionManager | ||
SelectionManager | |||
Gets the character format attributes that are common to all characters in the specified text range or current selection. | SelectionManager | ||
Gets the container format attributes that are common to all containers in the specified text range or current selection. | SelectionManager | ||
Gets the paragraph format attributes that are common to all paragraphs in the specified text range or current selection. | SelectionManager | ||
Gets the SelectionState object of the current selection. | SelectionManager | ||
hasAnySelection():Boolean
Indicates whether there is a text or cell selection. | SelectionManager | ||
hasCellRangeSelection():Boolean | SelectionManager | ||
hasSelection():Boolean
Indicates whether there is a text selection. | SelectionManager | ||
imeStartCompositionHandler(event:IMEEvent):void
Processes an imeStartComposition event
| SelectionManager | ||
insertInlineGraphic(source:Object, width:Object, height:Object, options:Object = null, operationState:SelectionState = null):InlineGraphicElement
Inserts an image. | EditManager | ||
EditManager | |||
insertText(text:String, origOperationState:SelectionState = null):void
Inserts text. | EditManager | ||
isRangeSelection():Boolean
Indicates whether the selection covers a range of text. | SelectionManager | ||
keyDownHandler(event:KeyboardEvent):void
Processes a keyDown event. | SelectionManager | ||
keyFocusChangeHandler(event:FocusEvent):void
Processes a keyFocusChange event. | SelectionManager | ||
keyUpHandler(event:KeyboardEvent):void
Processes a keyUp event. | SelectionManager | ||
menuSelectHandler(event:ContextMenuEvent):void
Processes a menuSelect event. | SelectionManager | ||
modifyInlineGraphic(source:Object, width:Object, height:Object, options:Object = null, operationState:SelectionState = null):void
Modifies an existing inline graphic. | EditManager | ||
mouseDoubleClickHandler(event:MouseEvent):void
Processes a mouseDoubleClick event. | SelectionManager | ||
mouseDownHandler(event:MouseEvent):void
Processes a mouseDown event. | SelectionManager | ||
mouseMoveHandler(event:MouseEvent):void
Processes a mouseMove event. | SelectionManager | ||
mouseOutHandler(event:MouseEvent):void
Processes a mouseOut event. | SelectionManager | ||
mouseOverHandler(event:MouseEvent):void
Processes a mouseOver event. | SelectionManager | ||
mouseUpHandler(event:MouseEvent):void
Processes a mouseUp event. | SelectionManager | ||
mouseWheelHandler(event:MouseEvent):void
Processes a mouseWheel event. | SelectionManager | ||
moveChildren(source:FlowGroupElement, sourceIndex:int, numChildren:int, destination:FlowGroupElement, destinationIndex:int, selectionState:SelectionState = null):void Move a set of FlowElements from one FlowGroupElement to another. | EditManager | ||
notifyInsertOrDelete(absolutePosition:int, length:int):void
Updates the selection manager when text is inserted or deleted. | SelectionManager | ||
overwriteText(text:String, operationState:SelectionState = null):void
Overwrites the selected text. | EditManager | ||
Pastes the TextScrap into the selected area. | EditManager | ||
redo():void
Reperforms the previous undone operation. | EditManager | ||
refreshSelection():void
Redisplays the selection shapes. | SelectionManager | ||
selectAll():void | SelectionManager | ||
selectCell(cell:TableCellElement):void
Select a table cell. | SelectionManager | ||
selectCellAt(table:TableElement, rowIndex:int, colIndex:int):void
Select table cells at the specified index. | SelectionManager | ||
Select a range of table cells. | SelectionManager | ||
selectCells(cells:Vector.<TableCellElement>):void
Select table cells at the specified index
| SelectionManager | ||
selectCellTextFlow(cell:TableCellElement):void
Select a table cell text flow
| SelectionManager | ||
selectColumn(column:TableColElement):void
Select a table column. | SelectionManager | ||
selectColumnAt(table:TableElement, index:int):void
Select a table column at the specified index
| SelectionManager | ||
selectColumns(columns:Array):void
Selects the table columns provided
| SelectionManager | ||
selectFirstPosition():void | SelectionManager | ||
selectLastPosition():void | SelectionManager | ||
selectRange(anchorPosition:int, activePosition:int):void | SelectionManager | ||
selectRow(row:TableRowElement):void
Select the specified table row. | SelectionManager | ||
selectRowAt(table:TableElement, index:int):void
Select a table row at the specified index
| SelectionManager | ||
selectRows(rows:Array):void
Selects the table rows provided
| SelectionManager | ||
selectTable(table:TableElement):void
Select all cells in a table. | SelectionManager | ||
setCellRange(range:CellRange):void | SelectionManager | ||
setFocus():void
Gives the focus to the first container in the selection. | SelectionManager | ||
setSelectionState(sel:SelectionState):void
Sets the SelectionState object of the current selection. | SelectionManager | ||
softKeyboardActivatingHandler(event:Event):void
Processes an softKeyboardActivating event
| SelectionManager | ||
Splits the target element at the location specified, creating a new element after the current one. | EditManager | ||
Splits the paragraph at the current position, creating a new paragraph after the current one. | EditManager | ||
textInputHandler(event:TextEvent):void
Processes a TextEvent. | SelectionManager | ||
undo():void
Reverses the previous operation. | EditManager | ||
updateAllControllers():void | EditManager |
allowDelayedOperations | property |
allowDelayedOperations:Boolean
public function get allowDelayedOperations():Boolean
public function set allowDelayedOperations(value:Boolean):void
delayUpdates | property |
delayUpdates:Boolean
public function get delayUpdates():Boolean
public function set delayUpdates(value:Boolean):void
handleShiftAsSoftReturn | property |
tlf_internal static var handleShiftAsSoftReturn:Boolean = true
overwriteMode | property |
public static var overwriteMode:Boolean = false
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Indicates whether overwrite mode is on or off.
If true
, then a keystroke overwrites the character following the cursor.
If false
, then a keystroke is inserted at the cursor location.
undoManager | property |
undoManager:IUndoManager
[read-only] Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
The IUndoManager assigned to this edit manager.
To allow edits to be undone (and redone), pass an IUndoManager instance to the EditManager constructor. The undo manager maintains a stack of operations that have been executed, and it can undo or redo individual operations.
Note: If the TextFlow is modified directly (not via calls to the EditManager, but directly via calls to the managed FlowElement objects), then the EditManager clears the undo stack to prevent the stack from getting out of sync with the current state.
public function get undoManager():IUndoManager
EditManager | () | Constructor |
public function EditManager(undoManager:IUndoManager = null)
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Creates an EditManager object.
Assign an EditManager object to the interactionManager
property
of a text flow to enable editing of that text flow.
To enable support for undoing and redoing changes, pass an
IUndoManager instance to the EditManager constructor. You can use
the flashx.undo.UndoManager
class
or create a custom IUndoManager instance. Use a custom IUndoManager instance
to integrate Text Layout Framework changes with an existing
undo manager that is not an instance of the UndoManager class.
To create a custom IUndoManager instance, ensure that the class
you use to define the undo manager
implements the IUndoManager interface.
undoManager:IUndoManager (default = null ) — The UndoManager for the application
|
See also
applyContainerFormat | () | method |
public function applyContainerFormat(containerFormat:ITextLayoutFormat, operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Applies container styles to any containers in the selection.
Any style properties in the format object that are null
are left unchanged.
Parameters
containerFormat:ITextLayoutFormat — The format to apply to the containers in the range
| |
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
applyFormat | () | method |
public function applyFormat(leafFormat:ITextLayoutFormat, paragraphFormat:ITextLayoutFormat, containerFormat:ITextLayoutFormat, operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Changes the formats of the specified (or current) selection.
Executes an undoable operation that applies the new formats. Only style attributes set for the TextLayoutFormat objects are applied. Undefined attributes in the format objects are not changed.
Parameters
leafFormat:ITextLayoutFormat — The format to apply to leaf elements such as spans and inline graphics.
| |
paragraphFormat:ITextLayoutFormat — The format to apply to paragraph elements.
| |
containerFormat:ITextLayoutFormat — The format to apply to the containers.
| |
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
applyFormatToElement | () | method |
public function applyFormatToElement(targetElement:FlowElement, format:ITextLayoutFormat, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Applies styles to the specified element.
Any style properties in the format object that are null
are left unchanged.
Only styles that are relevant to the specified element are applied.
Parameters
targetElement:FlowElement — The element to which the styles are applied.
| |
format:ITextLayoutFormat — The format containing the styles to apply.
| |
relativeStart:int (default = 0 ) — An offset from the beginning of the element at which to split the element when assigning the new formatting.
| |
relativeEnd:int (default = -1 ) — An offset from the beginning of the element at which to split the element when applying the new formatting.
| |
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
applyLeafFormat | () | method |
public function applyLeafFormat(characterFormat:ITextLayoutFormat, operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Changes the format applied to the leaf elements in the specified (or current) selection.
Executes an undoable operation that applies the new format to leaf elements such as SpanElement and InlineGraphicElement objects. Only style attributes set for the TextLayoutFormat objects are applied. Undefined attributes in the format object are changed.
Parameters
characterFormat:ITextLayoutFormat — The format to apply.
| |
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
applyLink | () | method |
public function applyLink(href:String, targetString:String = null, extendToLinkBoundary:Boolean = false, operationState:SelectionState = null):LinkElement
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10 - + 10.2, AIR 1.5 |
Transforms a selection into a link, or a link into normal text.
Executes an undoable operation that creates or removes the link.
If a target
parameter is specified, it must be one of the following values:
In browser-hosted runtimes, a target of "_self" replaces the current html page. So, if the SWF content containing the link is in a page within a frame or frameset, the linked content loads within that frame. If the page is at the top level, the linked content opens to replace the original page. A target of "_blank" opens a new browser window with no name. A target of "_parent" replaces the parent of the html page containing the SWF content. A target of "_top" replaces the top-level page in the current browser window.
In other runtimes, such as Adobe AIR, the link opens in the user's default browser and the
target
parameter is ignored.
The extendToLinkBoundary
parameter determines how the edit manager
treats a selection that intersects with one or more existing links. If the parameter is
true
, then the operation is applied as a unit to the selection and the
whole text of the existing links. Thus, a single link is created that spans from
the beginning of the first link intersected to the end of the last link intersected.
In contrast, if extendToLinkBoundary
were false
in this situation,
the existing partially selected links would be split into two links.
Parameters
href:String — The uri referenced by the link.
| |
targetString:String (default = null ) — The target browser window of the link.
| |
extendToLinkBoundary:Boolean (default = false ) — Specifies whether to consolidate selection with any overlapping existing links, and then apply the change.
| |
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
LinkElement — The LinkElement that was created.
|
applyParagraphFormat | () | method |
public function applyParagraphFormat(paragraphFormat:ITextLayoutFormat, operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Applies paragraph styles to any paragraphs in the selection.
Any style properties in the format object that are null
are left unchanged.
Parameters
paragraphFormat:ITextLayoutFormat — The format to apply to the selected paragraphs.
| |
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
applyTCY | () | method |
public function applyTCY(tcyOn:Boolean, operationState:SelectionState = null):TCYElement
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10 - + 10.2, AIR 1.5 |
Transforms text into a TCY run, or a TCY run into non-TCY text.
TCY, or tate-chu-yoko, causes text to draw horizontally within a vertical line, and is used to make small blocks of non-Japanese text or numbers, such as dates, more readable in vertical text.
Parameters
tcyOn:Boolean — Set to true to apply TCY to a text range, false to remove TCY.
| |
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
TCYElement — The TCYElement that was created.
|
beginCompositeOperation | () | method |
public function beginCompositeOperation():void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Begins a new group of operations.
All operations executed after the call to beginCompositeOperation()
, and before the
matching call to endCompositeOperation()
are executed and grouped together as a single
operation that can be undone as a unit.
A beginCompositeOperation
/endCompositeOperation
block can be nested inside another
beginCompositeOperation
/endCompositeOperation
block.
changeElementID | () | method |
public function changeElementID(newID:String, targetElement:FlowElement, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Changes the ID of an element.
If the relativeStart
or relativeEnd
parameters are set (to
anything other than the default values), then the element is split. The parts of the element
outside this range retain the original ID. Setting both the relativeStart
and
relativeEnd
parameters creates elements with duplicate IDs.
Parameters
newID:String — The new ID value.
| |
targetElement:FlowElement — The element to modify.
| |
relativeStart:int (default = 0 ) — An offset from the beginning of the element at which to split the element when assigning the new ID.
| |
relativeEnd:int (default = -1 ) — An offset from the beginning of the element at which to split the element when assigning the new ID.
| |
operationState:SelectionState (default = null ) — Specifies the selection to restore when undoing this operation;
if null , the operation saves the current selection.
|
changeStyleName | () | method |
public function changeStyleName(newName:String, targetElement:FlowElement, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Changes the styleName of an element or part of an element.
If the relativeStart
or relativeEnd
parameters are set (to
anything other than the default values), then the element is split. The parts of the element
outside this range retain the original style.
Parameters
newName:String — The name of the new style.
| |
targetElement:FlowElement — Specifies the element to change.
| |
relativeStart:int (default = 0 ) — An offset from the beginning of the element at which to split the element when assigning the new style.
| |
relativeEnd:int (default = -1 ) — An offset from the end of the element at which to split the element when assigning the new style.
| |
operationState:SelectionState (default = null ) — Specifies the selection to restore when undoing this operation;
if null , the operation saves the current selection.
|
changeTypeName | () | method |
public function changeTypeName(newName:String, targetElement:FlowElement, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Changes the typeName of an element or part of an element.
If the relativeStart
or relativeEnd
parameters are set (to
anything other than the default values), then the element is split. The parts of the element
outside this range retain the original style.
Parameters
newName:String — The name of the new type.
| |
targetElement:FlowElement — Specifies the element to change.
| |
relativeStart:int (default = 0 ) — An offset from the beginning of the element at which to split the element when assigning the new style
| |
relativeEnd:int (default = -1 ) — An offset from the end of the element at which to split the element when assigning the new style
| |
operationState:SelectionState (default = null ) — Specifies the selection to restore when undoing this operation;
if null , the operation saves the current selection.
|
clearFormat | () | method |
public function clearFormat(leafFormat:ITextLayoutFormat, paragraphFormat:ITextLayoutFormat, containerFormat:ITextLayoutFormat, operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Undefines formats of the specified (or current) selection.
Executes an undoable operation that undefines the specified formats. Only style attributes set for the TextLayoutFormat objects are applied. Undefined attributes in the format objects are not changed.
Parameters
leafFormat:ITextLayoutFormat — The format whose set values indicate properties to undefine to LeafFlowElement objects in the selected range.
| |
paragraphFormat:ITextLayoutFormat — The format whose set values indicate properties to undefine to ParagraphElement objects in the selected range.
| |
containerFormat:ITextLayoutFormat — The format whose set values indicate properties to undefine to ContainerController objects in the selected range.
| |
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
clearFormatOnElement | () | method |
public function clearFormatOnElement(targetElement:FlowElement, format:ITextLayoutFormat, operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Undefines styles to the specified element.
Any style properties in the format object that are undefined
are left unchanged.
Any styles that are defined in the specififed format are undefined on the specified element.
Parameters
targetElement:FlowElement — The element to which the styles are applied.
| |
format:ITextLayoutFormat — The format containing the styles to undefine.
| |
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
createDiv | () | method |
public function createDiv(parent:FlowGroupElement = null, format:ITextLayoutFormat = null, operationState:SelectionState = null):DivElement
Creates a new DivElement that contains the entire range specified in the operationState at the lowest common parent element that contains both the start and end points of the range. If the start and end points are the same, a new DivElement is created at that position with a single child paragraph.
Parameters
parent:FlowGroupElement (default = null ) — Specifies a parent element for the new DivElement.
If null the new parent will be lowest level that contains the SelectionState.
| |
format:ITextLayoutFormat (default = null ) — Formatting attributes to apply to the new DivElement.
| |
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
DivElement — The new DivElement that was created.
|
createList | () | method |
public function createList(parent:FlowGroupElement = null, format:ITextLayoutFormat = null, operationState:SelectionState = null):ListElement
Creates a new ListElement that contains the entire range specified in the operationState at the lowest common parent element that contains both the start and end points of the range. Each paragraph within the range will become a ListItemElement in the new ListElement. If the start and end points are the same, a new ListElement is created at that position with a single ListItemElement child.
Parameters
parent:FlowGroupElement (default = null ) — Optionally specifies a parent element for the new ListElement.
If null the new parent will be lowest level that contains the SelectionState.
| |
format:ITextLayoutFormat (default = null ) — Formatting attributes to apply to the new ListElement.
| |
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
ListElement — The new ListElement that was created.
|
createSubParagraphGroup | () | method |
public function createSubParagraphGroup(parent:FlowGroupElement = null, format:ITextLayoutFormat = null, operationState:SelectionState = null):SubParagraphGroupElement
Creates a new SubParagraphGroupElement that contains the entire range specified in the operationState at the lowest common parent element that contains both the start and end points of the range. If the start and end points are the same, nothing is done.
Parameters
parent:FlowGroupElement (default = null ) — Specifies a parent element for the new SubParagraphGroupElement element.
If null the new parent will be lowest level that contains the SelectionState.
| |
format:ITextLayoutFormat (default = null ) — Formatting attributes to apply to the new SubParagraphGroupElement
| |
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
SubParagraphGroupElement — The new SubParagraphGroupElement that was created.
|
cutTextScrap | () | method |
public function cutTextScrap(operationState:SelectionState = null):TextScrap
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Deletes the selected area and returns the deleted area in a TextScrap object.
The resulting TextScrap can be posted to the system clipboard or used in a
subsequent pasteTextOperation()
operation.
Parameters
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
TextScrap — The TextScrap that was cut.
|
See also
deleteNextCharacter | () | method |
public function deleteNextCharacter(operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Deletes a range of text, or, if a point selection is given, deletes the next character.
Parameters
operationState:SelectionState (default = null ) — specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
deleteNextWord | () | method |
public function deleteNextWord(operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Deletes the next word.
If a range is selected, the first word of the range is deleted.
Parameters
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
deletePreviousCharacter | () | method |
public function deletePreviousCharacter(operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Deletes a range of text, or, if a point selection is given, deletes the previous character.
Parameters
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
deletePreviousWord | () | method |
public function deletePreviousWord(operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Deletes the previous word.
If a range is selected, the first word of the range is deleted.
Parameters
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
deleteText | () | method |
public function deleteText(operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Deletes a range of text.
Parameters
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
doOperation | () | method |
override public function doOperation(operation:FlowOperation):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Executes a FlowOperation.
The doOperation()
method is called by IEditManager functions that
update the text flow. You do not typically need to call this function directly unless
you create your own custom operations.
This function proceeds in the following steps:
true
or false
.
False
indicates that no changes were made.Exception handling: If the operation throws an exception, it is caught and the error is attached to the flowOperationEnd event. If the event is not canceled the error is rethrown.
Parameters
operation:FlowOperation — a FlowOperation object
|
endCompositeOperation | () | method |
public function endCompositeOperation():void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Ends a group of operations.
All operations executed since the last call to beginCompositeOperation()
are
grouped as a CompositeOperation that is then completed. This CompositeOperation object is added
to the undo stack or, if this composite operation is nested inside another composite operation,
added to the parent operation.
insertInlineGraphic | () | method |
public function insertInlineGraphic(source:Object, width:Object, height:Object, options:Object = null, operationState:SelectionState = null):InlineGraphicElement
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10 - + 10.2, AIR 1.5 |
Inserts an image.
The source of the image can be a string containing a URI, URLRequest object, a Class object representing an embedded asset, or a DisplayObject instance.
The width and height values can be the number of pixels, a percent, or the string, 'auto', in which case the actual dimension of the graphic is used.
Set the float
to one of the constants defined in the Float class to specify whether
the image should be displayed to the left or right of any text or inline with the text.
Parameters
source:Object — Can be either a String interpreted as a uri, a Class interpreted as the class of an Embed DisplayObject,
a DisplayObject instance or a URLRequest.
| |
width:Object — The width of the image to insert (number, percent, or 'auto').
| |
height:Object — The height of the image to insert (number, percent, or 'auto').
| |
options:Object (default = null ) — None supported.
| |
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
InlineGraphicElement |
See also
insertTableElement | () | method |
public function insertTableElement(table:TableElement, operationState:SelectionState = null):void
Parameters
table:TableElement | |
operationState:SelectionState (default = null )
|
insertText | () | method |
public function insertText(text:String, origOperationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Inserts text.
Inserts the text at a position or range in the text. If the location supplied in the
operationState
parameter is a range (or the parameter is null
and the
current selection is a range), then the text currently in the range
is replaced by the inserted text.
Parameters
text:String — The string to insert.
| |
origOperationState:SelectionState (default = null ) — Specifies the text in the flow to which this operation applies;
if null , the operation applies to the current selection.
|
modifyInlineGraphic | () | method |
public function modifyInlineGraphic(source:Object, width:Object, height:Object, options:Object = null, operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Modifies an existing inline graphic.
Set unchanging properties to the values in the original graphic. (Modifying an existing graphic object is typically more efficient than deleting and recreating one.)
Parameters
source:Object — Can be either a String interpreted as a uri, a Class interpreted as the class of an Embed DisplayObject,
a DisplayObject instance or a URLRequest.
| |
width:Object — The new width for the image (number or percent).
| |
height:Object — The new height for the image (number or percent).
| |
options:Object (default = null ) — None supported.
| |
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
moveChildren | () | method |
public function moveChildren(source:FlowGroupElement, sourceIndex:int, numChildren:int, destination:FlowGroupElement, destinationIndex:int, selectionState:SelectionState = null):void
Move a set of FlowElements from one FlowGroupElement to another. The desinationElement must be a legal parent type for the children being moved, or an exception is thrown.
Parameters
source:FlowGroupElement — The orginal parent of the elements to be moved.
| |
sourceIndex:int — The child index within the source of the first element to be moved.
| |
numChildren:int — The number of children being moved.
| |
destination:FlowGroupElement — The new parent of elements after move.
| |
destinationIndex:int — The child index within the destination to where elements are moved to.
| |
selectionState:SelectionState (default = null ) — Specifies the text to which this operation applies, and to which selection returns to upon undo.
If null , the operation applies to the current selection. If there is no current selection, this parameter must be non-null.
|
overwriteText | () | method |
public function overwriteText(text:String, operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Overwrites the selected text.
If the selection is a point selection, the first character is overwritten by the new text.
Parameters
text:String — The string to insert.
| |
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
pasteTextScrap | () | method |
public function pasteTextScrap(scrapToPaste:TextScrap, operationState:SelectionState = null):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Pastes the TextScrap into the selected area.
If a range of text is specified, the text in the range is deleted.
Parameters
scrapToPaste:TextScrap — The TextScrap to paste.
| |
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
See also
redo | () | method |
public function redo():void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Reperforms the previous undone operation.
Note: If the IUndoManager associated with this IEditManager is also associated with another IEditManager, then it is possible that the redo operation associated with the other IEditManager is the one redone. This can happen if the FlowOperation of another IEditManager is on top of the redo stack.
This function does nothing if undo is not turned on.
See also
splitElement | () | method |
public function splitElement(target:FlowGroupElement, operationState:SelectionState = null):FlowGroupElement
Splits the target element at the location specified, creating a new element after the current one. If the operationState is a range, the text within the range is deleted. The new element is created after the text position specified by operationState. Note that splitting a SubParagraphGroupElement will have no effect because they will automatically remerge with the adejacent elements.
An example where you might want to use this is if you have a list, and you want to divide it into two lists.
Parameters
target:FlowGroupElement — The element to be split.
| |
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
FlowGroupElement — The new paragraph that was created.
|
splitParagraph | () | method |
public function splitParagraph(operationState:SelectionState = null):ParagraphElement
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Splits the paragraph at the current position, creating a new paragraph after the current one.
If a range of text is specified, the text in the range is deleted.
Parameters
operationState:SelectionState (default = null ) — Specifies the text to which this operation applies;
if null , the operation applies to the current selection.
|
ParagraphElement — The new paragraph that was created.
|
undo | () | method |
public function undo():void
Language Version : | ActionScript 3.0 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Reverses the previous operation.
Note: If the IUndoManager associated with this IEditManager is also associated with another IEditManager, then it is possible that the undo operation associated with the other IEditManager is the one undone. This can happen if the FlowOperation of another IEditManager is on top of the undo stack.
This function does nothing if undo is not turned on.
See also
updateAllControllers | () | method |
public function updateAllControllers():void