Packagecom.esri.ags.components
Classpublic class Editor
InheritanceEditor Inheritance spark.components.supportClasses.SkinnableComponent

Since : ArcGIS API for Flex 2.0

The Editor component provides out-of-the-box editing capabilities using an editable layer in a Feature Service. It combines functionality from the out-of-the-box TemplatePicker, DrawTool, EditTool and GeometryService classes with additional editing functionality. When writing editing applications, try to take advantage of the skinnable and customizable out-of-the-box Editor component if you can.

Editing behaviors:

Limitations/Quirks: Note:

See also

com.esri.ags.layers.FeatureLayer
com.esri.ags.tools.DrawTool
com.esri.ags.tools.EditTool
Live sample - Editor
Live sample - Editor with toolbar
Live sample - Editor with all toolbar options


Public Properties
 PropertyDefined By
  addEnabled : Boolean
If true, allows adding features.
Editor
  attributeInspector : AttributeInspector
[read-only] The attribute inspector used by the Editor.
Editor
  createGeometryType : String
[read-only] The current geometry type based on the selected template.
Editor
  createOptions : CreateOptions
Create Options for the editor, for example, should the Editor use "freehand" instead of the default "point-to-point" when drawing (creating) new features.
Editor
  deleteEnabled : Boolean
If true, allows deleting features.
Editor
  drawTool : DrawTool
[read-only] The draw tool used by the Editor.
Editor
  editTool : EditTool
[read-only] The edit tool used by the Editor.
Editor
  featureLayers : Array
Array of FeatureLayer instances.
Editor
  geometryService : GeometryService
The geometry service that the editor is associated with.
Editor
  map : Map
The Map that the editor is associated with.
Editor
  showTemplateSwatchOnCursor : Boolean
If true, shows the swatch(selected template symbol) on cursor.
Editor
  toolbarCutVisible : Boolean
If true, displays the "cut" (aka "split") button on the toolbar.
Editor
  toolbarMergeVisible : Boolean
If true, displays the "merge" button on the toolbar.
Editor
  toolbarReshapeVisible : Boolean
If true, displays the "reshape" button on the toolbar.
Editor
  toolbarVisible : Boolean
If true, shows the "toolbar".
Editor
  undoAndRedoItemLimit : int
The maximum number of undoable or redoable operations to track.
Editor
  updateAttributesEnabled : Boolean
If true, allows updating attributes.
Editor
  updateGeometryEnabled : Boolean
If true, allows updating geometries.
Editor
Public Methods
 MethodDefined By
  
Editor(featureLayers:Array = null, map:Map = null, geometryService:GeometryService = null)
Creates a new Editor.
Editor
Events
 Event Summary Defined By
  Dispatched when an Editor operation fails.Editor
Skin Parts

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
  
clearSelectionButton:spark.components.supportClasses.ButtonBase
Required: false Part Type: Static
An optional skin part for clear selection button.
Editor
  
cutButton:spark.components.supportClasses.ToggleButtonBase
Required: false Part Type: Static
An optional skin part for cut operation button.
Editor
  
deleteButton:spark.components.supportClasses.ButtonBase
Required: false Part Type: Static
An optional skin part for delete button.
Editor
  
drawDropDownList:spark.components.DropDownList
Required: false Part Type: Static
An optional skin part for the draw drop down list.
Editor
  
mergeButton:spark.components.supportClasses.ButtonBase
Required: false Part Type: Static
An optional skin part for the merge operation button.
Editor
  
operationCompleteLabel:spark.components.Label
Required: false Part Type: Static
An optional skin part for the operation complete text.
Editor
  
operationStartLabel:spark.components.Label
Required: false Part Type: Static
An optional skin part for the operation start text.
Editor
  
redoButton:spark.components.supportClasses.ButtonBase
Required: false Part Type: Static
An optional skin part for the redo operation button.
Editor
  
reshapeButton:spark.components.supportClasses.ToggleButtonBase
Required: false Part Type: Static
An optional skin part for the reshape operation button.
Editor
  
selectionDropDownList:spark.components.DropDownList
Required: false Part Type: Static
An optional skin part for the selection drop down list.
Editor
  
templatePicker:TemplatePicker
Required: false Part Type: Static
An optional skin part for the template picker. Use this if you need to change the TemplatePicker and/or its properties
Editor
  
undoButton:spark.components.supportClasses.ButtonBase
Required: false Part Type: Static
An optional skin part for the undo operation button.
Editor
Skin States

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
  
applyingEdits
Editor is applying edits on a feature layer. Editor
  
disabled
The disabled state of the Editor component. Editor
  
featuresSelected
One or more features are selected. Editor
  
normal
The default (i.e., "normal") state of the Editor component. Editor
  
templateSelected
A template is selected on the template picker. Editor
  
toolbarNotVisible
Toolbar not visible. Editor
Property Detail
addEnabledproperty
addEnabled:Boolean

Since : ArcGIS API for Flex 2.3

If true, allows adding features.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get addEnabled():Boolean
    public function set addEnabled(value:Boolean):void
attributeInspectorproperty 
attributeInspector:AttributeInspector  [read-only]

The attribute inspector used by the Editor. Use this if you need to change the AttributeInspector and/or its properties.


Implementation
    public function get attributeInspector():AttributeInspector
createGeometryTypeproperty 
createGeometryType:String  [read-only]

The current geometry type based on the selected template.

This property can be used as the source for data binding.


Implementation
    public function get createGeometryType():String
createOptionsproperty 
createOptions:CreateOptions

Create Options for the editor, for example, should the Editor use "freehand" instead of the default "point-to-point" when drawing (creating) new features. Also determines what goes in the draw tool drop down in the toolbar.

When toolbarVisible is true, users can change the default. When toolbarVisible is false, the first draw tool is used (and end users can not change it). The draw tool are listed in the order they are defined. To change the "default" draw tool, simply list it first.

This property can be used as the source for data binding.


Implementation
    public function get createOptions():CreateOptions
    public function set createOptions(value:CreateOptions):void
deleteEnabledproperty 
deleteEnabled:Boolean

Since : ArcGIS API for Flex 2.1

If true, allows deleting features.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get deleteEnabled():Boolean
    public function set deleteEnabled(value:Boolean):void
drawToolproperty 
drawTool:DrawTool  [read-only]

The draw tool used by the Editor. Use this if you need to change the DrawTool and/or its properties.


Implementation
    public function get drawTool():DrawTool
editToolproperty 
editTool:EditTool  [read-only]

The edit tool used by the Editor. Use this if you need to change the EditTool and/or its properties.


Implementation
    public function get editTool():EditTool
featureLayersproperty 
featureLayers:Array

Array of FeatureLayer instances.

This property can be used as the source for data binding.


Implementation
    public function get featureLayers():Array
    public function set featureLayers(value:Array):void
geometryServiceproperty 
geometryService:GeometryService

The geometry service that the editor is associated with.

This property can be used as the source for data binding.


Implementation
    public function get geometryService():GeometryService
    public function set geometryService(value:GeometryService):void
mapproperty 
map:Map

The Map that the editor is associated with.

This property can be used as the source for data binding.


Implementation
    public function get map():Map
    public function set map(value:Map):void
showTemplateSwatchOnCursorproperty 
showTemplateSwatchOnCursor:Boolean

If true, shows the swatch(selected template symbol) on cursor.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get showTemplateSwatchOnCursor():Boolean
    public function set showTemplateSwatchOnCursor(value:Boolean):void
toolbarCutVisibleproperty 
toolbarCutVisible:Boolean

If true, displays the "cut" (aka "split") button on the toolbar. Don't forget to turn on the toolbar itself using the toolbarVisible property.

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get toolbarCutVisible():Boolean
    public function set toolbarCutVisible(value:Boolean):void

See also

toolbarMergeVisibleproperty 
toolbarMergeVisible:Boolean

If true, displays the "merge" button on the toolbar. Don't forget to turn on the toolbar itself using the toolbarVisible property.

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get toolbarMergeVisible():Boolean
    public function set toolbarMergeVisible(value:Boolean):void

See also

toolbarReshapeVisibleproperty 
toolbarReshapeVisible:Boolean

If true, displays the "reshape" button on the toolbar. Don't forget to turn on the toolbar itself using the toolbarVisible property.

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get toolbarReshapeVisible():Boolean
    public function set toolbarReshapeVisible(value:Boolean):void

See also

toolbarVisibleproperty 
toolbarVisible:Boolean

If true, shows the "toolbar". By default, the "toolbar" displays below the template picker, but you can change this with the skin parts.

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get toolbarVisible():Boolean
    public function set toolbarVisible(value:Boolean):void
undoAndRedoItemLimitproperty 
undoAndRedoItemLimit:int

Since : ArcGIS API for Flex 2.2

The maximum number of undoable or redoable operations to track. To disable the undo/redo function, set this value to 0.

The default value is 25.

This property can be used as the source for data binding.


Implementation
    public function get undoAndRedoItemLimit():int
    public function set undoAndRedoItemLimit(value:int):void
updateAttributesEnabledproperty 
updateAttributesEnabled:Boolean

Since : ArcGIS API for Flex 2.3

If true, allows updating attributes.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get updateAttributesEnabled():Boolean
    public function set updateAttributesEnabled(value:Boolean):void
updateGeometryEnabledproperty 
updateGeometryEnabled:Boolean

Since : ArcGIS API for Flex 2.3

If true, allows updating geometries.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get updateGeometryEnabled():Boolean
    public function set updateGeometryEnabled(value:Boolean):void
Constructor Detail
Editor()Constructor
public function Editor(featureLayers:Array = null, map:Map = null, geometryService:GeometryService = null)

Creates a new Editor.

Parameters
featureLayers:Array (default = null) — Array of feature layers.
 
map:Map (default = null) — The Map to use with the Editor.
 
geometryService:GeometryService (default = null) — The geometry service instance to use with the Editor.
Event Detail
fault Event
Event Object Type: mx.rpc.events.FaultEvent
FaultEvent.type property = mx.rpc.events.FaultEvent.FAULT

Dispatched when an Editor operation fails.