Packagecom.adobe.portfolio.lists
Classpublic class CardList
InheritanceCardList Inheritance spark.components.List
Implements IListenAndWatch
Subclasses CardContainer, DetailsCardList, LinearList, MiniNavList, OneUpList

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The CardList class extends List to provide support for Navigators that display lists of cards. It also handles drag and drop gestures and allows for reordering of items.

Default MXML PropertydataProvider



Public Properties
 PropertyDefined By
  bindableDataGroup : DataGroup
[read-only]
CardList
  dataProvider : IList
[override] [write-only] Sets the dataProvider for this list.
CardList
  dragStarted : Boolean = false
A boolean to indicate that a drag operation is in progress
CardList
  enableIdle : Boolean
CardList
  useDragDropOnFolders : Boolean = false
To enable dragDrop on folders during a drag operation.
CardList
  useDragDropReordering : Boolean = false
To allow for reordering of items using simple drag and drop gestures.
CardList
Protected Properties
 PropertyDefined By
  autoListen : AutoListen
CardList
  autoWatch : AutoWatch
CardList
  cardLayout : ICardLayout
CardList
  cardLayoutHelper : CardLayoutHelper
CardList
  focusCardDelta : int
CardList
  isDragAndDropDisabled : Boolean
[static] [read-only] True if drag and drop has been temporarily disabled for card lists.
CardList
Public Methods
 MethodDefined By
  
Constructor
CardList
  
addDragData(dragSource:DragSource):void
[override] Takes the data set by the list for ordered items and adds it to the attachments data format.
CardList
  
Adds listeners and watchers that are automatically unwatched and unlistened.
CardList
  
calculateDropLocation(event:DragEvent):DropLocation
Calculate the dropLocation of the given dragEvent.
CardList
  
cardFromAttachment(_dataGroup:DataGroup, attachment:Object):ISimpleCard
[static] Finds the card associated with the given attachment
CardList
  
collectionDropEnabled(event:DragEvent):Boolean
Helper function that determines whether drag drop is supported
CardList
  
createDropIndicator():DisplayObject
[override] Creates a custom dropIndicator for the cardList.
CardList
  
[static] Functions used to disable and enable drag and drop.
CardList
  
[static]
CardList
  
Finds the card corresponding to the attachment in focus.
CardList
  
getFolderItemAtDragLocation(dropLocation:DropLocation):IAttachment
Finds the folder at a given dropLocation
CardList
  
Function to cleanup the event listeners required by miniNav list.
CardList
  
Force selection change.
CardList
  
setSelectedIndicesWithChangeDispatch(value:Vector.<int>):void
Force selection change.
CardList
  
updateRenderer(renderer:IVisualElement, itemIndex:int, data:Object):void
[override]
CardList
Protected Methods
 MethodDefined By
  
addListener(listener:IEventDispatcher, type:String, handler:Function):void
CardList
  
addWatcher(watcher:ChangeWatcher):void
CardList
  
Returns true if the dataProvider for this list matches the CollectionMgr's currentItems.
CardList
  
dragCompleteHandler(event:DragEvent):void
[override]
CardList
  
dragDropHandler(event:DragEvent):void
[override]
CardList
  
dragEnterHandler(event:DragEvent):void
[override]
CardList
  
dragExitHandler(event:DragEvent):void
[override]
CardList
  
dragOverHandler(event:DragEvent):void
[override]
CardList
  
dragStartHandler(event:DragEvent):void
[override] Does not start drag if some other component has disabled it.
CardList
  
handleDragDropReordering(event:DragEvent):void
Handles the reordering of items after a dragDrop.
CardList
  
handleDropOnFolder(folder:IAttachment, event:DragEvent):IList
Handles drop on a folder.
CardList
  
Triggers generation of thumbnails around the new focus card.
CardList
  
Updates the host's selection based on the current list selection.
CardList
  
CardList
  
keyDownHandler(event:KeyboardEvent):void
[override]
CardList
  
makeNewOrderedList(dropIndex:int, droppingItems:ArrayCollection):IList
Creates an ordered list of items in the dataProvider after the drop.
CardList
  
onChildrenCollectionChange(event:CollectionEvent):void
This function is used when attachments are moved across folders.
CardList
  
onCollectionChange(e:CollectionEvent):void
Listener to handle collection change events.
CardList
  
onCreationComplete(event:FlexEvent):void
CardList
  
onIndexChangeEvent(event:IndexChangeEvent):void
This listener is called when the selection changes based on user interaction, or when setSelectedIndexWithChangeDispatch or setSelectedIndicesWithChangeDispatch is used to set the selection.
CardList
  
Listener to handle events from the Collection Manager.
CardList
  
onOpenFolderTimeComplete(evt:TimerEvent):void
Called when the openFolderTimer completes.
CardList
  
onResize(event:ResizeEvent):void
CardList
  
onScroll(event:Event):void
Listener to handle scroll events of the scroller on cardLists.
CardList
  
partAdded(partName:String, instance:Object):void
[override]
CardList
  
partRemoved(partName:String, instance:Object):void
[override]
CardList
  
removeListener(listener:IEventDispatcher, type:String = null):void
CardList
  
reorderAttachments(source:IList):Boolean
Sends the reorder command once all the attachments are found in the given list.
CardList
  
CardList
  
CardList
  
CardList
Public Constants
 ConstantDefined By
  collectionMgr : CollectionManager
The navigator's CollectionManager instance.
CardList
  DRAG_DROP_ATTACHMENTS : String = attachments
[static] Format that defines the set of Acrobat drag and drop attachments.
CardList
  DRAG_DROP_ITEMS : String = itemsByIndex
[static] Format that defines the default set of List drag and drop items.
CardList
Property Detail
autoListenproperty
protected var autoListen:AutoListen

autoWatchproperty 
protected var autoWatch:AutoWatch

bindableDataGroupproperty 
bindableDataGroup:DataGroup  [read-only]

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


Implementation
    public function get bindableDataGroup():DataGroup
cardLayoutproperty 
protected var cardLayout:ICardLayout

cardLayoutHelperproperty 
protected var cardLayoutHelper:CardLayoutHelper

dataProviderproperty 
dataProvider:IList  [write-only] [override]

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Sets the dataProvider for this list.


Implementation
    public function set dataProvider(value:IList):void
dragStartedproperty 
public var dragStarted:Boolean = false

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

A boolean to indicate that a drag operation is in progress

enableIdleproperty 
enableIdle:Boolean


Implementation
    public function get enableIdle():Boolean
    public function set enableIdle(value:Boolean):void
focusCardDeltaproperty 
protected var focusCardDelta:int

isDragAndDropDisabledproperty 
isDragAndDropDisabled:Boolean  [read-only]

True if drag and drop has been temporarily disabled for card lists.


Implementation
    protected static function get isDragAndDropDisabled():Boolean

See also

disableDragAndDrop
enableDragAndDrop
useDragDropOnFoldersproperty 
public var useDragDropOnFolders:Boolean = false

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

To enable dragDrop on folders during a drag operation. Some layouts like miniNav allow for drag/drop on folders, whereas others like Linear don't.

useDragDropReorderingproperty 
public var useDragDropReordering:Boolean = false

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

To allow for reordering of items using simple drag and drop gestures. If this is set to false, drag and drop will still be allowed, but reordering will not occur.

Constructor Detail
CardList()Constructor
public function CardList()

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Constructor

Method Detail
addDragData()method
override public function addDragData(dragSource:DragSource):void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Takes the data set by the list for ordered items and adds it to the attachments data format. Acrobat uses that for external drag-drops

Parameters

dragSource:DragSource

addListenAndWatch()method 
public function addListenAndWatch():void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Adds listeners and watchers that are automatically unwatched and unlistened.

addListener()method 
protected function addListener(listener:IEventDispatcher, type:String, handler:Function):void

Parameters

listener:IEventDispatcher
 
type:String
 
handler:Function

addWatcher()method 
protected function addWatcher(watcher:ChangeWatcher):void

Parameters

watcher:ChangeWatcher

calculateDropLocation()method 
public function calculateDropLocation(event:DragEvent):DropLocation

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Calculate the dropLocation of the given dragEvent. This is the location where the mouse is gestured to drop.

Parameters

event:DragEvent

Returns
DropLocation — The drop location for this event, or null if the drop operation is not available.
cardFromAttachment()method 
public static function cardFromAttachment(_dataGroup:DataGroup, attachment:Object):ISimpleCard

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Finds the card associated with the given attachment

Parameters

_dataGroup:DataGroup — The datagroup to which the attachment belongs.
 
attachment:Object — The attachment whose card is needed.

Returns
ISimpleCard — The card corresponding to the given attachment.
collectionDropEnabled()method 
public function collectionDropEnabled(event:DragEvent):Boolean

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Helper function that determines whether drag drop is supported

Parameters

event:DragEvent

Returns
Boolean
createDropIndicator()method 
override public function createDropIndicator():DisplayObject

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Creates a custom dropIndicator for the cardList.

Returns
DisplayObject
dataProviderIsCurrent()method 
protected function dataProviderIsCurrent():Boolean

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Returns true if the dataProvider for this list matches the CollectionMgr's currentItems. Things like focus and selection should only be propagated to the CollectionMgr if the dataProvider is current.

Returns
Boolean
disableDragAndDrop()method 
public static function disableDragAndDrop():void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Functions used to disable and enable drag and drop. If disabledDragAndDropCounter > 0, a drag will not be started. Drags can be disabled by other components like ScrollPad.

dragCompleteHandler()method 
override protected function dragCompleteHandler(event:DragEvent):void

Parameters

event:DragEvent

dragDropHandler()method 
override protected function dragDropHandler(event:DragEvent):void

Parameters

event:DragEvent

dragEnterHandler()method 
override protected function dragEnterHandler(event:DragEvent):void

Parameters

event:DragEvent

dragExitHandler()method 
override protected function dragExitHandler(event:DragEvent):void

Parameters

event:DragEvent

dragOverHandler()method 
override protected function dragOverHandler(event:DragEvent):void

Parameters

event:DragEvent

dragStartHandler()method 
override protected function dragStartHandler(event:DragEvent):void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Does not start drag if some other component has disabled it. Also distinguishes text selection from a drag.

Parameters

event:DragEvent

enableDragAndDrop()method 
public static function enableDragAndDrop():void

findCardWithAttachmentFocus()method 
public function findCardWithAttachmentFocus():SimpleCard

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Finds the card corresponding to the attachment in focus.

Returns
SimpleCard — The Card corresponding to the attachment in focus.
getFolderItemAtDragLocation()method 
public function getFolderItemAtDragLocation(dropLocation:DropLocation):IAttachment

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Finds the folder at a given dropLocation

Parameters

dropLocation:DropLocation — The drop location at which the folder item needs to be determined.

Returns
IAttachment — The folder item at the drop location. Returns null if there is no folder at the given location
handleDragDropReordering()method 
protected function handleDragDropReordering(event:DragEvent):void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Handles the reordering of items after a dragDrop. However, it does not modify the dataProvider, but invokes makeNewOrderedList to create an ordered list of items after the drop. Drop on a folder is handled separately by handleDropOnFolder. It also handles adding of items as a result of an external drag/drop (dragInitiator is null in this case). However,the new items are already added to the dataProvider in this case as well, this function simply puts them in the correct order.

Parameters

event:DragEvent

handleDropOnFolder()method 
protected function handleDropOnFolder(folder:IAttachment, event:DragEvent):IList

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Handles drop on a folder. Changes the parent to point to the new location.

Parameters

folder:IAttachment — The folder to which the items are being moved to or added to.
 
event:DragEvent — The drag event associated with this drop.

Returns
IList — The ordered list of items in the given folder
handleFocusChange()method 
protected function handleFocusChange(event:CollectionManagerEvent):void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Triggers generation of thumbnails around the new focus card.

Parameters

event:CollectionManagerEvent

handleSelectionChanged()method 
protected function handleSelectionChanged():void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Updates the host's selection based on the current list selection.

initializeSelectionFromHost()method 
protected function initializeSelectionFromHost():Boolean

Returns
Boolean
keyDownHandler()method 
override protected function keyDownHandler(event:KeyboardEvent):void

Parameters

event:KeyboardEvent

makeNewOrderedList()method 
protected function makeNewOrderedList(dropIndex:int, droppingItems:ArrayCollection):IList

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Creates an ordered list of items in the dataProvider after the drop.

Parameters

dropIndex:int — The destination index where the items are being dropped to.
 
droppingItems:ArrayCollection — The items being droppped.

Returns
IList — An ordered list of the items in the data Provider.
onChildrenCollectionChange()method 
protected function onChildrenCollectionChange(event:CollectionEvent):void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

This function is used when attachments are moved across folders. Once the parent of all attachments point to the new location, and the attachment has been added to the new collection, the attachments are sent for reordering.

Parameters

event:CollectionEvent

onCollectionChange()method 
protected function onCollectionChange(e:CollectionEvent):void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Listener to handle collection change events.

Parameters

e:CollectionEvent

onCreationComplete()method 
protected function onCreationComplete(event:FlexEvent):void

Parameters

event:FlexEvent

onIndexChangeEvent()method 
protected function onIndexChangeEvent(event:IndexChangeEvent):void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

This listener is called when the selection changes based on user interaction, or when setSelectedIndexWithChangeDispatch or setSelectedIndicesWithChangeDispatch is used to set the selection.

Parameters

event:IndexChangeEvent

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

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Listener to handle events from the Collection Manager.

Parameters

event:CollectionManagerEvent

onOpenFolderTimeComplete()method 
protected function onOpenFolderTimeComplete(evt:TimerEvent):void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Called when the openFolderTimer completes. The current folder is now changed to the cached toChangeFolder during an ongoing drag.

Parameters

evt:TimerEvent

onResize()method 
protected function onResize(event:ResizeEvent):void

Parameters

event:ResizeEvent

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

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Listener to handle scroll events of the scroller on cardLists.

Parameters

event:Event

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

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Parameters

partName:String
 
instance:Object

removeListenAndWatch()method 
public function removeListenAndWatch():void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Function to cleanup the event listeners required by miniNav list. This should be called when the component is no longer needed, to prevent memory leaks.

removeListener()method 
protected function removeListener(listener:IEventDispatcher, type:String = null):void

Parameters

listener:IEventDispatcher
 
type:String (default = null)

reorderAttachments()method 
protected function reorderAttachments(source:IList):Boolean

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Sends the reorder command once all the attachments are found in the given list. If items were moved between lists, this function may have to be called repetitively until it returns true to ensure all items have been successfully moved and the reorder command has been sent.

Parameters

source:IList — An ordered list of items in the dataProvider.

Returns
Boolean — True if all items are found in the given list and the reorder command was sent successfully.
resizeCachedThumbs()method 
protected function resizeCachedThumbs():void

setFocusOnIndexChange()method 
protected function setFocusOnIndexChange(attachment:IAttachment):void

Parameters

attachment:IAttachment

setSelectedIndexWithChangeDispatch()method 
public function setSelectedIndexWithChangeDispatch(value:int):void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Force selection change.

Parameters

value:int — The index to change selection to.

setSelectedIndicesWithChangeDispatch()method 
public function setSelectedIndicesWithChangeDispatch(value:Vector.<int>):void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Force selection change.

Parameters

value:Vector.<int> — A vector of indices to change selection to.

updateRenderer()method 
override public function updateRenderer(renderer:IVisualElement, itemIndex:int, data:Object):void

Parameters

renderer:IVisualElement
 
itemIndex:int
 
data:Object

updateSelection()method 
protected function updateSelection():void

Constant Detail
collectionMgrConstant
public const collectionMgr:CollectionManager

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

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

DRAG_DROP_ATTACHMENTSConstant 
public static const DRAG_DROP_ATTACHMENTS:String = attachments

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Format that defines the set of Acrobat drag and drop attachments.

DRAG_DROP_ITEMSConstant 
public static const DRAG_DROP_ITEMS:String = itemsByIndex

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Format that defines the default set of List drag and drop items.