Package muntjac :: Package ui :: Module drag_and_drop_wrapper :: Class DragAndDropWrapper
[hide private]
[frames] | no frames]

Class DragAndDropWrapper

source code

                             object --+                        
                                      |                        
                    util.IEventListener --+                    
                                          |                    
              terminal.paintable.IPaintable --+                
                                              |                
                                 object --+   |                
                                          |   |                
     terminal.variable_owner.IVariableOwner --+                
                                              |                
                                 object --+   |                
                                          |   |                
                terminal.sizeable.ISizeable --+                
                                              |                
                           component.IComponent --+            
                                                  |            
                                     object --+   |            
                                              |   |            
   event.method_event_source.IMethodEventSource --+            
                                                  |            
               abstract_component.AbstractComponent --+        
                                                      |        
                             object --+               |        
                                      |               |        
                    util.IEventListener --+           |        
                                          |           |        
              terminal.paintable.IPaintable --+       |        
                                              |       |        
                                 object --+   |       |        
                                          |   |       |        
     terminal.variable_owner.IVariableOwner --+       |        
                                              |       |        
                                 object --+   |       |        
                                          |   |       |        
                terminal.sizeable.ISizeable --+       |        
                                              |       |        
                           component.IComponent --+   |        
                                                  |   |        
            component_container.IComponentContainer --+        
                                                      |        
abstract_component_container.AbstractComponentContainer --+    
                                                          |    
                           custom_component.CustomComponent --+
                                                              |
                                     object --+               |
                                              |               |
                            util.IEventListener --+           |
                                                  |           |
                      terminal.paintable.IPaintable --+       |
                                                      |       |
                                         object --+   |       |
                                                  |   |       |
             terminal.variable_owner.IVariableOwner --+       |
                                                      |       |
                                         object --+   |       |
                                                  |   |       |
                        terminal.sizeable.ISizeable --+       |
                                                      |       |
                                   component.IComponent --+   |
                                                          |   |
                           event.dd.drop_target.IDropTarget --+
                                                              |
                                     object --+               |
                                              |               |
                            util.IEventListener --+           |
                                                  |           |
                      terminal.paintable.IPaintable --+       |
                                                      |       |
                                         object --+   |       |
                                                  |   |       |
             terminal.variable_owner.IVariableOwner --+       |
                                                      |       |
                                         object --+   |       |
                                                  |   |       |
                        terminal.sizeable.ISizeable --+       |
                                                      |       |
                                   component.IComponent --+   |
                                                          |   |
                           event.dd.drag_source.IDragSource --+
                                                              |
                                                             DragAndDropWrapper

Instance Methods [hide private]
 
__init__(self, root)
Wraps given component in a DragAndDropWrapper.
source code
 
paintContent(self, target)
Paints any needed component-specific things to the given UIDL stream.
source code
 
getDropHandler(self)
Returns: the drop handler that will receive the dragged data or null if drops are not currently accepted
source code
 
setDropHandler(self, dropHandler) source code
 
translateDropTargetDetails(self, clientVariables)
Called before the DragAndDropEvent is passed to DropHandler.
source code
 
getTransferable(self, rawVariables)
IDragSource may convert data added by client side component to meaningful values for server side developer or add other data based on it.
source code
 
setDragStartMode(self, dragStartMode) source code
 
getDragStartMode(self) source code

Inherited from custom_component.CustomComponent: addComponent, getComponentCount, getComponentIterator, getComponentType, getCompositionRoot, moveComponentsFrom, removeAllComponents, removeComponent, replaceComponent, setComponentType, setCompositionRoot

Inherited from abstract_component_container.AbstractComponentContainer: addCallback, addListener, attach, detach, fireComponentAttachEvent, fireComponentDetachEvent, getInvalidSizedChildren, removeCallback, removeListener, repaintChangedChildTrees, repaintChildTrees, requestRepaintAll, setEnabled, setHeight, setWidth

Inherited from abstract_component.AbstractComponent: __getstate__, __setstate__, addStyleName, changeVariables, childRequestedRepaint, fireComponentErrorEvent, fireComponentEvent, fireEvent, fireRequestRepaintEvent, focus, getApplication, getCSSHeight, getCSSWidth, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getErrorMessage, getHeight, getHeightUnits, getIcon, getListeners, getLocale, getParent, getStyle, getStyleName, getWidth, getWidthUnits, getWindow, handleError, hasListeners, isEnabled, isImmediate, isReadOnly, isVisible, paint, parseStringSize, registerCallback, registerListener, removeStyleName, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setErrorHandler, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setReadOnly, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, setWidthUnits, withdrawCallback, withdrawListener

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

Class Variables [hide private]
  CLIENT_WIDGET = None
hash(x)

Inherited from abstract_component.AbstractComponent: SIZE_PATTERN

Inherited from terminal.sizeable.ISizeable: SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS, UNIT_SYMBOLS

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, root)
(Constructor)

source code 

Wraps given component in a DragAndDropWrapper.

Parameters:
  • root - the component to be wrapped
Overrides: object.__init__

paintContent(self, target)

source code 

Paints any needed component-specific things to the given UIDL stream. The more general paint method handles all general attributes common to all components, and it calls this method to paint any component-specific attributes to the UIDL stream.

Parameters:
  • target - the target UIDL stream where the component should paint itself to
Raises:
Overrides: abstract_component.AbstractComponent.paintContent
(inherited documentation)

getDropHandler(self)

source code 
Returns:
the drop handler that will receive the dragged data or null if drops are not currently accepted
Overrides: event.dd.drop_target.IDropTarget.getDropHandler
(inherited documentation)

translateDropTargetDetails(self, clientVariables)

source code 

Called before the DragAndDropEvent is passed to DropHandler. Implementation may for example translate the drop target details provided by the client side (drop target) to meaningful server side values. If null is returned the terminal implementation will automatically create a TargetDetails with raw client side data.

Parameters:
  • clientVariables - data passed from the DropTargets client side counterpart.
Returns:
A DropTargetDetails object with the translated data or null to use a default implementation.
Overrides: event.dd.drop_target.IDropTarget.translateDropTargetDetails
(inherited documentation)

getTransferable(self, rawVariables)

source code 

IDragSource may convert data added by client side component to meaningful values for server side developer or add other data based on it.

For example Tree converts item identifiers to generated string keys for the client side. Muntjac developer don't and can't know anything about these generated keys, only about item identifiers. When tree node is dragged client puts that key to Transferables client side counterpart. In Tree.getTransferable the key is converted back to item identifier that the server side developer can use.

Parameters:
  • rawVariables - the data that client side initially included in Transferables client side counterpart.
Returns:
the Transferable instance that will be passed to DropHandler (and/or AcceptCriterion)
Overrides: event.dd.drag_source.IDragSource.getTransferable
(inherited documentation)