1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """A criterion that checks whether Transferable contains given data
17 flavor."""
18
19 from muntjac.event.dd.acceptcriteria.client_side_criterion import \
20 ClientSideCriterion
21
22
24 """A Criterion that checks whether L{Transferable} contains given data
25 flavor. The developer might for example accept the incoming data only
26 if it contains "Url" or "Text".
27 """
28
30 """Constructs a new instance of L{ContainsDataFlavor}.
31
32 @param dataFlavor:
33 the type of data that will be checked from
34 L{Transferable}
35 """
36 self._dataFlavorId = dataFlavor
37
38
39 - def paintContent(self, target):
40 super(ContainsDataFlavor, self).paintContent(target)
41 target.addAttribute('p', self._dataFlavorId)
42
43
47
48
50
51 return 'com.vaadin.event.dd.acceptcriteria.ContainsDataFlavor'
52