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

Source Code for Module muntjac.event.dd.drag_and_drop_event

 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  """Wraps information related to drag and drop operation.""" 
17   
18   
19 -class DragAndDropEvent(object):
20 """DragAndDropEvent wraps information related to drag and drop operation. 21 It is passed by terminal implementation for L{DropHandler.drop} and 22 L{AcceptCriterion.accept} methods. 23 24 DragAndDropEvent instances contains both the dragged data in 25 L{Transferable} (generated by L{DragSource} and details 26 about the current drop event in L{TargetDetails} (generated by 27 L{DropTarget}. 28 """ 29
30 - def __init__(self, transferable, dropTargetDetails):
31 self._transferable = transferable 32 self._dropTargetDetails = dropTargetDetails
33 34
35 - def getTransferable(self):
36 """@return: the Transferable instance representing the data dragged 37 in this drag and drop event 38 """ 39 return self._transferable
40 41
42 - def getTargetDetails(self):
43 """@return: the TargetDetails containing drop target related details 44 of drag and drop operation 45 """ 46 return self._dropTargetDetails
47