Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ClientSideCriterion.java 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. @ITMillApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.event.dd.acceptCriteria;
  5. import java.io.Serializable;
  6. import com.vaadin.terminal.PaintException;
  7. import com.vaadin.terminal.PaintTarget;
  8. /**
  9. * Parent class for criteria that can be completely validated on client side.
  10. * All classes that provide criteria that can be completely validated on client
  11. * side should extend this class.
  12. *
  13. * @since 6.3
  14. */
  15. public abstract class ClientSideCriterion implements Serializable,
  16. AcceptCriterion {
  17. /*
  18. * All criteria that extend this must be completely validatable on client
  19. * side.
  20. *
  21. * (non-Javadoc)
  22. *
  23. * @see
  24. * com.vaadin.event.dd.acceptCriteria.AcceptCriterion#isClientSideVerifiable
  25. * ()
  26. */
  27. public final boolean isClientSideVerifiable() {
  28. return true;
  29. }
  30. public void paint(PaintTarget target) throws PaintException {
  31. target.startTag("-ac");
  32. target.addAttribute("name", getIdentifier());
  33. paintContent(target);
  34. target.endTag("-ac");
  35. }
  36. protected void paintContent(PaintTarget target) throws PaintException {
  37. }
  38. protected String getIdentifier() {
  39. return getClass().getCanonicalName();
  40. }
  41. public final void paintResponse(PaintTarget target) throws PaintException {
  42. // NOP, nothing to do as this is client side verified criterion
  43. }
  44. }