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

NameTypegetsetDescripton
actionStringcheckedcheckedThe desired action to use for the drag and drop session
destinationBiComponentcheckedThe drop target
dragIconoComp : BiComponent The component to showcheckedcheckedThe 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
dropDataTypesString[]checkedThe intersection of the supported data types by the drop target and the drag and drop session
sourceBiComponentcheckedThe component that started the drag and drop session
validDragButtonsNumber []checkedThe 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

NameDescription
addActionAdds a supported action. Valid values are

copy
alias
move
addDataAdds data with the given type
cancelDragEnds the current drag and drop session and fires dragend on the source
clearActionsClears the supported action.
clearDataClears the data associated with the drag and drop session
getDataReturns the data for the given type
getDropTargetGets first component that can support the data type.
handleKeyboardEventCalled by the event manager when a keyboard event occurs
handleKeyDownThis is called by the event system when a keydown event occurs
handleKeyUpThis is called by the event system when a keyup event occurs
handleMouseDownThis is called by the event system when a mousedown event occurs
handleMouseEventCalled by the event manager when a mouse event occurs
handleMouseMoveThis is called by the event system when a mousemove event occurs
handleMouseUpThis is called by the event system when a mouseup event occurs
removeActionRemoves an action.
startDragThis initiates the drag and drop session and can only be called during a dragstart event
supportsDropTests that the component supports the data type

Events

None.

Static Methods

None.

Static Fields

NameTypeDescripton
ALIAS_ICONBiImageThe image to use as the alias icon
COPY_ICONBiImageThe image to use as the copy icon
MOVE_ICONBiImageThe image to use as the move icon
NO_DROP_ICONBiImageThe 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

NameTypeOptionalDefaultDescripton
sActionStringThe action to add support for

Return Type

void

addData

Adds data with the given type

Syntax

object.addData ( sType,oData )

Parameters

NameTypeOptionalDefaultDescripton
sTypeStringA string identifying the type of the data
oDataObejctThe 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

NameTypeOptionalDefaultDescripton
eBiMouseEventThe 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

NameTypeOptionalDefaultDescripton
sTypeStringThe string identifying the data

Return Type

Object

getDropTarget

Gets first component that can support the data type.

Syntax

object.getDropTarget ( e )

Parameters

NameTypeOptionalDefaultDescripton
eBiMouseEventThe mouse event used

Return Type

BiComponent

handleKeyboardEvent

Called by the event manager when a keyboard event occurs

Syntax

object.handleKeyboardEvent ( e )

Parameters

NameTypeOptionalDefaultDescripton
eBiKeyboardEventThe 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

NameTypeOptionalDefaultDescripton
eBiKeyboardEventThe 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

NameTypeOptionalDefaultDescripton
eBiKeyboardEventThe 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

NameTypeOptionalDefaultDescripton
eBiMouseEventThe 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

NameTypeOptionalDefaultDescripton
eBiMouseEventThe 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

NameTypeOptionalDefaultDescripton
eBiMouseEventThe 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

NameTypeOptionalDefaultDescripton
eBiMouseEventThe event in use for the mouseup event

Return Type

void

removeAction

Removes an action.

Syntax

object.removeAction ( sAction )

Parameters

NameTypeOptionalDefaultDescripton
sActionStringThe 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

NameTypeOptionalDefaultDescripton
oComponentBiComponentThe component to test whether a drop can be done on it

Return Type

Boolean