1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """Contains the actual business logic for drag and drop operations."""
17
18
20 """DropHandlers contain the actual business logic for drag and drop
21 operations.
22
23 The L{drop} method is used to receive the transferred data and the
24 L{getAcceptCriterion} method contains the (possibly client side verifiable)
25 criterion whether the dragged data will be handled at all.
26 """
27
28 - def drop(self, event):
29 """Drop method is called when the end user has finished the drag
30 operation on a L{DropTarget} and L{DragAndDropEvent} has passed
31 L{AcceptCriterion} defined by L{getAcceptCriterion} method. The
32 actual business logic of drag and drop operation is implemented
33 into this method.
34
35 @param event:
36 the event related to this drop
37 """
38 raise NotImplementedError
39
40
42 """Returns the L{AcceptCriterion} used to evaluate whether the
43 L{Transferable} will be handed over to L{IDropHandler.drop} method.
44 If client side can't verify the L{AcceptCriterion}, the same criteria
45 may be tested also prior to actual drop - during the drag operation.
46
47 Based on information from L{AcceptCriterion} components may display
48 some hints for the end user whether the drop will be accepted or not.
49
50 Muntjac contains a variety of criteria built in that can be composed
51 to more complex criterion. If the build in criteria are not enough,
52 developer can use a L{ServerSideCriterion} or build own custom
53 criterion with client side counterpart.
54
55 If developer wants to handle everything in the L{drop} method,
56 L{AcceptAll} instance can be returned.
57
58 @return: the L{AcceptCriterion}
59 """
60 raise NotImplementedError
61