com.vaadin.ui.
Class Tree.TargetInSubtree
- java.lang.Object
-
- com.vaadin.event.dd.acceptcriteria.ClientSideCriterion
-
- com.vaadin.ui.Tree.TargetInSubtree
-
All Implemented Interfaces:
Enclosing class:
public class Tree.TargetInSubtree extends ClientSideCriterion
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.
See Also:
-
-
Constructor Summary
Constructors Constructor and Description TargetInSubtree(Object parentItemId)
Constructs a criteria that accepts the drag if the targeted Item is a descendant of Item identified by given id
TargetInSubtree(Object rootId, int depthToCheck)
Constructs a criteria that accepts drops within given level below the subtree root identified by given id.
-
Method Summary
All Methods Modifier and Type Method and Description boolean
accept(DragAndDropEvent dragEvent)
Validates the data in event to be appropriate for the
DropHandler.drop(DragAndDropEvent)
method.void
paintContent(PaintTarget target)
-
Methods inherited from class com.vaadin.event.dd.acceptcriteria.ClientSideCriterion
getIdentifier, isClientSideVerifiable, paint, paintResponse
-
-
-
-
Constructor Detail
-
TargetInSubtree
public TargetInSubtree(Object parentItemId)
Constructs a criteria that accepts the drag if the targeted Item is a descendant of Item identified by given id
Parameters:
parentItemId
- the item identifier of the parent node
-
TargetInSubtree
public TargetInSubtree(Object rootId, int depthToCheck)
Constructs a criteria that accepts drops within given level below the subtree root identified by given id.
Parameters:
rootId
- the item identifier to be sought fordepthToCheck
- the depth that tree is traversed upwards to seek for the parent, -1 means that the whole structure should be checked
-
-
Method Detail
-
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:
-
paintContent
public void paintContent(PaintTarget target) throws PaintException
Overrides:
paintContent
in classClientSideCriterion
Throws:
-
-