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 967B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. @ITMillApache2LicenseForJavaFiles@
  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. import com.vaadin.terminal.gwt.client.ui.dd.VNot;
  12. /**
  13. * Criterion that wraps another criterion and inverts its return value.
  14. *
  15. * @since 6.3
  16. *
  17. */
  18. @ClientCriterion(VNot.class)
  19. public class Not extends ClientSideCriterion {
  20. private static final long serialVersionUID = 1131422338558613244L;
  21. private AcceptCriterion acceptCriterion;
  22. public Not(ClientSideCriterion acceptCriterion) {
  23. this.acceptCriterion = acceptCriterion;
  24. }
  25. @Override
  26. public void paintContent(PaintTarget target) throws PaintException {
  27. super.paintContent(target);
  28. acceptCriterion.paint(target);
  29. }
  30. public boolean accept(DragAndDropEvent dragEvent) {
  31. return !acceptCriterion.accept(dragEvent);
  32. }
  33. }