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.

VServerAccept.java 923B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. @ITMillApache2LicenseForJavaFiles@
  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 VServerAccept extends VAcceptCriterion {
  10. @Override
  11. public void accept(final VDragEvent drag, UIDL configuration,
  12. final VAcceptCallback callback) {
  13. VDragEventServerCallback acceptCallback = new VDragEventServerCallback() {
  14. public void handleResponse(boolean accepted, UIDL response) {
  15. if (accepted) {
  16. callback.accepted(drag);
  17. }
  18. }
  19. };
  20. VDragAndDropManager.get().visitServer(acceptCallback);
  21. }
  22. @Override
  23. public boolean needsServerSideCheck(VDragEvent drag, UIDL criterioUIDL) {
  24. return true;
  25. }
  26. @Override
  27. public boolean validates(VDragEvent drag, UIDL configuration) {
  28. return false; // not used
  29. }
  30. }