Package muntjac :: Package ui :: Module tree :: Class TargetInSubtree
[hide private]
[frames] | no frames]

Class TargetInSubtree

source code

                                                   object --+        
                                                            |        
    event.dd.acceptcriteria.accept_criterion.IAcceptCriterion --+    
                                                                |    
event.dd.acceptcriteria.client_side_criterion.ClientSideCriterion --+
                                                                    |
                                                                   TargetInSubtree

An accept criterion that checks the parent node (or parent hierarchy) for the item identifier given in constructor. If the parent is found, content is accepted. Criterion can be used to accepts drags on a specific sub tree only.

The root items is also consider to be valid target.

Instance Methods [hide private]
 
__init__(self, rootId, depthToCheck=None)
Constructs a criteria that accepts the drag if the targeted Item is a descendant of Item identified by given id
source code
 
accept(self, dragEvent)
Validates the data in event to be appropriate for the DropHandler.drop method.
source code
 
paintContent(self, target) source code

Inherited from event.dd.acceptcriteria.client_side_criterion.ClientSideCriterion: getIdentifier, 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, rootId, depthToCheck=None)
(Constructor)

source code 

Constructs a criteria that accepts the drag if the targeted Item is a descendant of Item identified by given id

Alternatively, constructs a criteria that accepts drops within given level below the subtree root identified by given id.

Parameters:
  • rootId - the item identifier of the parent node or the node to be sought for
  • depthToCheck - the depth that tree is traversed upwards to seek for the parent, -1 means that the whole structure should be checked
Overrides: object.__init__

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: event.dd.acceptcriteria.accept_criterion.IAcceptCriterion.accept
(inherited documentation)

paintContent(self, target)

source code 
Overrides: event.dd.acceptcriteria.client_side_criterion.ClientSideCriterion.paintContent