Package library :: Package pyjamas :: Package ui :: Module DropHandler :: Class DropHandler
[hide private]
[frames] | no frames]

Class DropHandler

source code

object --+
         |
        DropHandler

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
onBrowserEvent(self, event) source code
 
addDropListener(self, listener) source code
 
removeDropListener(self, listener) source code
 
onDragEnter(self, event)
Decide whether to accept the drop.
source code
 
onDragOver(self, event)
This event determines what feedback is to be shown to the user.
source code
 
onDragLeave(self, event)
This event happens when the mouse leaves the target element.
source code
 
onDrop(self, event)
allows the actual drop to be performed.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

onDragEnter(self, event)

source code 

Decide whether to accept the drop.

You may inspect the event's dataTransfer member.

You may get the types using pyjamas.dnd.getTypes(event).

This event is used to determine whether the drop target may accept the drop. If the drop is to be accepted, then this event has to be canceled using DOM.eventPreventDefault(event).

onDragOver(self, event)

source code 

This event determines what feedback is to be shown to the user. If the event is canceled, then the feedback (typically the cursor) is updated based on the dropEffect attribute's value, as set by the event handler; otherwise, the default behavior (typically to do nothing) is used instead.

Setting event.dataTransfer.dropEffect may affect dropping behavior.

Cancel this event with DOM.eventPreventDefault(event) if you want the drop to succeed.

onDrop(self, event)

source code 

allows the actual drop to be performed. This event also needs to be canceled, so that the dropEffect attribute's value can be used by the source (otherwise it's reset).