Package muntjac :: Package event :: Package dd :: Package acceptcriteria :: Module contains_data_flavor :: Class ContainsDataFlavor
[hide private]
[frames] | no frames]

Class ContainsDataFlavor

source code

                           object --+        
                                    |        
    accept_criterion.IAcceptCriterion --+    
                                        |    
client_side_criterion.ClientSideCriterion --+
                                            |
                                           ContainsDataFlavor

A Criterion that checks whether Transferable contains given data flavor. The developer might for example accept the incoming data only if it contains "Url" or "Text".

Instance Methods [hide private]
 
__init__(self, dataFlavor)
Constructs a new instance of ContainsDataFlavor.
source code
 
paintContent(self, target) source code
 
accept(self, dragEvent)
Validates the data in event to be appropriate for the DropHandler.drop method.
source code
 
getIdentifier(self) source code

Inherited from client_side_criterion.ClientSideCriterion: isClientSideVerifiable, paint, paintResponse

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, dataFlavor)
(Constructor)

source code 

Constructs a new instance of ContainsDataFlavor.

Parameters:
  • dataFlavor - the type of data that will be checked from Transferable
Overrides: object.__init__

paintContent(self, target)

source code 
Overrides: client_side_criterion.ClientSideCriterion.paintContent

accept(self, dragEvent)

source code 

Validates the data in event to be appropriate for the DropHandler.drop method.

Note that even if your criterion is validated on client side, you should always validate the data on server side too.

Overrides: accept_criterion.IAcceptCriterion.accept
(inherited documentation)

getIdentifier(self)

source code 
Overrides: client_side_criterion.ClientSideCriterion.getIdentifier