Package muntjac :: Package event :: Package dd :: Module drop_target
[hide private]
[frames] | no frames]

Source Code for Module muntjac.event.dd.drop_target

 1  # Copyright (C) 2012 Vaadin Ltd.  
 2  # Copyright (C) 2012 Richard Lincoln 
 3  #  
 4  # Licensed under the Apache License, Version 2.0 (the "License");  
 5  # you may not use this file except in compliance with the License.  
 6  # You may obtain a copy of the License at  
 7  #  
 8  #     http://www.apache.org/licenses/LICENSE-2.0  
 9  #  
10  # Unless required by applicable law or agreed to in writing, software  
11  # distributed under the License is distributed on an "AS IS" BASIS,  
12  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
13  # See the License for the specific language governing permissions and  
14  # limitations under the License. 
15   
16  """An interface for components supporting drop operations.""" 
17   
18  from muntjac.ui.component import IComponent 
19   
20   
21 -class IDropTarget(IComponent):
22 """IDropTarget is an interface for components supporting drop operations. A 23 component that wants to receive drop events should implement this interface 24 and provide a L{DropHandler} which will handle the actual drop event. 25 """ 26
27 - def getDropHandler(self):
28 """@return: the drop handler that will receive the dragged data or null 29 if drops are not currently accepted 30 """ 31 raise NotImplementedError
32 33
34 - def translateDropTargetDetails(self, clientVariables):
35 """Called before the L{DragAndDropEvent} is passed to 36 L{DropHandler}. Implementation may for example translate the drop 37 target details provided by the client side (drop target) to meaningful 38 server side values. If null is returned the terminal implementation 39 will automatically create a L{TargetDetails} with raw client side data. 40 41 @see: DragSource#getTransferable(Map) 42 43 @param clientVariables: 44 data passed from the DropTargets client side counterpart. 45 @return: A DropTargetDetails object with the translated data or null to 46 use a default implementation. 47 """ 48 raise NotImplementedError
49