1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """A IComponent that builds a ITransferable for a drag and drop operation."""
17
18 from muntjac.ui.component import IComponent
19
20
22 """IDragSource is a L{IComponent} that builds a L{Transferable} for a
23 drag and drop operation.
24
25 In Muntjac the drag and drop operation practically starts from client side
26 component. The client side component initially defines the data that will
27 be present in L{Transferable} object on server side. If the server side
28 counterpart of the component implements this interface, terminal
29 implementation lets it create the L{Transferable} instance from the raw
30 client side "seed data". This way server side implementation may translate
31 or extend the data that will be available for L{DropHandler}.
32 """
33
35 """IDragSource may convert data added by client side component to
36 meaningful values for server side developer or add other data based
37 on it.
38
39 For example Tree converts item identifiers to generated string keys for
40 the client side. Muntjac developer don't and can't know anything about
41 these generated keys, only about item identifiers. When tree node is
42 dragged client puts that key to L{Transferable}s client side
43 counterpart. In L{Tree.getTransferable} the key is converted
44 back to item identifier that the server side developer can use.
45
46 @param rawVariables:
47 the data that client side initially included in
48 L{Transferable}s client side counterpart.
49 @return: the L{Transferable} instance that will be passed to
50 L{DropHandler} (and/or L{AcceptCriterion})
51 """
52 raise NotImplementedError
53