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.

VAnd.java 1011B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. /**
  5. *
  6. */
  7. package com.vaadin.terminal.gwt.client.ui.dd;
  8. import com.vaadin.terminal.gwt.client.UIDL;
  9. final public class VAnd extends VAcceptCriterion implements VAcceptCallback {
  10. private boolean b1;
  11. static VAcceptCriterion getCriteria(VDragEvent drag, UIDL configuration,
  12. int i) {
  13. UIDL childUIDL = configuration.getChildUIDL(i);
  14. return VAcceptCriteria.get(childUIDL.getStringAttribute("name"));
  15. }
  16. @Override
  17. protected boolean accept(VDragEvent drag, UIDL configuration) {
  18. int childCount = configuration.getChildCount();
  19. for (int i = 0; i < childCount; i++) {
  20. VAcceptCriterion crit = getCriteria(drag, configuration, i);
  21. b1 = false;
  22. crit.accept(drag, configuration.getChildUIDL(i), this);
  23. if (!b1) {
  24. return false;
  25. }
  26. }
  27. return true;
  28. }
  29. public void accepted(VDragEvent event) {
  30. b1 = true;
  31. }
  32. }