@Test public void testOnMouseClick() { final HTMLElement htmlElement = new HTMLElement(); htmlElement.style = new CSSStyleDeclaration(); final HTMLDocument htmlDocument = new HTMLDocument(); htmlDocument.body = new HTMLBodyElement(); Whitebox.setInternalState(DomGlobal.class, "document", htmlDocument); when(drdContextMenu.getElement()).thenReturn(htmlElement); dmnEditDRDToolboxAction.onMouseClick(canvasHandler, UUID, mouseClickEvent); verify(drdContextMenu, times(1)).show(any(Collection.class)); }
@Override public ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler, final String uuid, final MouseClickEvent event) { drdContextMenu.appendContextMenuToTheDOM(event.getClientX(), event.getClientY()); final Element<? extends Definition<?>> element = CanvasLayoutUtils.getElement(canvasHandler, uuid); if (element instanceof Node) { drdContextMenu.show(singletonList(element.asNode())); } return this; }
DMNEditDRDToolboxAction implements ToolboxAction<AbstractCanvasHandler> { @Override public ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler, final String uuid, final MouseClickEvent event) { drdContextMenu.appendContextMenuToTheDOM(event.getClientX(), event.getClientY()); final Element<? extends Definition<?>> element = CanvasLayoutUtils.getElement(canvasHandler, uuid); if (element instanceof Node) { drdContextMenu.show(singletonList(element.asNode())); } return this; } }
DMNEditDRDToolboxAction implements ToolboxAction<AbstractCanvasHandler> { @Override public ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler, final String uuid, final MouseClickEvent event) { drdContextMenu.appendContextMenuToTheDOM(event.getClientX(), event.getClientY()); final Element<? extends Definition<?>> element = CanvasLayoutUtils.getElement(canvasHandler, uuid); if (element instanceof Node) { drdContextMenu.show(singletonList(element.asNode())); } return this; } @Inject  DMNEditDRDToolboxAction(final DRDContextMenu drdContextMenu); }
DMNEditDRDToolboxAction implements ToolboxAction<AbstractCanvasHandler> { @Override public ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler, final String uuid, final MouseClickEvent event) { drdContextMenu.appendContextMenuToTheDOM(event.getClientX(), event.getClientY()); final Element<? extends Definition<?>> element = CanvasLayoutUtils.getElement(canvasHandler, uuid); if (element instanceof Node) { drdContextMenu.show(singletonList(element.asNode())); } return this; } @Inject  DMNEditDRDToolboxAction(final DRDContextMenu drdContextMenu); @Override Glyph getGlyph(final AbstractCanvasHandler canvasHandler, final String uuid); @Override String getTitle(final AbstractCanvasHandler canvasHandler, final String uuid); @Override ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler, final String uuid, final MouseClickEvent event); }
DMNEditDRDToolboxAction implements ToolboxAction<AbstractCanvasHandler> { @Override public ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler, final String uuid, final MouseClickEvent event) { drdContextMenu.appendContextMenuToTheDOM(event.getClientX(), event.getClientY()); final Element<? extends Definition<?>> element = CanvasLayoutUtils.getElement(canvasHandler, uuid); if (element instanceof Node) { drdContextMenu.show(singletonList(element.asNode())); } return this; } @Inject  DMNEditDRDToolboxAction(final DRDContextMenu drdContextMenu); @Override Glyph getGlyph(final AbstractCanvasHandler canvasHandler, final String uuid); @Override String getTitle(final AbstractCanvasHandler canvasHandler, final String uuid); @Override ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler, final String uuid, final MouseClickEvent event);  }