public class Tree.TargetInSubtree extends ClientSideCriterion
The root items is also consider to be valid target.
| 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.
|
| 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) |
getIdentifier, isClientSideVerifiable, paint, paintResponsepublic TargetInSubtree(Object parentItemId)
parentItemId - the item identifier of the parent nodepublic TargetInSubtree(Object rootId, int depthToCheck)
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
checkedpublic boolean accept(DragAndDropEvent dragEvent)
AcceptCriterionDropHandler.drop(DragAndDropEvent) method.
Note that even if your criterion is validated on client side, you should always validate the data on server side too.
public void paintContent(PaintTarget target) throws PaintException
paintContent in class ClientSideCriterionPaintExceptionCopyright © 2022 Vaadin Ltd. All rights reserved.