diff options
Diffstat (limited to 'src/com/vaadin/event/dd/acceptCriteria/ClientSideCriterion.java')
-rw-r--r-- | src/com/vaadin/event/dd/acceptCriteria/ClientSideCriterion.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/com/vaadin/event/dd/acceptCriteria/ClientSideCriterion.java b/src/com/vaadin/event/dd/acceptCriteria/ClientSideCriterion.java new file mode 100644 index 0000000000..b221fb69cd --- /dev/null +++ b/src/com/vaadin/event/dd/acceptCriteria/ClientSideCriterion.java @@ -0,0 +1,36 @@ +package com.vaadin.event.dd.acceptCriteria; + +import java.io.Serializable; + +import com.vaadin.terminal.PaintException; +import com.vaadin.terminal.PaintTarget; + +public abstract class ClientSideCriterion implements Serializable, + AcceptCriterion { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public final boolean isClientSideVerifiable() { + return true; + } + + public void paint(PaintTarget target) throws PaintException { + target.startTag("-ac"); + target.addAttribute("name", getIdentifier()); + paintContent(target); + target.endTag("-ac"); + } + + public void paintContent(PaintTarget target) { + } + + abstract protected String getIdentifier(); + + public void paintResponse(PaintTarget target) throws PaintException { + // NOP, nothing to do as this is client side verified criterion + } + +} |