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.

VNot.java 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. *
  3. */
  4. package com.vaadin.terminal.gwt.client.ui.dd;
  5. import com.vaadin.terminal.gwt.client.ApplicationConnection;
  6. import com.vaadin.terminal.gwt.client.UIDL;
  7. final public class VNot implements VAcceptCriterion {
  8. private boolean b1;
  9. private VAcceptCriterion crit1;
  10. public void accept(VDragEvent drag, UIDL configuration,
  11. VAcceptCallback callback) {
  12. if (crit1 == null) {
  13. crit1 = getCriteria(drag, configuration, 0);
  14. if (crit1 == null) {
  15. ApplicationConnection.getConsole().log(
  16. "Not criteria didn't found a child criteria");
  17. return;
  18. }
  19. }
  20. b1 = false;
  21. VAcceptCallback accept1cb = new VAcceptCallback() {
  22. public void accepted(VDragEvent event) {
  23. b1 = true;
  24. }
  25. };
  26. crit1.accept(drag, configuration.getChildUIDL(0), accept1cb);
  27. if (!b1) {
  28. callback.accepted(drag);
  29. }
  30. }
  31. private VAcceptCriterion getCriteria(VDragEvent drag, UIDL configuration,
  32. int i) {
  33. UIDL childUIDL = configuration.getChildUIDL(i);
  34. return VAcceptCriteria.get(childUIDL.getStringAttribute("name"));
  35. }
  36. public boolean needsServerSideCheck(VDragEvent drag, UIDL criterioUIDL) {
  37. return false; // TODO enforce on server side
  38. }
  39. }