Packagecom.adobe.portfolio.components.supportClasses
Classpublic class CanvasList
InheritanceCanvasList Inheritance spark.components.List
Implements IListenAndWatch
Subclasses Header, Welcome

The CanvasList class extends List to provide an area for a user to add, remove, and edit text and image items.

Default MXML PropertydataProvider



Public Properties
 PropertyDefined By
  autoGeneratedLabel : String = CANVAS_PROPERTIES
The label string to be used when auto-generating a property context for this canvas list.
CanvasList
  autoGeneratedLabelKey : String = canvasProperties
The key for a localized string to be used for the label string when auto-generating a property context for this canvas list.
CanvasList
  autoGenerateProperties : Boolean = false
A boolean indicating whether a property context should be auto-generated for this canvas list.
CanvasList
  backgroundColor : uint
[read-only] The background color of this canvas list.
CanvasList
  backgroundGradientColor : uint
[read-only] The secondary color to be used for radial and linear gradient types.
CanvasList
  backgroundGradientType : String
[read-only] The background gradient type of this canvas list.
CanvasList
  backgroundOpacity : Number
[read-only] The background opacity of this canvas list.
CanvasList
  dataURL : String
The url location of the XML representing this canvas list, or null if it has no url representation.
CanvasList
  dirty : Boolean
True if this canvas has been changed and needs to be saved; false otherwise.
CanvasList
  heightIfPresent : Number
heightIfPresent determines the height of this canvas list when the shouldDisplayCanvas is true; the height is zero otherwise.
CanvasList
  swfClass : String
The name of the Flash asset to be drawn over the background of this canvas list.
CanvasList
  widthIfPresent : Number
widthIfPresent determines the width of this canvas list when the shouldDisplayCanvas is true; the width is zero otherwise.
CanvasList
Protected Properties
 PropertyDefined By
  addedPropertyBindings : Boolean = false
true if property bindings have been setup for this canvas list; false otherwise.
CanvasList
  addImageWatcher : ChangeWatcher
A ChangeWatcher used to detect when the add image property action is invoked by the user.
CanvasList
  addSwfWatcher : ChangeWatcher
A ChangeWatcher used to detect when the add swf property action is invoked by the user.
CanvasList
  addTextWatcher : ChangeWatcher
A ChangeWatcher used to detect when the add text property action is invoked by the user.
CanvasList
  backgroundColorWatcher : ChangeWatcher
A ChangeWatcher used to detect changes to the background color property.
CanvasList
  backgroundGradientIntensity : Number
[read-only] The gradient intensity used to determine the secondary color for radial and linear gradient types.
CanvasList
  backgroundGradientIntensityWatcher : ChangeWatcher
A ChangeWatcher used to detect changes to the gradient intensity property.
CanvasList
  backgroundGradientTypeWatcher : ChangeWatcher
A ChangeWatcher used to detect changes to the gradient type property.
CanvasList
  backgroundOpacityWatcher : ChangeWatcher
A ChangeWatcher used to detect changes to the background opacity property.
CanvasList
  templateWatcher : ChangeWatcher
A ChangeWatcher used to detect changes to the preset layout list property.
CanvasList
Public Methods
 MethodDefined By
  
Default constructor
CanvasList
  
A function to add event listeners and change watchers required by this canvas list.
CanvasList
  
applyPresetPositions(presetDataSet:Vector.<CanvasItemData>):void
Sets the list of items to match those from a preset list.
CanvasList
  
loseContext():Boolean
Clears the property context for this canvas list as the current property context.
CanvasList
  
A function to clean up event listeners and change watchers required by this canvas list.
CanvasList
  
Sets the preset layout property list to its blank entry.
CanvasList
  
Sets the preset layout property list to its custom entry.
CanvasList
  
takeContext():Boolean
Sets the property context for this canvas list as the current property context.
CanvasList
Protected Methods
 MethodDefined By
  
addImageAction(value:uint):void
Adds an image item to the canvas list.
CanvasList
  
Adds an image item to the canvas list.
CanvasList
  
A function to add event listeners and change watchers for binding portfolio properties to this canvas list.
CanvasList
  
addSwfAction(value:uint):void
Adds a swf item to the canvas list.
CanvasList
  
addSwfItem():void
Adds an swf item to the canvas list.
CanvasList
  
addTextAction(value:uint):void
Adds a text item to the canvas list.
CanvasList
  
Adds a text item to the canvas list.
CanvasList
  
Returns an auto-generated property context that can be used to represent this canvas lists properties.
CanvasList
  
[override]
CanvasList
  
Returns the property representing the list of preset layouts.
CanvasList
  
onAddImageButtonClick(event:MouseEvent):void
Adds an image item to the canvas list.
CanvasList
  
onAddTextButtonClick(event:MouseEvent):void
Adds a text item to the canvas list.
CanvasList
  
onMouseRoll(event:MouseEvent):void
Event listener for rollover events on this canvas list.
CanvasList
  
Event listener invoked on CollectionManagerEvents.
CanvasList
  
onRemoveButtonClick(event:MouseEvent):void
Remoeves selected items from the canvas list.
CanvasList
  
onRemoveItem(event:Event):void
Event listener invoked when a canvas item dispatches a remove event.
CanvasList
  
onRendererChange(event:RendererExistenceEvent):void
Event listener called when canvas item renderers are added or removed.
CanvasList
  
partAdded(partName:String, instance:Object):void
[override]
CanvasList
  
partRemoved(partName:String, instance:Object):void
[override]
CanvasList
  
A function to clean up event listeners and change watchers for binding portfolio properties to this canvas list.
CanvasList
  
setAuthoringMode(value:Boolean):void
A function invoked when authoring mode changes.
CanvasList
  
setBackgroundColor(value:Number):void
A function invoked when the background color property changes
CanvasList
  
A function invoked when the background gradient intensity property changes
CanvasList
  
A function invoked when the background gradient type property changes
CanvasList
  
setBackgroundOpacity(value:Number):void
A function invoked when the background opacity property changes
CanvasList
  
Sets the list of items to match those from a preset layout.
CanvasList
  
setCanvasXML(value:String):void
Initializes this canvas list from an XML representation.
CanvasList
  
Sets up the property context for this canvas list, auto-generating it if necessary.
CanvasList
  
Returns true if this canvas list should be displayed; false otherwise.
CanvasList
  
Sets the height of this canvas list based on heightIfPresent and shouldDisplayCanvas.
CanvasList
  
Sets the width of this canvas list based on widthIfPresent and shouldDisplayCanvas.
CanvasList
  
Updates backgroundGradientColor according to the current state of the canvas list.
CanvasList
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
  
addImageButton:spark.components.Button
Required: false Part Type: Static
addImageButton is the button control used to add an image item to this canvas list. It is an optional skin part, so not necessarily implemented for all skins.
CanvasList
  
addTextButton:spark.components.Button
Required: false Part Type: Static
addTextButton is the button control used to add a text item to this canvas list. It is an optional skin part, so not necessarily implemented for all skins.
CanvasList
  
removeButton:spark.components.Button
Required: false Part Type: Static
removeButton is the button control used to remove selected items from this canvas list. It is an optional skin part, so not necessarily implemented for all skins.
CanvasList
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
  
authoringNormal
CanvasList
  
authoringOver
CanvasList
  
authoringOverAndSelected
CanvasList
  
authoringSelected
CanvasList
Public Constants
 ConstantDefined By
  BLANK_PRESET_NAME : String = blank
[static] A string literal representing the name of the blank preset layout.
CanvasList
  CUSTOM_PRESET_NAME : String = custom
[static] A string literal representing the name of the custom preset layout.
CanvasList
  SKIN_PART_ADD_IMAGE_BUTTON : String = addImageButton
[static] A string literal representing the name of the addImageButton skin part.
CanvasList
  SKIN_PART_ADD_TEXT_BUTTON : String = addTextButton
[static] A string literal representing the name of the addTextButton skin part.
CanvasList
  SKIN_PART_REMOVE_BUTTON : String = removeButton
[static] A string literal representing the name of the removeButton skin part.
CanvasList
  SKIN_STATE_AUTHORING_NORMAL : String = authoringNormal
[static] A string literal representing the normal authoring state of this component's skin.
CanvasList
  SKIN_STATE_AUTHORING_OVER : String = authoringOver
[static] A string literal representing the over authoring state of this component's skin.
CanvasList
  SKIN_STATE_AUTHORING_OVER_AND_SELECTED : String = authoringOverAndSelected
[static] A string literal representing the overAndSelected authoring state of this component's skin.
CanvasList
  SKIN_STATE_AUTHORING_SELECTED : String = authoringSelected
[static] A string literal representing the selected authoring state of this component's skin.
CanvasList
  SKIN_STATE_DISABLED : String = disabled
[static] A string literal representing the disabled consumption state of this component's skin.
CanvasList
  SKIN_STATE_NORMAL : String = normal
[static] A string literal representing the normal consumption state of this component's skin.
CanvasList
  XML_ELEMENT_NAME : String = CanvasItems
[static] A string literal representing the element name used in the XML representation of a CanvasList.
CanvasList
Protected Constants
 ConstantDefined By
  collectionManager : CollectionManager
The navigator's CollectionManager instance.
CanvasList
Property Detail
addedPropertyBindingsproperty
protected var addedPropertyBindings:Boolean = false

true if property bindings have been setup for this canvas list; false otherwise.

addImageWatcherproperty 
protected var addImageWatcher:ChangeWatcher

A ChangeWatcher used to detect when the add image property action is invoked by the user.

See also

addSwfWatcherproperty 
protected var addSwfWatcher:ChangeWatcher

A ChangeWatcher used to detect when the add swf property action is invoked by the user.

See also

addTextWatcherproperty 
protected var addTextWatcher:ChangeWatcher

A ChangeWatcher used to detect when the add text property action is invoked by the user.

See also

autoGeneratedLabelproperty 
public var autoGeneratedLabel:String = CANVAS_PROPERTIES

The label string to be used when auto-generating a property context for this canvas list.

See also

PropertyContext
autoGeneratedLabelKeyproperty 
public var autoGeneratedLabelKey:String = canvasProperties

The key for a localized string to be used for the label string when auto-generating a property context for this canvas list.

See also

StringManager
autoGeneratePropertiesproperty 
public var autoGenerateProperties:Boolean = false

A boolean indicating whether a property context should be auto-generated for this canvas list.

See also

PropertyContext
backgroundColorproperty 
backgroundColor:uint  [read-only]

The background color of this canvas list.

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


Implementation
    public function get backgroundColor():uint
backgroundColorWatcherproperty 
protected var backgroundColorWatcher:ChangeWatcher

A ChangeWatcher used to detect changes to the background color property.

See also

backgroundGradientColorproperty 
backgroundGradientColor:uint  [read-only]

The secondary color to be used for radial and linear gradient types.

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


Implementation
    public function get backgroundGradientColor():uint
backgroundGradientIntensityproperty 
backgroundGradientIntensity:Number  [read-only]

The gradient intensity used to determine the secondary color for radial and linear gradient types.


Implementation
    protected function get backgroundGradientIntensity():Number

See also

updateGradientColor
backgroundGradientIntensityWatcherproperty 
protected var backgroundGradientIntensityWatcher:ChangeWatcher

A ChangeWatcher used to detect changes to the gradient intensity property.

See also

backgroundGradientTypeproperty 
backgroundGradientType:String  [read-only]

The background gradient type of this canvas list.

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


Implementation
    public function get backgroundGradientType():String

See also

GradientType
backgroundGradientTypeWatcherproperty 
protected var backgroundGradientTypeWatcher:ChangeWatcher

A ChangeWatcher used to detect changes to the gradient type property.

See also

backgroundOpacityproperty 
backgroundOpacity:Number  [read-only]

The background opacity of this canvas list.

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


Implementation
    public function get backgroundOpacity():Number
backgroundOpacityWatcherproperty 
protected var backgroundOpacityWatcher:ChangeWatcher

A ChangeWatcher used to detect changes to the background opacity property.

See also

dataURLproperty 
dataURL:String

The url location of the XML representing this canvas list, or null if it has no url representation.


Implementation
    public function get dataURL():String
    public function set dataURL(value:String):void
dirtyproperty 
dirty:Boolean

True if this canvas has been changed and needs to be saved; false otherwise.


Implementation
    public function get dirty():Boolean
    public function set dirty(value:Boolean):void
heightIfPresentproperty 
heightIfPresent:Number

heightIfPresent determines the height of this canvas list when the shouldDisplayCanvas is true; the height is zero otherwise.

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


Implementation
    public function get heightIfPresent():Number
    public function set heightIfPresent(value:Number):void
swfClassproperty 
swfClass:String

The name of the Flash asset to be drawn over the background of this canvas list.

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


Implementation
    public function get swfClass():String
    public function set swfClass(value:String):void

See also

FlashSkinManager
templateWatcherproperty 
protected var templateWatcher:ChangeWatcher

A ChangeWatcher used to detect changes to the preset layout list property.

See also

widthIfPresentproperty 
widthIfPresent:Number

widthIfPresent determines the width of this canvas list when the shouldDisplayCanvas is true; the width is zero otherwise.

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


Implementation
    public function get widthIfPresent():Number
    public function set widthIfPresent(value:Number):void
Constructor Detail
CanvasList()Constructor
public function CanvasList()

Default constructor

Method Detail
addImageAction()method
protected function addImageAction(value:uint):void

Adds an image item to the canvas list. This function is suitable for binding to a property action value.

Parameters

value:uint

See also

PropertyAction
addImageItem()method 
protected function addImageItem():void

Adds an image item to the canvas list.

See also

addListenAndWatch()method 
public function addListenAndWatch():void

A function to add event listeners and change watchers required by this canvas list.

addPropertyBindings()method 
protected function addPropertyBindings():void

A function to add event listeners and change watchers for binding portfolio properties to this canvas list.

addSwfAction()method 
protected function addSwfAction(value:uint):void

Adds a swf item to the canvas list. This function is suitable for binding to a property action value.

Parameters

value:uint

See also

PropertyAction
addSwfItem()method 
protected function addSwfItem():void

Adds an swf item to the canvas list.

See also

addTextAction()method 
protected function addTextAction(value:uint):void

Adds a text item to the canvas list. This function is suitable for binding to a property action value.

Parameters

value:uint

See also

PropertyAction
addTextItem()method 
protected function addTextItem():void

Adds a text item to the canvas list.

See also

applyPresetPositions()method 
public function applyPresetPositions(presetDataSet:Vector.<CanvasItemData>):void

Sets the list of items to match those from a preset list.

Parameters

presetDataSet:Vector.<CanvasItemData>

See also

setCanvasTemplate
generatePropertyContext()method 
protected function generatePropertyContext():PropertyContext

Returns an auto-generated property context that can be used to represent this canvas lists properties.

Returns
PropertyContext
getCurrentSkinState()method 
override protected function getCurrentSkinState():String

Returns
String
getTemplateProperty()method 
protected function getTemplateProperty():PropertyListValue

Returns the property representing the list of preset layouts.

Returns
PropertyListValue
loseContext()method 
public function loseContext():Boolean

Clears the property context for this canvas list as the current property context.

Returns
Boolean

See also

PropertyContext
PropertyManager.setCurrentContext
onAddImageButtonClick()method 
protected function onAddImageButtonClick(event:MouseEvent):void

Adds an image item to the canvas list. This function is suitable for use as a button event listener.

Parameters

event:MouseEvent

onAddTextButtonClick()method 
protected function onAddTextButtonClick(event:MouseEvent):void

Adds a text item to the canvas list. This function is suitable for use as a button event listener.

Parameters

event:MouseEvent

onMouseRoll()method 
protected function onMouseRoll(event:MouseEvent):void

Event listener for rollover events on this canvas list.

Parameters

event:MouseEvent

onNavHostEvent()method 
protected function onNavHostEvent(event:CollectionManagerEvent):void

Event listener invoked on CollectionManagerEvents.

Parameters

event:CollectionManagerEvent

onRemoveButtonClick()method 
protected function onRemoveButtonClick(event:MouseEvent):void

Remoeves selected items from the canvas list. This function is suitable for use as a button event listener.

Parameters

event:MouseEvent

onRemoveItem()method 
protected function onRemoveItem(event:Event):void

Event listener invoked when a canvas item dispatches a remove event.

Parameters

event:Event

onRendererChange()method 
protected function onRendererChange(event:RendererExistenceEvent):void

Event listener called when canvas item renderers are added or removed.

Parameters

event:RendererExistenceEvent

partAdded()method 
override protected function partAdded(partName:String, instance:Object):void

Parameters

partName:String
 
instance:Object

partRemoved()method 
override protected function partRemoved(partName:String, instance:Object):void

Parameters

partName:String
 
instance:Object

removeListenAndWatch()method 
public function removeListenAndWatch():void

A function to clean up event listeners and change watchers required by this canvas list.

removePropertyBindings()method 
protected function removePropertyBindings():void

A function to clean up event listeners and change watchers for binding portfolio properties to this canvas list.

setAuthoringMode()method 
protected function setAuthoringMode(value:Boolean):void

A function invoked when authoring mode changes.

Parameters

value:Boolean

setBackgroundColor()method 
protected function setBackgroundColor(value:Number):void

A function invoked when the background color property changes

Parameters

value:Number

setBackgroundGradientIntensity()method 
protected function setBackgroundGradientIntensity(value:Number):void

A function invoked when the background gradient intensity property changes

Parameters

value:Number

setBackgroundGradientType()method 
protected function setBackgroundGradientType(value:PropertyValue):void

A function invoked when the background gradient type property changes

Parameters

value:PropertyValue

setBackgroundOpacity()method 
protected function setBackgroundOpacity(value:Number):void

A function invoked when the background opacity property changes

Parameters

value:Number

setBlankTemplate()method 
public function setBlankTemplate():Boolean

Sets the preset layout property list to its blank entry.

Returns
Boolean

See also

setCanvasTemplate()method 
protected function setCanvasTemplate(value:PropertyValue):void

Sets the list of items to match those from a preset layout.

Parameters

value:PropertyValue

See also

CanvasTemplate
setCanvasXML()method 
protected function setCanvasXML(value:String):void

Initializes this canvas list from an XML representation.

Parameters

value:String

setCustomTemplate()method 
public function setCustomTemplate():Boolean

Sets the preset layout property list to its custom entry.

Returns
Boolean

See also

setupContext()method 
protected function setupContext():PropertyContext

Sets up the property context for this canvas list, auto-generating it if necessary.

Returns
PropertyContext
shouldDisplayCanvas()method 
protected function shouldDisplayCanvas():Boolean

Returns true if this canvas list should be displayed; false otherwise. Canvas lists should generally be displayed when they contain valid items, or when in authoring mode.

Returns
Boolean
takeContext()method 
public function takeContext():Boolean

Sets the property context for this canvas list as the current property context.

Returns
Boolean

See also

PropertyContext
PropertyManager.setCurrentContext
updateActualHeight()method 
protected function updateActualHeight():void

Sets the height of this canvas list based on heightIfPresent and shouldDisplayCanvas.

updateActualWidth()method 
protected function updateActualWidth():void

Sets the width of this canvas list based on widthIfPresent and shouldDisplayCanvas.

updateGradientColor()method 
protected function updateGradientColor():void

Updates backgroundGradientColor according to the current state of the canvas list.

Constant Detail
BLANK_PRESET_NAMEConstant
public static const BLANK_PRESET_NAME:String = blank

A string literal representing the name of the blank preset layout.

collectionManagerConstant 
protected const collectionManager:CollectionManager

The navigator's CollectionManager instance. All host interaction should go through this instance, rather than the INavigatorHost directly.

CUSTOM_PRESET_NAMEConstant 
public static const CUSTOM_PRESET_NAME:String = custom

A string literal representing the name of the custom preset layout.

SKIN_PART_ADD_IMAGE_BUTTONConstant 
public static const SKIN_PART_ADD_IMAGE_BUTTON:String = addImageButton

A string literal representing the name of the addImageButton skin part.

SKIN_PART_ADD_TEXT_BUTTONConstant 
public static const SKIN_PART_ADD_TEXT_BUTTON:String = addTextButton

A string literal representing the name of the addTextButton skin part.

SKIN_PART_REMOVE_BUTTONConstant 
public static const SKIN_PART_REMOVE_BUTTON:String = removeButton

A string literal representing the name of the removeButton skin part.

SKIN_STATE_AUTHORING_NORMALConstant 
public static const SKIN_STATE_AUTHORING_NORMAL:String = authoringNormal

A string literal representing the normal authoring state of this component's skin.

SKIN_STATE_AUTHORING_OVERConstant 
public static const SKIN_STATE_AUTHORING_OVER:String = authoringOver

A string literal representing the over authoring state of this component's skin.

SKIN_STATE_AUTHORING_OVER_AND_SELECTEDConstant 
public static const SKIN_STATE_AUTHORING_OVER_AND_SELECTED:String = authoringOverAndSelected

A string literal representing the overAndSelected authoring state of this component's skin.

SKIN_STATE_AUTHORING_SELECTEDConstant 
public static const SKIN_STATE_AUTHORING_SELECTED:String = authoringSelected

A string literal representing the selected authoring state of this component's skin.

SKIN_STATE_DISABLEDConstant 
public static const SKIN_STATE_DISABLED:String = disabled

A string literal representing the disabled consumption state of this component's skin.

SKIN_STATE_NORMALConstant 
public static const SKIN_STATE_NORMAL:String = normal

A string literal representing the normal consumption state of this component's skin.

XML_ELEMENT_NAMEConstant 
public static const XML_ELEMENT_NAME:String = CanvasItems

A string literal representing the element name used in the XML representation of a CanvasList.