| Package | com.yworks.canvas.input |
| Class | public class TextEditorInputMode |
| Inheritance | TextEditorInputMode AbstractConcurrentInputMode AbstractInputMode flash.events.EventDispatcher |
IInputMode that displays an ITextEditor
instance in the canvas control to let the user edit a text.
| Property | Defined By | ||
|---|---|---|---|
| anchor : IPoint
Gets or sets the anchor of the text editor. | TextEditorInputMode | ||
| autoCommitOnFocusLost : Boolean
Gets or sets a property that determines whether the text edited should
be committed if the focus gets lost or the editing should be canceled. | TextEditorInputMode | ||
| autoStartEditing : Boolean
Determines whether this mode should automatically fire up the editor once it gets installed. | TextEditorInputMode | ||
![]() | canvas : CanvasComponent [read-only]
The canvas instance this mode is currently installed in or null
| AbstractInputMode | |
![]() | controller : ConcurrencyController
Gets or injects the ConcurrencyController for this instance. | AbstractConcurrentInputMode | |
| editing : Boolean
Gets or sets the current editing state of the editor. | TextEditorInputMode | ||
![]() | enabled : Boolean
Gets or sets the enabled state of this input mode. | AbstractConcurrentInputMode | |
![]() | inputModeContext : IInputModeContext [read-only]
The context instance this mode is currently installed in or
null if this instance is not installed. | AbstractInputMode | |
![]() | installed : Boolean [read-only]
Whether this mode is currently installed, i.e
if a call to the canvas property will yield a non-null result. | AbstractInputMode | |
| location : IPoint
Gets or sets the location of the text box in world coordinates. | TextEditorInputMode | ||
![]() | preferredCursor : Cursor
Gets or sets the cursor this mode would like to have displayed in the CanvasComponent. | AbstractConcurrentInputMode | |
| textEditor : ITextEditor
Gets or sets the text box to use for displaying and editing. | TextEditorInputMode | ||
| Method | Defined By | ||
|---|---|---|---|
TextEditorInputMode(textEditor:ITextEditor = null)
Creates a new instance using the given text editor instance. | TextEditorInputMode | ||
cancel():void [override]
Cancels editing of the text box. | TextEditorInputMode | ||
clear():void
Resets the contents of the text editor. | TextEditorInputMode | ||
![]() | dispose():void
Disposes this input mode. | AbstractInputMode | |
![]() | install(context:IInputModeContext):void
Installs this mode into the canvas of the given context. | AbstractInputMode | |
stop():Boolean [override]
Stops editing and returns true. | TextEditorInputMode | ||
![]() | uninstall(context:IInputModeContext):void
Uninstalls this mode from the canvas. | AbstractInputMode | |
| Method | Defined By | ||
|---|---|---|---|
adjustPosition():void
Adjusts the position of the text box in the canvas control. | TextEditorInputMode | ||
adjustSize():void
Adjusts the size of the text editor in the canvas control. | TextEditorInputMode | ||
![]() | canRequestMutex():Boolean
Determines whether this instance can request the InputMutex. | AbstractConcurrentInputMode | |
Factory method that creates a default text box. | TextEditorInputMode | ||
![]() | fireInstalled():void | AbstractInputMode | |
![]() | fireInstalling():void | AbstractInputMode | |
![]() | fireUninstalled():void | AbstractInputMode | |
![]() | fireUninstalling():void | AbstractInputMode | |
![]() | hasMutex():Boolean
Determines whether this instance owns the input mutex. | AbstractConcurrentInputMode | |
![]() | initialize():void
Performs one-time initialization of this instance. | AbstractInputMode | |
installCore(context:IInputModeContext):void [override]
The implementation of the install() method: installs this mode into
the canvas of the given context. | TextEditorInputMode | ||
installTextEditor():void
Installs the text editor in the canvas and puts focus into it. | TextEditorInputMode | ||
![]() | invalidate():void
Convenience method for subclass implementations that invalidates
the canvasComponent this mode is currently installed in. | AbstractInputMode | |
onBeginEditing():void
Called when editing starts. | TextEditorInputMode | ||
onCancelEditing():void
Called when editing gets canceled. | TextEditorInputMode | ||
![]() | onDisabled():void
Called when the enabled property changes to false. | AbstractConcurrentInputMode | |
![]() | onEnabled():void
Called when the enabled property changes to true. | AbstractConcurrentInputMode | |
![]() | onMutexObtained():void
Called when this instance obtains the InputMutex. | AbstractConcurrentInputMode | |
![]() | onMutexReleased():void
Called when this instance released the InputMutex. | AbstractConcurrentInputMode | |
![]() |
Called when the preferredCursor property changes. | AbstractConcurrentInputMode | |
onStopEditing():void
Called when editing is stopped. | TextEditorInputMode | ||
![]() | releaseMutex():void
Releases the mutex that is currently owned by this instance. | AbstractConcurrentInputMode | |
![]() | requestMutex():void
Requests the InputMutex from the current controller. | AbstractConcurrentInputMode | |
te_LostFocus(evt:Event):void
Called when the text editor lost the focus. | TextEditorInputMode | ||
uninstallCore(context:IInputModeContext):void [override]
Implementation of uninstall: Uninstalls this mode from the canvas. | TextEditorInputMode | ||
uninstallTextEditor():void
Removes the text box. | TextEditorInputMode | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when this input mode has been canceled. | TextEditorInputMode | |||
![]() | Dispatched after the input mode was installed. | AbstractInputMode | ||
![]() | Dispatched before the input mode will be installed. | AbstractInputMode | ||
![]() | Dispatched when the default cursor changed. | AbstractConcurrentInputMode | ||
| Dispatched when the text has been edited. | TextEditorInputMode | |||
![]() | Dispatched after the input mode was uninstalled. | AbstractInputMode | ||
![]() | Dispatched before the input mode will be uninstalled. | AbstractInputMode | ||
| Constant | Defined By | ||
|---|---|---|---|
| EDITING_CANCELED : String = editingCanceled [static]
| TextEditorInputMode | ||
![]() | INSTALLED : String = installed [static]
| AbstractInputMode | |
![]() | INSTALLING : String = installing [static]
| AbstractInputMode | |
![]() | PREFERRED_CURSOR_CHANGED : String = preferredCursorChanged [static] | AbstractConcurrentInputMode | |
| TEXT_EDITED : String = textEdited [static]
| TextEditorInputMode | ||
![]() | UNINSTALLED : String = uninstalled [static]
| AbstractInputMode | |
![]() | UNINSTALLING : String = uninstalling [static]
| AbstractInputMode | |
| anchor | property |
anchor:IPointGets or sets the anchor of the text editor.
The anchor is the point inside the coordinate system of the text box that
shall coincide with the location in the world coordinate system.
public function get anchor():IPoint public function set anchor(value:IPoint):void| autoCommitOnFocusLost | property |
autoCommitOnFocusLost:BooleanGets or sets a property that determines whether the text edited should be committed if the focus gets lost or the editing should be canceled.
The default behavior is to cancel the editing process.
The default value is false.
public function get autoCommitOnFocusLost():Boolean public function set autoCommitOnFocusLost(value:Boolean):void| autoStartEditing | property |
autoStartEditing:BooleanDetermines whether this mode should automatically fire up the editor once it gets installed.
If this mode is permanently installed, set this flag to false and
set the editing flag to true in order to start editing.
The default value is false.
public function get autoStartEditing():Boolean public function set autoStartEditing(value:Boolean):void| editing | property |
editing:BooleanGets or sets the current editing state of the editor.
Setting a new value will trigger the onBeginEditing
and onCancelEditing methods respectively.
public function get editing():Boolean public function set editing(value:Boolean):void| location | property |
location:IPointGets or sets the location of the text box in world coordinates.
public function get location():IPoint public function set location(value:IPoint):void| textEditor | property |
textEditor:ITextEditorGets or sets the text box to use for displaying and editing.
This will trigger the createTextBox factory method,
the first time this property is queried.
public function get textEditor():ITextEditor public function set textEditor(value:ITextEditor):void| TextEditorInputMode | () | Constructor |
public function TextEditorInputMode(textEditor:ITextEditor = null)Creates a new instance using the given text editor instance.
ParameterstextEditor:ITextEditor (default = null) — The text editor to use.
|
| adjustPosition | () | method |
protected function adjustPosition():voidAdjusts the position of the text box in the canvas control.
| adjustSize | () | method |
protected function adjustSize():voidAdjusts the size of the text editor in the canvas control.
| cancel | () | method |
override public function cancel():voidCancels editing of the text box.
| clear | () | method |
public function clear():voidResets the contents of the text editor.
| createTextEditor | () | method |
protected function createTextEditor():ITextEditorFactory method that creates a default text box.
Hitting escape or enter will cancel or stop editing.
ReturnsITextEditor — An ITextEditor implementation.
|
| installCore | () | method |
override protected function installCore(context:IInputModeContext):void
The implementation of the install() method: installs this mode into
the canvas of the given context.
Subclasses should override this method and call super.installCore(context), first.
One-time initialization should be performed in the initialize method.
The install method will call the initialize method the first
time this mode gets installed.
Parameters
context:IInputModeContext — The context to use for installation.
|
| installTextEditor | () | method |
protected function installTextEditor():voidInstalls the text editor in the canvas and puts focus into it.
| onBeginEditing | () | method |
protected function onBeginEditing():voidCalled when editing starts.
Requests the input mutex, and installs the text box.
| onCancelEditing | () | method |
protected function onCancelEditing():voidCalled when editing gets canceled.
Removes the text box and releases the input mutex.
| onStopEditing | () | method |
protected function onStopEditing():voidCalled when editing is stopped.
Triggers the textEdited event,
removes the box and releases the input mutex.
| stop | () | method |
override public function stop():Boolean
Stops editing and returns true.
Boolean — super.stop()
|
| te_LostFocus | () | method |
protected function te_LostFocus(evt:Event):voidCalled when the text editor lost the focus. Cancels this input mode.
Parameters
evt:Event |
| uninstallCore | () | method |
override protected function uninstallCore(context:IInputModeContext):void
Implementation of uninstall: Uninstalls this mode from the canvas.
Subclasses should always call super.uninstallCore( context ) as the last
statement.
Parameters
context:IInputModeContext — The context to remove this mode from. This is the same instance that
has been passed to install( IInputModeContext ).
|
| uninstallTextEditor | () | method |
protected function uninstallTextEditor():voidRemoves the text box.
| editingCanceled | Event |
flash.events.Eventmx.events.EventDispatched when this input mode has been canceled.
This input mode is also canceled after a successful edit. Thus, this event will also be dispatched after a successful edit.
| textEdited | Event |
flash.events.Eventmx.events.EventDispatched when the text has been edited.
| EDITING_CANCELED | Constant |
public static const EDITING_CANCELED:String = editingCanceled
| TEXT_EDITED | Constant |
public static const TEXT_EDITED:String = textEdited