Introducing the Drag and Drop Manager


The first step in understanding the Drag and Drop Manager is to learn the terminology surrounding it. The terminology is summarized in the following table.

Term

Definition

Drag initiator

Component or item from a component being dragged from

Drag source

Data being dragged

Format

Property of the DragSource that allows an object to be dropped, or not, on another object; the data in the DragSource is also associated with the format; the data type of the formats are simple strings

Drag proxy

Image displayed during the dragging process

Drop target

Component the drag proxy is over


The following figure gives you a visual representation of the terminology:

There are three phases to a drag-and-drop operation:

  1. Initiating: A user clicks a Flex component or an item in a Flex component and then begins to move the component or item while holding down the mouse. The component or item is the drag initiator.

  2. Dragging: While holding down the mouse button, the user moves the mouse around the screen. Flex displays an image called a drag proxy, and the associated nonvisual object called the drag source holds the data associated with the component or item being dragged.

  3. Dropping: When the user moves over another component that will allow it, the item can be dropped onto a drop target. The data is then inserted into the new component in some way.

Flex components fall into two groups when it comes to drag-and-drop support, those with enhanced drag-and-drop functionality and those without it. The following list-based controls have enhanced support for drag and drop:

  • DataGrid

  • PrintDataGrid

  • Tree

  • Menu

  • List

  • HorizontalList

  • TileList

What this means to you as a developer is that your life will be a little bit easier when implementing drag and drop with those controls that have enhanced support. In fact, in many cases it might be no more than setting a single property value for each of the controls involved in the drag-and-drop operation.




Adobe Flex 2.Training from the Source
Adobe Flex 2: Training from the Source
ISBN: 032142316X
EAN: 2147483647
Year: 2006
Pages: 225

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net