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 checked checked The desired action to use for the drag and drop session
destination BiComponent checked The drop target
dragIcon oComp : BiComponent The component to show checked checked 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[] checked The intersection of the supported data types by the drop target and the drag and drop session
source BiComponent checked The component that started the drag and drop session

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 BiImage The image to use as the alias icon
COPY_ICON BiImage The image to use as the copy icon
MOVE_ICON BiImage The image to use as the move icon
NO_DROP_ICON BiImage The image to use as the no drop icon

Remarks

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 BiMouseEvent 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 BiMouseEvent The mouse event used

Return Type

BiComponent

handleKeyboardEvent

Called by the event manager when a keyboard event occurs

Syntax

object.handleKeyboardEvent
 (
 e
 )
 

Parameters

Name Type Optional Default Descripton
e BiKeyboardEvent 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 BiKeyboardEvent 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 BiKeyboardEvent 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 BiMouseEvent 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 BiMouseEvent 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 BiMouseEvent 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 BiMouseEvent 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 BiComponent The component to test whether a drop can be done on it

Return Type

Boolean