選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

DndEmptyTable.java 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package com.vaadin.tests.components.table;
  2. import com.vaadin.event.dd.DragAndDropEvent;
  3. import com.vaadin.event.dd.DropHandler;
  4. import com.vaadin.event.dd.acceptcriteria.AcceptAll;
  5. import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
  6. import com.vaadin.server.VaadinRequest;
  7. import com.vaadin.tests.components.AbstractReindeerTestUI;
  8. import com.vaadin.ui.DragAndDropWrapper;
  9. import com.vaadin.ui.DragAndDropWrapper.DragStartMode;
  10. import com.vaadin.ui.Label;
  11. import com.vaadin.v7.ui.Table;
  12. /**
  13. * Test UI for empty table: empty table (without any data) throws client side
  14. * exception if it's a target for DnD.
  15. *
  16. * @author Vaadin Ltd
  17. */
  18. public class DndEmptyTable extends AbstractReindeerTestUI {
  19. @Override
  20. protected void setup(VaadinRequest request) {
  21. Label source = new Label("label");
  22. DragAndDropWrapper wrapper = new DragAndDropWrapper(source);
  23. wrapper.setDragStartMode(DragStartMode.WRAPPER);
  24. addComponent(wrapper);
  25. Table target = new Table();
  26. target.setWidth(100, Unit.PERCENTAGE);
  27. addComponent(target);
  28. target.setDropHandler(new DropHandler() {
  29. @Override
  30. public AcceptCriterion getAcceptCriterion() {
  31. return AcceptAll.get();
  32. }
  33. @Override
  34. public void drop(DragAndDropEvent event) {
  35. }
  36. });
  37. }
  38. @Override
  39. protected String getTestDescription() {
  40. return "Drag and drop into empty table should not throws client side exception.";
  41. }
  42. @Override
  43. protected Integer getTicketNumber() {
  44. return 13655;
  45. }
  46. }