BiDragAndDropManager
This class is used to manage the drag and drop system
This class extends BiObject and therefore all methods and fields available for BiObject are also available for BiDragAndDropManager .
Constructor
new BiDragAndDropManager ( )
Parameters
No parameters.
Properties
| Name | Type | get | set | Descripton |
action | String | ![]() | ![]() | The desired action to use for the drag and drop session |
destination | | ![]() | The drop target | |
dragIcon | oComp : BiComponent The component to show | ![]() | ![]() | The component to use as the icon next to the cursor when doing drag and drop. When this is set to null images are shown that represents the action |
dropDataTypes | String[] | ![]() | The intersection of the supported data types by the drop target and the drag and drop session | |
source | | ![]() | The component that started the drag and drop session | |
validDragButtons | Number [] | ![]() | The valid mouse buttons triggering drag and drop events. This array should contain valid mouse buttons codes. Code names are available at BiMouseEvent@default [BiMouseEvent.LEFT] |
Methods
| Name | Description |
addAction | Adds a supported action. Valid values are copy alias move |
addData | Adds data with the given type |
cancelDrag | Ends the current drag and drop session and fires dragend on the source |
clearActions | Clears the supported action. |
clearData | Clears the data associated with the drag and drop session |
getData | Returns the data for the given type |
getDropTarget | Gets first component that can support the data type. |
handleKeyboardEvent | Called by the event manager when a keyboard event occurs |
handleKeyDown | This is called by the event system when a keydown event occurs |
handleKeyUp | This is called by the event system when a keyup event occurs |
handleMouseDown | This is called by the event system when a mousedown event occurs |
handleMouseEvent | Called by the event manager when a mouse event occurs |
handleMouseMove | This is called by the event system when a mousemove event occurs |
handleMouseUp | This is called by the event system when a mouseup event occurs |
removeAction | Removes an action. |
startDrag | This initiates the drag and drop session and can only be called during a dragstart event |
supportsDrop | Tests that the component supports the data type |
Events
None.
Static Methods
None.
Static Fields
| Name | Type | Descripton |
ALIAS_ICON | | The image to use as the alias icon |
COPY_ICON | | The image to use as the copy icon |
MOVE_ICON | | The image to use as the move icon |
NO_DROP_ICON | | The image to use as the no drop icon |
Remarks
None.
Method Details
addAction
Adds a supported action. Valid values are
copy
alias
move
Syntax
object.addAction ( sAction ) Parameters
| Name | Type | Optional | Default | Descripton |
sAction | String | The action to add support for |
Return Type
void
addData
Adds data with the given type
Syntax
object.addData ( sType,oData ) Parameters
| Name | Type | Optional | Default | Descripton |
sType | String | A string identifying the type of the data | ||
oData | Obejct | The data to ue |
Return Type
void
cancelDrag
Ends the current drag and drop session and fires dragend on the source
Syntax
object.cancelDrag ( e ) Parameters
| Name | Type | Optional | Default | Descripton |
e | | The event that caused this to be canceled |
Return Type
void
clearActions
Clears the supported action.
Syntax
object.clearActions ( ) Parameters
No arguments.
Return Type
void
clearData
Clears the data associated with the drag and drop session
Syntax
object.clearData ( ) Parameters
No arguments.
Return Type
void
getData
Returns the data for the given type
Syntax
object.getData ( sType ) Parameters
| Name | Type | Optional | Default | Descripton |
sType | String | The string identifying the data |
Return Type
Object
getDropTarget
Gets first component that can support the data type.
Syntax
object.getDropTarget ( e ) Parameters
| Name | Type | Optional | Default | Descripton |
e | | The mouse event used |
Return Type
handleKeyboardEvent
Called by the event manager when a keyboard event occurs
Syntax
object.handleKeyboardEvent ( e ) Parameters
| Name | Type | Optional | Default | Descripton |
e | | The keyboard event in use |
Return Type
void
handleKeyDown
This is called by the event system when a keydown event occurs
Syntax
object.handleKeyDown ( e ) Parameters
| Name | Type | Optional | Default | Descripton |
e | | The event in use for the keydown event |
Return Type
void
handleKeyUp
This is called by the event system when a keyup event occurs
Syntax
object.handleKeyUp ( e ) Parameters
| Name | Type | Optional | Default | Descripton |
e | | The event in use for the keyup event |
Return Type
void
handleMouseDown
This is called by the event system when a mousedown event occurs
Syntax
object.handleMouseDown ( e ) Parameters
| Name | Type | Optional | Default | Descripton |
e | | The event in use when the mousedown event |
Return Type
void
handleMouseEvent
Called by the event manager when a mouse event occurs
Syntax
object.handleMouseEvent ( e ) Parameters
| Name | Type | Optional | Default | Descripton |
e | | The mouse event in use |
Return Type
void
handleMouseMove
This is called by the event system when a mousemove event occurs
Syntax
object.handleMouseMove ( e ) Parameters
| Name | Type | Optional | Default | Descripton |
e | | The event in use for the mousemove event |
Return Type
void
handleMouseUp
This is called by the event system when a mouseup event occurs
Syntax
object.handleMouseUp ( e ) Parameters
| Name | Type | Optional | Default | Descripton |
e | | The event in use for the mouseup event |
Return Type
void
removeAction
Removes an action.
Syntax
object.removeAction ( sAction ) Parameters
| Name | Type | Optional | Default | Descripton |
sAction | String | The action to no longer support |
Return Type
void
startDrag
This initiates the drag and drop session and can only be called during a dragstart event
Syntax
object.startDrag ( ) Parameters
No arguments.
Return Type
void
supportsDrop
Tests that the component supports the data type
Syntax
object.supportsDrop ( oComponent ) Parameters
| Name | Type | Optional | Default | Descripton |
oComponent | | The component to test whether a drop can be done on it |
Return Type
Boolean
