com.vaadin.ui.
Class Tree.TreeDropCriterion
- java.lang.Object
-
- com.vaadin.event.dd.acceptcriteria.ServerSideCriterion
-
- com.vaadin.ui.Tree.TreeDropCriterion
-
All Implemented Interfaces:
Enclosing class:
public abstract static class Tree.TreeDropCriterion extends ServerSideCriterion
Lazy loading accept criterion for Tree. Accepted target nodes are loaded from server once per drag and drop operation. Developer must override one method that decides accepted tree nodes for the whole Tree.
Initially pretty much no data is sent to client. On first required criterion check (per drag request) the client side data structure is initialized from server and no subsequent requests requests are needed during that drag and drop operation.
See Also:
-
-
Constructor Summary
Constructors Constructor and Description TreeDropCriterion()
-
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.protected abstract Set<Object>
getAllowedItemIds(DragAndDropEvent dragEvent, Tree tree)
protected String
getIdentifier()
void
paintResponse(PaintTarget target)
This needs to be implemented iff criterion does some lazy server side initialization.
-
Methods inherited from class com.vaadin.event.dd.acceptcriteria.ServerSideCriterion
isClientSideVerifiable, paint, paintContent
-
-
-
-
Method Detail
-
getIdentifier
protected String getIdentifier()
Overrides:
getIdentifier
in classServerSideCriterion
-
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:
-
paintResponse
public void paintResponse(PaintTarget target) throws PaintException
Description copied from interface:
AcceptCriterion
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
AcceptCriterion.accept(DragAndDropEvent)
is called before this method.Specified by:
paintResponse
in interfaceAcceptCriterion
Overrides:
paintResponse
in classServerSideCriterion
Throws:
-
getAllowedItemIds
protected abstract Set<Object> getAllowedItemIds(DragAndDropEvent dragEvent, Tree tree)
-
-