public abstract static class Table.TableDropCriterion extends ServerSideCriterion
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.
Constructor and Description |
---|
TableDropCriterion() |
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,
Table table,
Collection<Object> visibleItemIds) |
protected String |
getIdentifier() |
void |
paintResponse(PaintTarget target)
This needs to be implemented iff criterion does some lazy server side
initialization.
|
isClientSideVerifiable, paint, paintContent
protected String getIdentifier()
getIdentifier
in class ServerSideCriterion
public boolean accept(DragAndDropEvent dragEvent)
AcceptCriterion
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.
public void paintResponse(PaintTarget target) throws PaintException
AcceptCriterion
AcceptCriterion.accept(DragAndDropEvent)
is called before this method.paintResponse
in interface AcceptCriterion
paintResponse
in class ServerSideCriterion
PaintException
protected abstract Set<Object> getAllowedItemIds(DragAndDropEvent dragEvent, Table table, Collection<Object> visibleItemIds)
dragEvent
- table
- the table for which the allowed item identifiers are
definedvisibleItemIds
- the list of currently rendered item identifiers, accepted
item id's need to be detected only for these visible itemsCopyright © 2022 Vaadin Ltd. All rights reserved.