@Test public void testAction() { final MouseClickEvent event = mock(MouseClickEvent.class); final ToolboxAction<AbstractCanvasHandler> cascade = tested.onMouseClick(canvasHandler, E_UUID, event); assertEquals(tested, cascade); final ArgumentCaptor<EditExpressionEvent> eventCaptor = ArgumentCaptor.forClass(EditExpressionEvent.class); verify(editExpressionEvent, times(1)).fire(eventCaptor.capture()); final EditExpressionEvent editExprEvent = eventCaptor.getValue(); assertEquals(E_UUID, editExprEvent.getNodeUUID()); assertEquals(decision, editExprEvent.getHasExpression()); assertEquals(decision, editExprEvent.getHasName().get()); assertEquals(session, editExprEvent.getSession()); assertFalse(editExprEvent.isOnlyVisualChangeAllowed()); }
@Override @SuppressWarnings("unchecked") public ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler, final String uuid, final MouseClickEvent event) { final Node<View<? extends Decision>, Edge> decisionNode = (Node<View<? extends Decision>, Edge>) CanvasLayoutUtils.getElement(canvasHandler, uuid) .asNode(); final Decision decision = (Decision) DefinitionUtils.getElementDefinition(decisionNode); final boolean isOnlyVisualChangeAllowed = decision.isAllowOnlyVisualChange(); editExpressionEvent.fire(new EditExpressionEvent(sessionManager.getCurrentSession(), uuid, decision, Optional.of(decision), isOnlyVisualChangeAllowed)); return this; }
DMNEditDecisionToolboxAction implements ToolboxAction<AbstractCanvasHandler> { @Override @SuppressWarnings("unchecked") public ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler, final String uuid, final MouseClickEvent event) { final Node<View<? extends Decision>, Edge> decisionNode = (Node<View<? extends Decision>, Edge>) CanvasLayoutUtils.getElement(canvasHandler, uuid) .asNode(); final Decision decision = (Decision) DefinitionUtils.getElementDefinition(decisionNode); final boolean isOnlyVisualChangeAllowed = decision.isAllowOnlyVisualChange(); editExpressionEvent.fire(new EditExpressionEvent(sessionManager.getCurrentSession(), uuid, decision, Optional.of(decision), isOnlyVisualChangeAllowed)); return this; } }
DMNEditDecisionToolboxAction implements ToolboxAction<AbstractCanvasHandler> { @Override @SuppressWarnings("unchecked") public ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler, final String uuid, final MouseClickEvent event) { final Node<View<? extends Decision>, Edge> decisionNode = (Node<View<? extends Decision>, Edge>) CanvasLayoutUtils.getElement(canvasHandler, uuid) .asNode(); final Decision decision = (Decision) DefinitionUtils.getElementDefinition(decisionNode); final boolean isOnlyVisualChangeAllowed = decision.isAllowOnlyVisualChange(); editExpressionEvent.fire(new EditExpressionEvent(sessionManager.getCurrentSession(), uuid, decision, Optional.of(decision), isOnlyVisualChangeAllowed)); return this; } @Inject  DMNEditDecisionToolboxAction(final SessionManager sessionManager,
                                        final ClientTranslationService translationService,
                                        final Event<EditExpressionEvent> editExpressionEvent); }
DMNEditDecisionToolboxAction implements ToolboxAction<AbstractCanvasHandler> { @Override @SuppressWarnings("unchecked") public ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler, final String uuid, final MouseClickEvent event) { final Node<View<? extends Decision>, Edge> decisionNode = (Node<View<? extends Decision>, Edge>) CanvasLayoutUtils.getElement(canvasHandler, uuid) .asNode(); final Decision decision = (Decision) DefinitionUtils.getElementDefinition(decisionNode); final boolean isOnlyVisualChangeAllowed = decision.isAllowOnlyVisualChange(); editExpressionEvent.fire(new EditExpressionEvent(sessionManager.getCurrentSession(), uuid, decision, Optional.of(decision), isOnlyVisualChangeAllowed)); return this; } @Inject  DMNEditDecisionToolboxAction(final SessionManager sessionManager,
                                        final ClientTranslationService translationService,
                                        final Event<EditExpressionEvent> editExpressionEvent); @Override Glyph getGlyph(final AbstractCanvasHandler canvasHandler,
                          final String uuid); @Override String getTitle(final AbstractCanvasHandler canvasHandler,
                           final String uuid); @Override @SuppressWarnings("unchecked") ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler,
                                                             final String uuid,
                                                             final MouseClickEvent event); }
DMNEditDecisionToolboxAction implements ToolboxAction<AbstractCanvasHandler> { @Override @SuppressWarnings("unchecked") public ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler, final String uuid, final MouseClickEvent event) { final Node<View<? extends Decision>, Edge> decisionNode = (Node<View<? extends Decision>, Edge>) CanvasLayoutUtils.getElement(canvasHandler, uuid) .asNode(); final Decision decision = (Decision) DefinitionUtils.getElementDefinition(decisionNode); final boolean isOnlyVisualChangeAllowed = decision.isAllowOnlyVisualChange(); editExpressionEvent.fire(new EditExpressionEvent(sessionManager.getCurrentSession(), uuid, decision, Optional.of(decision), isOnlyVisualChangeAllowed)); return this; } @Inject  DMNEditDecisionToolboxAction(final SessionManager sessionManager,
                                        final ClientTranslationService translationService,
                                        final Event<EditExpressionEvent> editExpressionEvent); @Override Glyph getGlyph(final AbstractCanvasHandler canvasHandler,
                          final String uuid); @Override String getTitle(final AbstractCanvasHandler canvasHandler,
                           final String uuid); @Override @SuppressWarnings("unchecked") ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler,
                                                             final String uuid,
                                                             final MouseClickEvent event);  }