com.vaadin.ui.
Class Table.TableDropCriterion
java.lang.Object
com.vaadin.event.dd.acceptcriteria.ServerSideCriterion
com.vaadin.ui.Table.TableDropCriterion
All Implemented Interfaces:
Enclosing class:
- extends ServerSideCriterion
public abstract static class Table.TableDropCriterion
Lazy loading accept criterion for Table. Accepted target rows are loaded from server once per drag and drop operation. Developer must override one method that decides on which rows the currently dragged data can be dropped.
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 | |
---|---|
Table.TableDropCriterion()
|
Method Summary | |
---|---|
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. |
Methods inherited from class com.vaadin.event.dd.acceptcriteria.ServerSideCriterion |
---|
isClientSideVerifiable, paint, paintContent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
Table.TableDropCriterion
public Table.TableDropCriterion()
Method Detail |
---|
getIdentifier
protected String getIdentifier()
- Overrides:
getIdentifier
in classServerSideCriterion
accept
public boolean accept(DragAndDropEvent dragEvent)
- Returns:
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.
paintResponse
public void paintResponse(PaintTarget target)
throws PaintException
- Specified by:
paintResponse
in interfaceAcceptCriterion
- Overrides:
paintResponse
in classServerSideCriterion
- 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.
getAllowedItemIds
protected abstract Set<Object> getAllowedItemIds(DragAndDropEvent dragEvent,
Table table,
Collection<Object> visibleItemIds)
- Parameters:
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 items- Returns:
- the set of identifiers for items on which the dragEvent will be accepted