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.

VMyDropTarget.java 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package com.vaadin.tests.dd;
  2. import com.google.gwt.user.client.ui.Composite;
  3. import com.google.gwt.user.client.ui.Widget;
  4. import com.vaadin.terminal.gwt.client.ApplicationConnection;
  5. import com.vaadin.terminal.gwt.client.VPaintableWidget;
  6. import com.vaadin.terminal.gwt.client.UIDL;
  7. import com.vaadin.terminal.gwt.client.ui.dd.VDragEvent;
  8. import com.vaadin.terminal.gwt.client.ui.dd.VDropHandler;
  9. import com.vaadin.terminal.gwt.client.ui.dd.VHasDropHandler;
  10. public class VMyDropTarget extends Composite implements VHasDropHandler,
  11. VDropHandler, VPaintableWidget {
  12. private ApplicationConnection client;
  13. public void dragEnter(VDragEvent drag) {
  14. }
  15. public void dragLeave(VDragEvent drag) {
  16. // TODO Auto-generated method stub
  17. }
  18. public void dragOver(VDragEvent currentDrag) {
  19. // TODO Auto-generated method stub
  20. }
  21. public boolean drop(VDragEvent drag) {
  22. // TODO Auto-generated method stub
  23. // return true to tell DDManager do server visit
  24. return false;
  25. }
  26. public VPaintableWidget getPaintable() {
  27. // Drophandler implemented by Paintable itself
  28. return this;
  29. }
  30. public VDropHandler getDropHandler() {
  31. // Drophandler implemented by Paintable itself
  32. return this;
  33. }
  34. public ApplicationConnection getApplicationConnection() {
  35. return client;
  36. }
  37. public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
  38. this.client = client;
  39. }
  40. public Widget getWidgetForPaintable() {
  41. return this;
  42. }
  43. }