@Test public void firesDragEndOnPreviousDraggable() { StubAnchor a1 = new StubAnchor(); StubAnchor a2 = new StubAnchor(); boolean[] stopped = { false }; a1.addDragEndHandler(e -> stopped[0] = true); a1.dragStart(); a2.dragStart(); assertThat(stopped[0], is(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; }