Apache Flex 4.16.0 API Reference | All Packages | All Classes | Index | Frames No Frames |
ApplyFormatOperation

Package | flashx.textLayout.operations
Class | public class ApplyFormatOperation
Inheritance | ApplyFormatOperation FlowTextOperation FlowOperation Object

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

The ApplyFormatOperation class encapsulates a style change.

An ApplyFormatOperation applies the leaf format to the text in the specified range (no change is made if the specified range is a single point). It applies the paragraph format to any paragraphs at least partially within the range (or a single paragraph if the range is a single point). And it applies the container format to any containers at least partially within the range (or a single container if the range is a single point).

See also

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

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | absoluteEnd : int The absolute end point of the range of text to which this operation is applied. | FlowTextOperation
|  | absoluteStart : int The absolute start point of the range of text to which this operation is applied. | FlowTextOperation
|  | beginGeneration : uint [read-only] The text flow generation before the operation. | FlowOperation
|  | containerFormat : ITextLayoutFormat The format properties to apply to the containers in the range. | ApplyFormatOperation
|  | endGeneration : uint [read-only] The text flow generation after the operation. | FlowOperation
|  | leafFormat : ITextLayoutFormat The format properties to apply to the leaf elements in the range. | ApplyFormatOperation
|  | originalSelectionState : SelectionState The selection state at the start of the operation. | FlowTextOperation
|  | paragraphFormat : ITextLayoutFormat The format properties to apply to the paragraphs in the range. | ApplyFormatOperation
|  | textFlow : 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
--- | --- | ---
|  | ApplyFormatOperation(operationState:SelectionState, leafFormat:ITextLayoutFormat, paragraphFormat:ITextLayoutFormat, containerFormat:ITextLayoutFormat = null) Creates an ApplyFormatOperation object. | ApplyFormatOperation
|  | canUndo():Boolean Test if this operation be placed on the undo stack. | FlowOperation
|  | doOperation():Boolean Executes the operation. | FlowOperation
|  | redo():SelectionState [override] Re-executes the operation. | FlowTextOperation
|  | undo():SelectionState Reverses the operation. | FlowOperation

Property Detail

containerFormat | property

`containerFormat:ITextLayoutFormat`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

The format properties to apply to the containers in the range.

The formats of any containers at least partially within the range are updated. If the range of this operation is a point, then a single container is updated. If `containerFormat` is `null`, then no container formats are changed.

Implementation
`public function get containerFormat():ITextLayoutFormat`
`public function set containerFormat(value:ITextLayoutFormat):void`

leafFormat | property |

`leafFormat:ITextLayoutFormat`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

The format properties to apply to the leaf elements in the range.

If the range of this operation is a point, or if `leafFormat` is `null`, then no leaf element formats are changed.

Implementation
`public function get leafFormat():ITextLayoutFormat`
`public function set leafFormat(value:ITextLayoutFormat):void`

paragraphFormat | property |

`paragraphFormat:ITextLayoutFormat`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

The format properties to apply to the paragraphs in the range.

The formats of any paragraphs at least partially within the range are updated. If the range of this operation is a point, then a single paragraph is updated. If `paragraphFormat` is `null`, then no paragraph formats are changed.

Implementation
`public function get paragraphFormat():ITextLayoutFormat`
`public function set paragraphFormat(value:ITextLayoutFormat):void`
Constructor Detail

ApplyFormatOperation | () | Constructor

`public function ApplyFormatOperation(operationState:SelectionState, leafFormat:ITextLayoutFormat, paragraphFormat:ITextLayoutFormat, containerFormat:ITextLayoutFormat = null)`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Creates an ApplyFormatOperation object.

Parameters

| `operationState:SelectionState` — Defines the text range to which the format is applied.
| `leafFormat:ITextLayoutFormat` — The format to apply to LeafFlowElement objects in the selected range.
| `paragraphFormat:ITextLayoutFormat` — The format to apply to ParagraphElement objects in the selected range.
| `containerFormat:ITextLayoutFormat` (default = `null`)`` — The format to apply to containers in the selected range.

Sun Mar 5 2017, 03:42 PM +11:00