@Test public void anchorsCanBeMarkedNotDraggable() { StubAnchor a = new StubAnchor(); a.getIsElement().setAttribute("draggable", "false"); try { a.dragStart(); fail(); } catch (IllegalStateException ise) { assertThat(ise.getMessage(), is("Element must have draggable=true")); } }
void dragStart() { ensureDraggable(); if (currentStart != null) { currentDraggable.fireEvent(new StubDragEndEvent()); } currentDraggable = owner; currentStart = new StubDragStartEvent(); owner.fireEvent(currentStart); }
StubDragLogic { void dragStart() { ensureDraggable(); if (currentStart != null) { currentDraggable.fireEvent(new StubDragEndEvent()); } currentDraggable = owner; currentStart = new StubDragStartEvent(); owner.fireEvent(currentStart); } }
StubDragLogic { void dragStart() { ensureDraggable(); if (currentStart != null) { currentDraggable.fireEvent(new StubDragEndEvent()); } currentDraggable = owner; currentStart = new StubDragStartEvent(); owner.fireEvent(currentStart); } StubDragLogic(HasAllDragAndDropHandlers owner); }
StubDragLogic { void dragStart() { ensureDraggable(); if (currentStart != null) { currentDraggable.fireEvent(new StubDragEndEvent()); } currentDraggable = owner; currentStart = new StubDragStartEvent(); owner.fireEvent(currentStart); } StubDragLogic(HasAllDragAndDropHandlers owner);  }
StubDragLogic { void dragStart() { ensureDraggable(); if (currentStart != null) { currentDraggable.fireEvent(new StubDragEndEvent()); } currentDraggable = owner; currentStart = new StubDragStartEvent(); owner.fireEvent(currentStart); } StubDragLogic(HasAllDragAndDropHandlers owner);  static HasAllDragAndDropHandlers currentDraggable; static StubDragStartEvent currentStart; static StubDragOverEvent currentOver; static HasAllDragAndDropHandlers currentOverOwner; static StubDropEvent currentDrop; }