@Test public void checkWriteUsesCommandToUpdateTextProperty() { provider.setText(canvasHandler, commandManager, element, NAME_VALUE); verify(canvasCommandFactory).updatePropertyValue(eq(element), eq(NAME_FIELD), nameArgumentCaptor.capture()); assertEquals(NAME_VALUE, nameArgumentCaptor.getValue().getValue()); verify(commandManager).execute(eq(canvasHandler), eq(command)); }
@Override public void setText(final AbstractCanvasHandler canvasHandler, final CanvasCommandManager<AbstractCanvasHandler> commandManager, final Element<? extends Definition> element, final String text) { final Object definition = DefinitionUtils.getElementDefinition(element); final CanvasCommand<AbstractCanvasHandler> command = canvasCommandFactory.updatePropertyValue(element, definitionUtils.getNameIdentifier(definition), new Name(NameUtils.normaliseName(text))); commandManager.execute(canvasHandler, command); }
DRGElementTextPropertyProviderImpl implements TextPropertyProvider { @Override public void setText(final AbstractCanvasHandler canvasHandler, final CanvasCommandManager<AbstractCanvasHandler> commandManager, final Element<? extends Definition> element, final String text) { final Object definition = DefinitionUtils.getElementDefinition(element); final CanvasCommand<AbstractCanvasHandler> command = canvasCommandFactory.updatePropertyValue(element, definitionUtils.getNameIdentifier(definition), new Name(NameUtils.normaliseName(text))); commandManager.execute(canvasHandler, command); } }
DRGElementTextPropertyProviderImpl implements TextPropertyProvider { @Override public void setText(final AbstractCanvasHandler canvasHandler, final CanvasCommandManager<AbstractCanvasHandler> commandManager, final Element<? extends Definition> element, final String text) { final Object definition = DefinitionUtils.getElementDefinition(element); final CanvasCommand<AbstractCanvasHandler> command = canvasCommandFactory.updatePropertyValue(element, definitionUtils.getNameIdentifier(definition), new Name(NameUtils.normaliseName(text))); commandManager.execute(canvasHandler, command); } DRGElementTextPropertyProviderImpl(); @Inject  DRGElementTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
                                              final DefinitionUtils definitionUtils); }
DRGElementTextPropertyProviderImpl implements TextPropertyProvider { @Override public void setText(final AbstractCanvasHandler canvasHandler, final CanvasCommandManager<AbstractCanvasHandler> commandManager, final Element<? extends Definition> element, final String text) { final Object definition = DefinitionUtils.getElementDefinition(element); final CanvasCommand<AbstractCanvasHandler> command = canvasCommandFactory.updatePropertyValue(element, definitionUtils.getNameIdentifier(definition), new Name(NameUtils.normaliseName(text))); commandManager.execute(canvasHandler, command); } DRGElementTextPropertyProviderImpl(); @Inject  DRGElementTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
                                              final DefinitionUtils definitionUtils); @Override int getPriority(); @Override boolean supports(final Element<? extends Definition> element); @Override String getText(final Element<? extends Definition> element); @Override void setText(final AbstractCanvasHandler canvasHandler,
                        final CanvasCommandManager<AbstractCanvasHandler> commandManager,
                        final Element<? extends Definition> element,
                        final String text); }
DRGElementTextPropertyProviderImpl implements TextPropertyProvider { @Override public void setText(final AbstractCanvasHandler canvasHandler, final CanvasCommandManager<AbstractCanvasHandler> commandManager, final Element<? extends Definition> element, final String text) { final Object definition = DefinitionUtils.getElementDefinition(element); final CanvasCommand<AbstractCanvasHandler> command = canvasCommandFactory.updatePropertyValue(element, definitionUtils.getNameIdentifier(definition), new Name(NameUtils.normaliseName(text))); commandManager.execute(canvasHandler, command); } DRGElementTextPropertyProviderImpl(); @Inject  DRGElementTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
                                              final DefinitionUtils definitionUtils); @Override int getPriority(); @Override boolean supports(final Element<? extends Definition> element); @Override String getText(final Element<? extends Definition> element); @Override void setText(final AbstractCanvasHandler canvasHandler,
                        final CanvasCommandManager<AbstractCanvasHandler> commandManager,
                        final Element<? extends Definition> element,
                        final String text);  }