Package muntjac :: Package event :: Package dd :: Package acceptcriteria :: Module accept_criterion :: Class IAcceptCriterion
[hide private]
[frames] | no frames]

Class IAcceptCriterion

source code

object --+
         |
        IAcceptCriterion
Known Subclasses:

Criterion that can be used create policy to accept/discard dragged content (presented by Transferable).

The drag and drop mechanism will verify the criteria returned by DropHandler.getAcceptCriterion before calling DropHandler.drop.

The criteria can be evaluated either on the client (browser - see ClientSideCriterion) or on the server (see ServerSideCriterion). If no constraints are needed, an AcceptAll can be used.

In addition to accepting or rejecting a possible drop, criteria can provide additional hints for client side painting.


See Also:
DropHandler, ClientSideCriterion, ServerSideCriterion
Instance Methods [hide private]
 
isClientSideVerifiable(self)
Returns whether the criteria can be checked on the client or whether a server request is needed to check the criteria.
source code
 
paint(self, target) source code
 
paintResponse(self, target)
This needs to be implemented iff criterion does some lazy server side initialization.
source code
 
accept(self, dragEvent)
Validates the data in event to be appropriate for the DropHandler.drop method.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

isClientSideVerifiable(self)

source code 

Returns whether the criteria can be checked on the client or whether a server request is needed to check the criteria.

This requirement may depend on the state of the criterion (e.g. logical operations between criteria), so this cannot be based on a marker interface.

paintResponse(self, target)

source code 

This needs to be implemented iff criterion does some lazy server side initialization. The UIDL painted in this method will be passed to client side drop handler implementation. Implementation can assume that accept is called before this method.

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.