Interface AcceptCriterion
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractSelect.AcceptItem
,AbstractSelect.TargetItemIs
,AbstractSelect.VerticalLocationIs
,AcceptAll
,And
,ClientSideCriterion
,ContainsDataFlavor
,Not
,Or
,ServerSideCriterion
,SourceIs
,SourceIsTarget
,Table.TableDropCriterion
,TargetDetailIs
,Tree.TargetInSubtree
,Tree.TargetItemAllowsChildren
,Tree.TreeDropCriterion
public interface AcceptCriterion extends Serializable
Criterion that can be used create policy to accept/discard dragged content (presented byTransferable
). The drag and drop mechanism will verify the criteria returned byDropHandler.getAcceptCriterion()
before callingDropHandler.drop(DragAndDropEvent)
. The criteria can be evaluated either on the client (browser - seeClientSideCriterion
) or on the server (seeServerSideCriterion
). If no constraints are needed, anAcceptAll
can be used. In addition to accepting or rejecting a possible drop, criteria can provide additional hints for client side painting.- Since:
- 6.3
- See Also:
DropHandler
,ClientSideCriterion
,ServerSideCriterion
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
accept(DragAndDropEvent dragEvent)
Validates the data in event to be appropriate for theDropHandler.drop(DragAndDropEvent)
method.boolean
isClientSideVerifiable()
Returns whether the criteria can be checked on the client or whether a server request is needed to check the criteria.void
paint(PaintTarget target)
void
paintResponse(PaintTarget target)
This needs to be implemented iff criterion does some lazy server side initialization.
-
-
-
Method Detail
-
isClientSideVerifiable
boolean isClientSideVerifiable()
Returns whether the criteria can be checked on the client or whether a server request is needed to check the criteria. This requirement may depend on the state of the criterion (e.g. logical operations between criteria), so this cannot be based on a marker interface.
-
paint
void paint(PaintTarget target) throws PaintException
- Throws:
PaintException
-
paintResponse
void paintResponse(PaintTarget target) throws PaintException
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 thataccept(DragAndDropEvent)
is called before this method.- Parameters:
target
-- Throws:
PaintException
-
accept
boolean accept(DragAndDropEvent dragEvent)
Validates the data in event to be appropriate for theDropHandler.drop(DragAndDropEvent)
method.Note that even if your criterion is validated on client side, you should always validate the data on server side too.
- Parameters:
dragEvent
-- Returns:
-
-