flashx.textLayout.operations

# FlowOperation - AS3

Package | flashx.textLayout.operations
Class | public class FlowOperation
Inheritance | FlowOperation Object
Implements | IOperation
Subclasses | CompositeOperation, FlowTextOperation, RedoOperation, TextInputOperation, UndoOperation

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The FlowOperation class is the base class for all Text Layout Framework operations.

Operations are transformations of a text flow. An Operation class defines the logic for performing and undoing the transformation. Operations are executed by an edit manager. Most applications do not need to create or manage operations directly (unless implementing a custom edit manager).

When an operation is performed, the edit manager dispatches an Operation object within the FlowOperationEvent object. You can query this Operation object to decide whether or not to allow the operation, to decide whether to perform some other operation as well, or to update related user-interface elements.

Related API Elements

flashx.textLayout.events.FlowOperationEvent
flashx.textLayout.edit.EditManager

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | beginGeneration : uint [read-only] The text flow generation before the operation. | FlowOperation
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | endGeneration : uint [read-only] The text flow generation after the operation. | FlowOperation
|  | textFlow : flashx.textLayout.elements:TextFlow The TextFlow object to which this operation is applied. | FlowOperation
|  | userData : * Arbitrary data associated with an element. | FlowOperation

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | FlowOperation(textFlow:flashx.textLayout.elements:TextFlow) Creates the FlowOperation object. | FlowOperation
|  | canUndo():Boolean Test if this operation be placed on the undo stack. | FlowOperation
|  | doOperation():Boolean Executes the operation. | FlowOperation
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | redo():SelectionState Re-executes the operation. | FlowOperation
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | undo():SelectionState Reverses the operation. | FlowOperation
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Property Detail

### beginGeneration

property

`beginGeneration:uint` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The text flow generation before the operation.

A generation of 0 indicates that the operation did not complete.

Implementation
`public function get beginGeneration():uint`

### endGeneration

property

`endGeneration:uint` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The text flow generation after the operation.

A generation of 0 indicates that the operation did not complete.

Implementation
`public function get endGeneration():uint`

### textFlow

property

`textFlow:flashx.textLayout.elements:TextFlow`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The TextFlow object to which this operation is applied.

Implementation
`public function get textFlow():flashx.textLayout.elements:TextFlow`
`public function set textFlow(value:flashx.textLayout.elements:TextFlow):void`

### userData

property

`public var userData:*`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Arbitrary data associated with an element.

Constructor Detail

### FlowOperation

()
Constructor

`public function FlowOperation(textFlow:flashx.textLayout.elements:TextFlow)`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Creates the FlowOperation object.

Parameters

| `textFlow:flashx.textLayout.elements:TextFlow` — The text flow to which this operation is applied.

Method Detail

### canUndo

()
method

`public function canUndo():Boolean`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Test if this operation be placed on the undo stack.

Returns

| `Boolean` — true means to push the operation onto the undo stack. false means do not push this operation.

### doOperation

()
method

`public function doOperation():Boolean`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Executes the operation.

This method must be overridden in derived classes. The base class method does nothing. You should not call `doOperation()` directly. The edit manager calls the method when it executes the operation.

Returns

| `Boolean` — Boolean `true`, if the operation succeeded. Otherwise, `false`.

### redo

()
method

`public function redo():SelectionState`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Re-executes the operation.

This method must be overridden in derived classes. The base class method does nothing. You should not call `redo()` directly. The edit manager calls the method when it re-executes the operation.

Returns

| `SelectionState` — The SelectionState object passed to the operation when it was performed. This SelectionState object can be the current selection or a selection created specifically for the operation.

### undo

()
method

`public function undo():SelectionState`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Reverses the operation.

This method must be overridden in derived classes. The base class method does nothing. You should not call `undo()` directly. The edit manager calls the method when it reverses the operation.

Returns

| `SelectionState` — The SelectionState object passed to the operation when it was performed. This SelectionState object can be the current selection or a selection created specifically for the operation.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00