com.vaadin.event.dd.acceptcriteria
Class TargetDetailIs

java.lang.Object
  extended by com.vaadin.event.dd.acceptcriteria.ClientSideCriterion
      extended by com.vaadin.event.dd.acceptcriteria.TargetDetailIs
All Implemented Interfaces:
AcceptCriterion, Serializable
Direct Known Subclasses:
AbstractSelect.VerticalLocationIs, Tree.TargetItemAllowsChildren

public class TargetDetailIs
extends ClientSideCriterion

Criterion for checking if drop target details contains the specific property with the specific value. Currently only String values are supported.

Since:
6.3 TODO add support for other basic data types that we support in UIDL.
See Also:
Serialized Form

Constructor Summary
TargetDetailIs(String dataFlavor, Boolean true1)
           
TargetDetailIs(String dataFlavor, String value)
          Constructs a criterion which ensures that the value there is a value in TargetDetails that equals the reference value.
 
Method Summary
 boolean accept(DragAndDropEvent dragEvent)
          Validates the data in event to be appropriate for the DropHandler.drop(DragAndDropEvent) method.
protected  String getIdentifier()
           
 void paintContent(PaintTarget target)
           
 
Methods inherited from class com.vaadin.event.dd.acceptcriteria.ClientSideCriterion
isClientSideVerifiable, paint, paintResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TargetDetailIs

public TargetDetailIs(String dataFlavor,
                      String value)
Constructs a criterion which ensures that the value there is a value in TargetDetails that equals the reference value.

Parameters:
dataFlavor - the type of data to be checked
value - the reference value to which the drop target detail will be compared

TargetDetailIs

public TargetDetailIs(String dataFlavor,
                      Boolean true1)
Method Detail

paintContent

public void paintContent(PaintTarget target)
                  throws PaintException
Overrides:
paintContent in class ClientSideCriterion
Throws:
PaintException

accept

public boolean accept(DragAndDropEvent dragEvent)
Description copied from interface: AcceptCriterion
Validates the data in event to be appropriate for the DropHandler.drop(DragAndDropEvent) method.

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

Returns:

getIdentifier

protected String getIdentifier()
Overrides:
getIdentifier in class ClientSideCriterion


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.