@Test public void testSetupDragAreaHandlers() { final Event event = mock(Event.class); doNothing().when(view).onStartDrag(any()); doNothing().when(view).onDrag(any()); doNothing().when(view).onDrop(); dragArea.onmousedown.onInvoke(event); dragArea.onmousemove.onInvoke(event); dragArea.onmouseup.onInvoke(event); dragArea.onmouseout.onInvoke(event); final InOrder inOrder = Mockito.inOrder(view); inOrder.verify(view).onStartDrag(event); inOrder.verify(view).onDrag(event); inOrder.verify(view, times(2)).onDrop(); }
void setupDragAreaHandlers() { getDragArea().onmousedown = (e) -> { onStartDrag(e); return true; }; getDragArea().onmousemove = (e) -> { onDrag(e); return true; }; getDragArea().onmouseup = (e) -> { onDrop(); return true; }; getDragArea().onmouseout = (e) -> { onDrop(); return true; }; }
DNDListComponentView implements DNDListComponent.View { void setupDragAreaHandlers() { getDragArea().onmousedown = (e) -> { onStartDrag(e); return true; }; getDragArea().onmousemove = (e) -> { onDrag(e); return true; }; getDragArea().onmouseup = (e) -> { onDrop(); return true; }; getDragArea().onmouseout = (e) -> { onDrop(); return true; }; } }
DNDListComponentView implements DNDListComponent.View { void setupDragAreaHandlers() { getDragArea().onmousedown = (e) -> { onStartDrag(e); return true; }; getDragArea().onmousemove = (e) -> { onDrag(e); return true; }; getDragArea().onmouseup = (e) -> { onDrop(); return true; }; getDragArea().onmouseout = (e) -> { onDrop(); return true; }; } @Inject  DNDListComponentView(final HTMLDivElement dragArea); }
DNDListComponentView implements DNDListComponent.View { void setupDragAreaHandlers() { getDragArea().onmousedown = (e) -> { onStartDrag(e); return true; }; getDragArea().onmousemove = (e) -> { onDrag(e); return true; }; getDragArea().onmouseup = (e) -> { onDrop(); return true; }; getDragArea().onmouseout = (e) -> { onDrop(); return true; }; } @Inject  DNDListComponentView(final HTMLDivElement dragArea); @Override void init(final DNDListComponent presenter); @Override HTMLElement registerItem(final HTMLElement htmlElement); @Override void refreshItemsPosition(); @Override void refreshItemsHTML(); @Override void consolidateHierarchicalLevel(final boolean isElementsDraggedByUser); @Override void consolidateYPosition(); @Override void clear(); @Override Optional<HTMLElement> getPreviousElement(final Element reference); @Override void refreshDragAreaSize(); @Override HTMLDivElement getDragArea(); }
DNDListComponentView implements DNDListComponent.View { void setupDragAreaHandlers() { getDragArea().onmousedown = (e) -> { onStartDrag(e); return true; }; getDragArea().onmousemove = (e) -> { onDrag(e); return true; }; getDragArea().onmouseup = (e) -> { onDrop(); return true; }; getDragArea().onmouseout = (e) -> { onDrop(); return true; }; } @Inject  DNDListComponentView(final HTMLDivElement dragArea); @Override void init(final DNDListComponent presenter); @Override HTMLElement registerItem(final HTMLElement htmlElement); @Override void refreshItemsPosition(); @Override void refreshItemsHTML(); @Override void consolidateHierarchicalLevel(final boolean isElementsDraggedByUser); @Override void consolidateYPosition(); @Override void clear(); @Override Optional<HTMLElement> getPreviousElement(final Element reference); @Override void refreshDragAreaSize(); @Override HTMLDivElement getDragArea();  }