You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Not.java 888B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. /**
  5. *
  6. */
  7. package com.vaadin.event.dd.acceptcriteria;
  8. import com.vaadin.event.dd.DragAndDropEvent;
  9. import com.vaadin.terminal.PaintException;
  10. import com.vaadin.terminal.PaintTarget;
  11. /**
  12. * Criterion that wraps another criterion and inverts its return value.
  13. *
  14. * @since 6.3
  15. *
  16. */
  17. public class Not extends ClientSideCriterion {
  18. private static final long serialVersionUID = 1131422338558613244L;
  19. private AcceptCriterion acceptCriterion;
  20. public Not(ClientSideCriterion acceptCriterion) {
  21. this.acceptCriterion = acceptCriterion;
  22. }
  23. @Override
  24. public void paintContent(PaintTarget target) throws PaintException {
  25. super.paintContent(target);
  26. acceptCriterion.paint(target);
  27. }
  28. public boolean accept(DragAndDropEvent dragEvent) {
  29. return !acceptCriterion.accept(dragEvent);
  30. }
  31. }