target
stringlengths 20
113k
| src_fm
stringlengths 11
86.3k
| src_fm_fc
stringlengths 21
86.4k
| src_fm_fc_co
stringlengths 30
86.4k
| src_fm_fc_ms
stringlengths 42
86.8k
| src_fm_fc_ms_ff
stringlengths 43
86.8k
|
---|---|---|---|---|---|
@Test public void testUpdateEncapsulatedLogicFromDefinition() { final Element element = mock(Element.class); final View elementContent = mock(View.class); final BusinessKnowledgeModel newBusinessKnowledgeModel = mock(BusinessKnowledgeModel.class); final BusinessKnowledgeModel businessKnowledgeModel = mock(BusinessKnowledgeModel.class); final FunctionDefinition functionDefinition = mock(FunctionDefinition.class); when(element.getContent()).thenReturn(elementContent); when(elementContent.getDefinition()).thenReturn(newBusinessKnowledgeModel); when(businessKnowledgeModel.getEncapsulatedLogic()).thenReturn(functionDefinition); when(newBusinessKnowledgeModel.getName()).thenReturn(new Name()); when(businessKnowledgeModel.getName()).thenReturn(new Name()); when(newBusinessKnowledgeModel.getId()).thenReturn(new Id()); when(businessKnowledgeModel.getId()).thenReturn(new Id()); observerBuilderControl.updateElementFromDefinition(element, businessKnowledgeModel); verify(newBusinessKnowledgeModel).setEncapsulatedLogic(functionDefinition); }
|
@Override @SuppressWarnings("unchecked") protected void updateElementFromDefinition(final Element element, final Object definition) { final Object content = element.getContent(); if (!(content instanceof View)) { return; } final Object newDefinition = ((View) content).getDefinition(); if (newDefinition instanceof HasName && definition instanceof HasName) { ((HasName) newDefinition).getName().setValue(((HasName) definition).getName().getValue()); } if (newDefinition instanceof DynamicReadOnly && definition instanceof DynamicReadOnly) { ((DynamicReadOnly) newDefinition).setAllowOnlyVisualChange(((DynamicReadOnly) definition).isAllowOnlyVisualChange()); } if (newDefinition instanceof HasVariable && definition instanceof HasVariable) { ((HasVariable) newDefinition).setVariable(((HasVariable) definition).getVariable()); } if (newDefinition instanceof BusinessKnowledgeModel && definition instanceof BusinessKnowledgeModel) { ((BusinessKnowledgeModel) newDefinition).setEncapsulatedLogic(((BusinessKnowledgeModel) definition).getEncapsulatedLogic()); } if (newDefinition instanceof HasExpression && definition instanceof HasExpression) { ((HasExpression) newDefinition).setExpression(((HasExpression) definition).getExpression()); } if (newDefinition instanceof DMNElement && definition instanceof DMNElement) { final DMNElement dmnElement = (DMNElement) definition; if (!StringUtils.isEmpty(dmnElement.getId().getValue())) { ((DMNElement) newDefinition).getId().setValue(dmnElement.getId().getValue()); } } final Optional<DMNDiagramElement> currentDMNDiagramElement = getDMNDiagramsSession().getCurrentDMNDiagramElement(); if (currentDMNDiagramElement.isPresent() && newDefinition instanceof HasContentDefinitionId) { ((HasContentDefinitionId) newDefinition).setDiagramId(currentDMNDiagramElement.get().getId().getValue()); } }
|
ObserverBuilderControl extends org.kie.workbench.common.stunner.core.client.canvas.controls.builder.impl.ObserverBuilderControl { @Override @SuppressWarnings("unchecked") protected void updateElementFromDefinition(final Element element, final Object definition) { final Object content = element.getContent(); if (!(content instanceof View)) { return; } final Object newDefinition = ((View) content).getDefinition(); if (newDefinition instanceof HasName && definition instanceof HasName) { ((HasName) newDefinition).getName().setValue(((HasName) definition).getName().getValue()); } if (newDefinition instanceof DynamicReadOnly && definition instanceof DynamicReadOnly) { ((DynamicReadOnly) newDefinition).setAllowOnlyVisualChange(((DynamicReadOnly) definition).isAllowOnlyVisualChange()); } if (newDefinition instanceof HasVariable && definition instanceof HasVariable) { ((HasVariable) newDefinition).setVariable(((HasVariable) definition).getVariable()); } if (newDefinition instanceof BusinessKnowledgeModel && definition instanceof BusinessKnowledgeModel) { ((BusinessKnowledgeModel) newDefinition).setEncapsulatedLogic(((BusinessKnowledgeModel) definition).getEncapsulatedLogic()); } if (newDefinition instanceof HasExpression && definition instanceof HasExpression) { ((HasExpression) newDefinition).setExpression(((HasExpression) definition).getExpression()); } if (newDefinition instanceof DMNElement && definition instanceof DMNElement) { final DMNElement dmnElement = (DMNElement) definition; if (!StringUtils.isEmpty(dmnElement.getId().getValue())) { ((DMNElement) newDefinition).getId().setValue(dmnElement.getId().getValue()); } } final Optional<DMNDiagramElement> currentDMNDiagramElement = getDMNDiagramsSession().getCurrentDMNDiagramElement(); if (currentDMNDiagramElement.isPresent() && newDefinition instanceof HasContentDefinitionId) { ((HasContentDefinitionId) newDefinition).setDiagramId(currentDMNDiagramElement.get().getId().getValue()); } } }
|
ObserverBuilderControl extends org.kie.workbench.common.stunner.core.client.canvas.controls.builder.impl.ObserverBuilderControl { @Override @SuppressWarnings("unchecked") protected void updateElementFromDefinition(final Element element, final Object definition) { final Object content = element.getContent(); if (!(content instanceof View)) { return; } final Object newDefinition = ((View) content).getDefinition(); if (newDefinition instanceof HasName && definition instanceof HasName) { ((HasName) newDefinition).getName().setValue(((HasName) definition).getName().getValue()); } if (newDefinition instanceof DynamicReadOnly && definition instanceof DynamicReadOnly) { ((DynamicReadOnly) newDefinition).setAllowOnlyVisualChange(((DynamicReadOnly) definition).isAllowOnlyVisualChange()); } if (newDefinition instanceof HasVariable && definition instanceof HasVariable) { ((HasVariable) newDefinition).setVariable(((HasVariable) definition).getVariable()); } if (newDefinition instanceof BusinessKnowledgeModel && definition instanceof BusinessKnowledgeModel) { ((BusinessKnowledgeModel) newDefinition).setEncapsulatedLogic(((BusinessKnowledgeModel) definition).getEncapsulatedLogic()); } if (newDefinition instanceof HasExpression && definition instanceof HasExpression) { ((HasExpression) newDefinition).setExpression(((HasExpression) definition).getExpression()); } if (newDefinition instanceof DMNElement && definition instanceof DMNElement) { final DMNElement dmnElement = (DMNElement) definition; if (!StringUtils.isEmpty(dmnElement.getId().getValue())) { ((DMNElement) newDefinition).getId().setValue(dmnElement.getId().getValue()); } } final Optional<DMNDiagramElement> currentDMNDiagramElement = getDMNDiagramsSession().getCurrentDMNDiagramElement(); if (currentDMNDiagramElement.isPresent() && newDefinition instanceof HasContentDefinitionId) { ((HasContentDefinitionId) newDefinition).setDiagramId(currentDMNDiagramElement.get().getId().getValue()); } } @Inject ObserverBuilderControl(final ClientDefinitionManager clientDefinitionManager,
final ClientFactoryService clientFactoryServices,
final RuleManager ruleManager,
final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final ClientTranslationMessages translationMessages,
final GraphBoundsIndexer graphBoundsIndexer,
final Event<CanvasSelectionEvent> canvasSelectionEvent,
final DMNDiagramsSession dmnDiagramsSession); }
|
ObserverBuilderControl extends org.kie.workbench.common.stunner.core.client.canvas.controls.builder.impl.ObserverBuilderControl { @Override @SuppressWarnings("unchecked") protected void updateElementFromDefinition(final Element element, final Object definition) { final Object content = element.getContent(); if (!(content instanceof View)) { return; } final Object newDefinition = ((View) content).getDefinition(); if (newDefinition instanceof HasName && definition instanceof HasName) { ((HasName) newDefinition).getName().setValue(((HasName) definition).getName().getValue()); } if (newDefinition instanceof DynamicReadOnly && definition instanceof DynamicReadOnly) { ((DynamicReadOnly) newDefinition).setAllowOnlyVisualChange(((DynamicReadOnly) definition).isAllowOnlyVisualChange()); } if (newDefinition instanceof HasVariable && definition instanceof HasVariable) { ((HasVariable) newDefinition).setVariable(((HasVariable) definition).getVariable()); } if (newDefinition instanceof BusinessKnowledgeModel && definition instanceof BusinessKnowledgeModel) { ((BusinessKnowledgeModel) newDefinition).setEncapsulatedLogic(((BusinessKnowledgeModel) definition).getEncapsulatedLogic()); } if (newDefinition instanceof HasExpression && definition instanceof HasExpression) { ((HasExpression) newDefinition).setExpression(((HasExpression) definition).getExpression()); } if (newDefinition instanceof DMNElement && definition instanceof DMNElement) { final DMNElement dmnElement = (DMNElement) definition; if (!StringUtils.isEmpty(dmnElement.getId().getValue())) { ((DMNElement) newDefinition).getId().setValue(dmnElement.getId().getValue()); } } final Optional<DMNDiagramElement> currentDMNDiagramElement = getDMNDiagramsSession().getCurrentDMNDiagramElement(); if (currentDMNDiagramElement.isPresent() && newDefinition instanceof HasContentDefinitionId) { ((HasContentDefinitionId) newDefinition).setDiagramId(currentDMNDiagramElement.get().getId().getValue()); } } @Inject ObserverBuilderControl(final ClientDefinitionManager clientDefinitionManager,
final ClientFactoryService clientFactoryServices,
final RuleManager ruleManager,
final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final ClientTranslationMessages translationMessages,
final GraphBoundsIndexer graphBoundsIndexer,
final Event<CanvasSelectionEvent> canvasSelectionEvent,
final DMNDiagramsSession dmnDiagramsSession); }
|
ObserverBuilderControl extends org.kie.workbench.common.stunner.core.client.canvas.controls.builder.impl.ObserverBuilderControl { @Override @SuppressWarnings("unchecked") protected void updateElementFromDefinition(final Element element, final Object definition) { final Object content = element.getContent(); if (!(content instanceof View)) { return; } final Object newDefinition = ((View) content).getDefinition(); if (newDefinition instanceof HasName && definition instanceof HasName) { ((HasName) newDefinition).getName().setValue(((HasName) definition).getName().getValue()); } if (newDefinition instanceof DynamicReadOnly && definition instanceof DynamicReadOnly) { ((DynamicReadOnly) newDefinition).setAllowOnlyVisualChange(((DynamicReadOnly) definition).isAllowOnlyVisualChange()); } if (newDefinition instanceof HasVariable && definition instanceof HasVariable) { ((HasVariable) newDefinition).setVariable(((HasVariable) definition).getVariable()); } if (newDefinition instanceof BusinessKnowledgeModel && definition instanceof BusinessKnowledgeModel) { ((BusinessKnowledgeModel) newDefinition).setEncapsulatedLogic(((BusinessKnowledgeModel) definition).getEncapsulatedLogic()); } if (newDefinition instanceof HasExpression && definition instanceof HasExpression) { ((HasExpression) newDefinition).setExpression(((HasExpression) definition).getExpression()); } if (newDefinition instanceof DMNElement && definition instanceof DMNElement) { final DMNElement dmnElement = (DMNElement) definition; if (!StringUtils.isEmpty(dmnElement.getId().getValue())) { ((DMNElement) newDefinition).getId().setValue(dmnElement.getId().getValue()); } } final Optional<DMNDiagramElement> currentDMNDiagramElement = getDMNDiagramsSession().getCurrentDMNDiagramElement(); if (currentDMNDiagramElement.isPresent() && newDefinition instanceof HasContentDefinitionId) { ((HasContentDefinitionId) newDefinition).setDiagramId(currentDMNDiagramElement.get().getId().getValue()); } } @Inject ObserverBuilderControl(final ClientDefinitionManager clientDefinitionManager,
final ClientFactoryService clientFactoryServices,
final RuleManager ruleManager,
final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final ClientTranslationMessages translationMessages,
final GraphBoundsIndexer graphBoundsIndexer,
final Event<CanvasSelectionEvent> canvasSelectionEvent,
final DMNDiagramsSession dmnDiagramsSession); }
|
@Test @SuppressWarnings("unchecked") public void testUpdateVariableFromDefinition() { final Element element = mock(Element.class); final View elementContent = mock(View.class); final HasVariable newHasVariable = mock(HasVariable.class); final HasVariable hasVariable = mock(HasVariable.class); final IsInformationItem isInformationItem = mock(IsInformationItem.class); when(element.getContent()).thenReturn(elementContent); when(elementContent.getDefinition()).thenReturn(newHasVariable); when(hasVariable.getVariable()).thenReturn(isInformationItem); observerBuilderControl.updateElementFromDefinition(element, hasVariable); verify(newHasVariable).setVariable(isInformationItem); }
|
@Override @SuppressWarnings("unchecked") protected void updateElementFromDefinition(final Element element, final Object definition) { final Object content = element.getContent(); if (!(content instanceof View)) { return; } final Object newDefinition = ((View) content).getDefinition(); if (newDefinition instanceof HasName && definition instanceof HasName) { ((HasName) newDefinition).getName().setValue(((HasName) definition).getName().getValue()); } if (newDefinition instanceof DynamicReadOnly && definition instanceof DynamicReadOnly) { ((DynamicReadOnly) newDefinition).setAllowOnlyVisualChange(((DynamicReadOnly) definition).isAllowOnlyVisualChange()); } if (newDefinition instanceof HasVariable && definition instanceof HasVariable) { ((HasVariable) newDefinition).setVariable(((HasVariable) definition).getVariable()); } if (newDefinition instanceof BusinessKnowledgeModel && definition instanceof BusinessKnowledgeModel) { ((BusinessKnowledgeModel) newDefinition).setEncapsulatedLogic(((BusinessKnowledgeModel) definition).getEncapsulatedLogic()); } if (newDefinition instanceof HasExpression && definition instanceof HasExpression) { ((HasExpression) newDefinition).setExpression(((HasExpression) definition).getExpression()); } if (newDefinition instanceof DMNElement && definition instanceof DMNElement) { final DMNElement dmnElement = (DMNElement) definition; if (!StringUtils.isEmpty(dmnElement.getId().getValue())) { ((DMNElement) newDefinition).getId().setValue(dmnElement.getId().getValue()); } } final Optional<DMNDiagramElement> currentDMNDiagramElement = getDMNDiagramsSession().getCurrentDMNDiagramElement(); if (currentDMNDiagramElement.isPresent() && newDefinition instanceof HasContentDefinitionId) { ((HasContentDefinitionId) newDefinition).setDiagramId(currentDMNDiagramElement.get().getId().getValue()); } }
|
ObserverBuilderControl extends org.kie.workbench.common.stunner.core.client.canvas.controls.builder.impl.ObserverBuilderControl { @Override @SuppressWarnings("unchecked") protected void updateElementFromDefinition(final Element element, final Object definition) { final Object content = element.getContent(); if (!(content instanceof View)) { return; } final Object newDefinition = ((View) content).getDefinition(); if (newDefinition instanceof HasName && definition instanceof HasName) { ((HasName) newDefinition).getName().setValue(((HasName) definition).getName().getValue()); } if (newDefinition instanceof DynamicReadOnly && definition instanceof DynamicReadOnly) { ((DynamicReadOnly) newDefinition).setAllowOnlyVisualChange(((DynamicReadOnly) definition).isAllowOnlyVisualChange()); } if (newDefinition instanceof HasVariable && definition instanceof HasVariable) { ((HasVariable) newDefinition).setVariable(((HasVariable) definition).getVariable()); } if (newDefinition instanceof BusinessKnowledgeModel && definition instanceof BusinessKnowledgeModel) { ((BusinessKnowledgeModel) newDefinition).setEncapsulatedLogic(((BusinessKnowledgeModel) definition).getEncapsulatedLogic()); } if (newDefinition instanceof HasExpression && definition instanceof HasExpression) { ((HasExpression) newDefinition).setExpression(((HasExpression) definition).getExpression()); } if (newDefinition instanceof DMNElement && definition instanceof DMNElement) { final DMNElement dmnElement = (DMNElement) definition; if (!StringUtils.isEmpty(dmnElement.getId().getValue())) { ((DMNElement) newDefinition).getId().setValue(dmnElement.getId().getValue()); } } final Optional<DMNDiagramElement> currentDMNDiagramElement = getDMNDiagramsSession().getCurrentDMNDiagramElement(); if (currentDMNDiagramElement.isPresent() && newDefinition instanceof HasContentDefinitionId) { ((HasContentDefinitionId) newDefinition).setDiagramId(currentDMNDiagramElement.get().getId().getValue()); } } }
|
ObserverBuilderControl extends org.kie.workbench.common.stunner.core.client.canvas.controls.builder.impl.ObserverBuilderControl { @Override @SuppressWarnings("unchecked") protected void updateElementFromDefinition(final Element element, final Object definition) { final Object content = element.getContent(); if (!(content instanceof View)) { return; } final Object newDefinition = ((View) content).getDefinition(); if (newDefinition instanceof HasName && definition instanceof HasName) { ((HasName) newDefinition).getName().setValue(((HasName) definition).getName().getValue()); } if (newDefinition instanceof DynamicReadOnly && definition instanceof DynamicReadOnly) { ((DynamicReadOnly) newDefinition).setAllowOnlyVisualChange(((DynamicReadOnly) definition).isAllowOnlyVisualChange()); } if (newDefinition instanceof HasVariable && definition instanceof HasVariable) { ((HasVariable) newDefinition).setVariable(((HasVariable) definition).getVariable()); } if (newDefinition instanceof BusinessKnowledgeModel && definition instanceof BusinessKnowledgeModel) { ((BusinessKnowledgeModel) newDefinition).setEncapsulatedLogic(((BusinessKnowledgeModel) definition).getEncapsulatedLogic()); } if (newDefinition instanceof HasExpression && definition instanceof HasExpression) { ((HasExpression) newDefinition).setExpression(((HasExpression) definition).getExpression()); } if (newDefinition instanceof DMNElement && definition instanceof DMNElement) { final DMNElement dmnElement = (DMNElement) definition; if (!StringUtils.isEmpty(dmnElement.getId().getValue())) { ((DMNElement) newDefinition).getId().setValue(dmnElement.getId().getValue()); } } final Optional<DMNDiagramElement> currentDMNDiagramElement = getDMNDiagramsSession().getCurrentDMNDiagramElement(); if (currentDMNDiagramElement.isPresent() && newDefinition instanceof HasContentDefinitionId) { ((HasContentDefinitionId) newDefinition).setDiagramId(currentDMNDiagramElement.get().getId().getValue()); } } @Inject ObserverBuilderControl(final ClientDefinitionManager clientDefinitionManager,
final ClientFactoryService clientFactoryServices,
final RuleManager ruleManager,
final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final ClientTranslationMessages translationMessages,
final GraphBoundsIndexer graphBoundsIndexer,
final Event<CanvasSelectionEvent> canvasSelectionEvent,
final DMNDiagramsSession dmnDiagramsSession); }
|
ObserverBuilderControl extends org.kie.workbench.common.stunner.core.client.canvas.controls.builder.impl.ObserverBuilderControl { @Override @SuppressWarnings("unchecked") protected void updateElementFromDefinition(final Element element, final Object definition) { final Object content = element.getContent(); if (!(content instanceof View)) { return; } final Object newDefinition = ((View) content).getDefinition(); if (newDefinition instanceof HasName && definition instanceof HasName) { ((HasName) newDefinition).getName().setValue(((HasName) definition).getName().getValue()); } if (newDefinition instanceof DynamicReadOnly && definition instanceof DynamicReadOnly) { ((DynamicReadOnly) newDefinition).setAllowOnlyVisualChange(((DynamicReadOnly) definition).isAllowOnlyVisualChange()); } if (newDefinition instanceof HasVariable && definition instanceof HasVariable) { ((HasVariable) newDefinition).setVariable(((HasVariable) definition).getVariable()); } if (newDefinition instanceof BusinessKnowledgeModel && definition instanceof BusinessKnowledgeModel) { ((BusinessKnowledgeModel) newDefinition).setEncapsulatedLogic(((BusinessKnowledgeModel) definition).getEncapsulatedLogic()); } if (newDefinition instanceof HasExpression && definition instanceof HasExpression) { ((HasExpression) newDefinition).setExpression(((HasExpression) definition).getExpression()); } if (newDefinition instanceof DMNElement && definition instanceof DMNElement) { final DMNElement dmnElement = (DMNElement) definition; if (!StringUtils.isEmpty(dmnElement.getId().getValue())) { ((DMNElement) newDefinition).getId().setValue(dmnElement.getId().getValue()); } } final Optional<DMNDiagramElement> currentDMNDiagramElement = getDMNDiagramsSession().getCurrentDMNDiagramElement(); if (currentDMNDiagramElement.isPresent() && newDefinition instanceof HasContentDefinitionId) { ((HasContentDefinitionId) newDefinition).setDiagramId(currentDMNDiagramElement.get().getId().getValue()); } } @Inject ObserverBuilderControl(final ClientDefinitionManager clientDefinitionManager,
final ClientFactoryService clientFactoryServices,
final RuleManager ruleManager,
final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final ClientTranslationMessages translationMessages,
final GraphBoundsIndexer graphBoundsIndexer,
final Event<CanvasSelectionEvent> canvasSelectionEvent,
final DMNDiagramsSession dmnDiagramsSession); }
|
ObserverBuilderControl extends org.kie.workbench.common.stunner.core.client.canvas.controls.builder.impl.ObserverBuilderControl { @Override @SuppressWarnings("unchecked") protected void updateElementFromDefinition(final Element element, final Object definition) { final Object content = element.getContent(); if (!(content instanceof View)) { return; } final Object newDefinition = ((View) content).getDefinition(); if (newDefinition instanceof HasName && definition instanceof HasName) { ((HasName) newDefinition).getName().setValue(((HasName) definition).getName().getValue()); } if (newDefinition instanceof DynamicReadOnly && definition instanceof DynamicReadOnly) { ((DynamicReadOnly) newDefinition).setAllowOnlyVisualChange(((DynamicReadOnly) definition).isAllowOnlyVisualChange()); } if (newDefinition instanceof HasVariable && definition instanceof HasVariable) { ((HasVariable) newDefinition).setVariable(((HasVariable) definition).getVariable()); } if (newDefinition instanceof BusinessKnowledgeModel && definition instanceof BusinessKnowledgeModel) { ((BusinessKnowledgeModel) newDefinition).setEncapsulatedLogic(((BusinessKnowledgeModel) definition).getEncapsulatedLogic()); } if (newDefinition instanceof HasExpression && definition instanceof HasExpression) { ((HasExpression) newDefinition).setExpression(((HasExpression) definition).getExpression()); } if (newDefinition instanceof DMNElement && definition instanceof DMNElement) { final DMNElement dmnElement = (DMNElement) definition; if (!StringUtils.isEmpty(dmnElement.getId().getValue())) { ((DMNElement) newDefinition).getId().setValue(dmnElement.getId().getValue()); } } final Optional<DMNDiagramElement> currentDMNDiagramElement = getDMNDiagramsSession().getCurrentDMNDiagramElement(); if (currentDMNDiagramElement.isPresent() && newDefinition instanceof HasContentDefinitionId) { ((HasContentDefinitionId) newDefinition).setDiagramId(currentDMNDiagramElement.get().getId().getValue()); } } @Inject ObserverBuilderControl(final ClientDefinitionManager clientDefinitionManager,
final ClientFactoryService clientFactoryServices,
final RuleManager ruleManager,
final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final ClientTranslationMessages translationMessages,
final GraphBoundsIndexer graphBoundsIndexer,
final Event<CanvasSelectionEvent> canvasSelectionEvent,
final DMNDiagramsSession dmnDiagramsSession); }
|
@Test public void testUpdateDMNDiagramIdFromSelectedDMNDiagram() { final DRGElement newDefinition = mock(DRGElement.class); final Element element = mock(Element.class); final View elementContent = mock(View.class); final Object definition = mock(Object.class); final String selectedDiagramId = "selected diagram id"; final DMNDiagramElement selectedDiagram = mock(DMNDiagramElement.class); final Id id = mock(Id.class); when(id.getValue()).thenReturn(selectedDiagramId); when(selectedDiagram.getId()).thenReturn(id); when(dmnDiagramsSession.getCurrentDMNDiagramElement()).thenReturn(Optional.of(selectedDiagram)); when(elementContent.getDefinition()).thenReturn(newDefinition); when(element.getContent()).thenReturn(elementContent); observerBuilderControl.updateElementFromDefinition(element, definition); verify(newDefinition).setDiagramId(selectedDiagramId); }
|
@Override @SuppressWarnings("unchecked") protected void updateElementFromDefinition(final Element element, final Object definition) { final Object content = element.getContent(); if (!(content instanceof View)) { return; } final Object newDefinition = ((View) content).getDefinition(); if (newDefinition instanceof HasName && definition instanceof HasName) { ((HasName) newDefinition).getName().setValue(((HasName) definition).getName().getValue()); } if (newDefinition instanceof DynamicReadOnly && definition instanceof DynamicReadOnly) { ((DynamicReadOnly) newDefinition).setAllowOnlyVisualChange(((DynamicReadOnly) definition).isAllowOnlyVisualChange()); } if (newDefinition instanceof HasVariable && definition instanceof HasVariable) { ((HasVariable) newDefinition).setVariable(((HasVariable) definition).getVariable()); } if (newDefinition instanceof BusinessKnowledgeModel && definition instanceof BusinessKnowledgeModel) { ((BusinessKnowledgeModel) newDefinition).setEncapsulatedLogic(((BusinessKnowledgeModel) definition).getEncapsulatedLogic()); } if (newDefinition instanceof HasExpression && definition instanceof HasExpression) { ((HasExpression) newDefinition).setExpression(((HasExpression) definition).getExpression()); } if (newDefinition instanceof DMNElement && definition instanceof DMNElement) { final DMNElement dmnElement = (DMNElement) definition; if (!StringUtils.isEmpty(dmnElement.getId().getValue())) { ((DMNElement) newDefinition).getId().setValue(dmnElement.getId().getValue()); } } final Optional<DMNDiagramElement> currentDMNDiagramElement = getDMNDiagramsSession().getCurrentDMNDiagramElement(); if (currentDMNDiagramElement.isPresent() && newDefinition instanceof HasContentDefinitionId) { ((HasContentDefinitionId) newDefinition).setDiagramId(currentDMNDiagramElement.get().getId().getValue()); } }
|
ObserverBuilderControl extends org.kie.workbench.common.stunner.core.client.canvas.controls.builder.impl.ObserverBuilderControl { @Override @SuppressWarnings("unchecked") protected void updateElementFromDefinition(final Element element, final Object definition) { final Object content = element.getContent(); if (!(content instanceof View)) { return; } final Object newDefinition = ((View) content).getDefinition(); if (newDefinition instanceof HasName && definition instanceof HasName) { ((HasName) newDefinition).getName().setValue(((HasName) definition).getName().getValue()); } if (newDefinition instanceof DynamicReadOnly && definition instanceof DynamicReadOnly) { ((DynamicReadOnly) newDefinition).setAllowOnlyVisualChange(((DynamicReadOnly) definition).isAllowOnlyVisualChange()); } if (newDefinition instanceof HasVariable && definition instanceof HasVariable) { ((HasVariable) newDefinition).setVariable(((HasVariable) definition).getVariable()); } if (newDefinition instanceof BusinessKnowledgeModel && definition instanceof BusinessKnowledgeModel) { ((BusinessKnowledgeModel) newDefinition).setEncapsulatedLogic(((BusinessKnowledgeModel) definition).getEncapsulatedLogic()); } if (newDefinition instanceof HasExpression && definition instanceof HasExpression) { ((HasExpression) newDefinition).setExpression(((HasExpression) definition).getExpression()); } if (newDefinition instanceof DMNElement && definition instanceof DMNElement) { final DMNElement dmnElement = (DMNElement) definition; if (!StringUtils.isEmpty(dmnElement.getId().getValue())) { ((DMNElement) newDefinition).getId().setValue(dmnElement.getId().getValue()); } } final Optional<DMNDiagramElement> currentDMNDiagramElement = getDMNDiagramsSession().getCurrentDMNDiagramElement(); if (currentDMNDiagramElement.isPresent() && newDefinition instanceof HasContentDefinitionId) { ((HasContentDefinitionId) newDefinition).setDiagramId(currentDMNDiagramElement.get().getId().getValue()); } } }
|
ObserverBuilderControl extends org.kie.workbench.common.stunner.core.client.canvas.controls.builder.impl.ObserverBuilderControl { @Override @SuppressWarnings("unchecked") protected void updateElementFromDefinition(final Element element, final Object definition) { final Object content = element.getContent(); if (!(content instanceof View)) { return; } final Object newDefinition = ((View) content).getDefinition(); if (newDefinition instanceof HasName && definition instanceof HasName) { ((HasName) newDefinition).getName().setValue(((HasName) definition).getName().getValue()); } if (newDefinition instanceof DynamicReadOnly && definition instanceof DynamicReadOnly) { ((DynamicReadOnly) newDefinition).setAllowOnlyVisualChange(((DynamicReadOnly) definition).isAllowOnlyVisualChange()); } if (newDefinition instanceof HasVariable && definition instanceof HasVariable) { ((HasVariable) newDefinition).setVariable(((HasVariable) definition).getVariable()); } if (newDefinition instanceof BusinessKnowledgeModel && definition instanceof BusinessKnowledgeModel) { ((BusinessKnowledgeModel) newDefinition).setEncapsulatedLogic(((BusinessKnowledgeModel) definition).getEncapsulatedLogic()); } if (newDefinition instanceof HasExpression && definition instanceof HasExpression) { ((HasExpression) newDefinition).setExpression(((HasExpression) definition).getExpression()); } if (newDefinition instanceof DMNElement && definition instanceof DMNElement) { final DMNElement dmnElement = (DMNElement) definition; if (!StringUtils.isEmpty(dmnElement.getId().getValue())) { ((DMNElement) newDefinition).getId().setValue(dmnElement.getId().getValue()); } } final Optional<DMNDiagramElement> currentDMNDiagramElement = getDMNDiagramsSession().getCurrentDMNDiagramElement(); if (currentDMNDiagramElement.isPresent() && newDefinition instanceof HasContentDefinitionId) { ((HasContentDefinitionId) newDefinition).setDiagramId(currentDMNDiagramElement.get().getId().getValue()); } } @Inject ObserverBuilderControl(final ClientDefinitionManager clientDefinitionManager,
final ClientFactoryService clientFactoryServices,
final RuleManager ruleManager,
final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final ClientTranslationMessages translationMessages,
final GraphBoundsIndexer graphBoundsIndexer,
final Event<CanvasSelectionEvent> canvasSelectionEvent,
final DMNDiagramsSession dmnDiagramsSession); }
|
ObserverBuilderControl extends org.kie.workbench.common.stunner.core.client.canvas.controls.builder.impl.ObserverBuilderControl { @Override @SuppressWarnings("unchecked") protected void updateElementFromDefinition(final Element element, final Object definition) { final Object content = element.getContent(); if (!(content instanceof View)) { return; } final Object newDefinition = ((View) content).getDefinition(); if (newDefinition instanceof HasName && definition instanceof HasName) { ((HasName) newDefinition).getName().setValue(((HasName) definition).getName().getValue()); } if (newDefinition instanceof DynamicReadOnly && definition instanceof DynamicReadOnly) { ((DynamicReadOnly) newDefinition).setAllowOnlyVisualChange(((DynamicReadOnly) definition).isAllowOnlyVisualChange()); } if (newDefinition instanceof HasVariable && definition instanceof HasVariable) { ((HasVariable) newDefinition).setVariable(((HasVariable) definition).getVariable()); } if (newDefinition instanceof BusinessKnowledgeModel && definition instanceof BusinessKnowledgeModel) { ((BusinessKnowledgeModel) newDefinition).setEncapsulatedLogic(((BusinessKnowledgeModel) definition).getEncapsulatedLogic()); } if (newDefinition instanceof HasExpression && definition instanceof HasExpression) { ((HasExpression) newDefinition).setExpression(((HasExpression) definition).getExpression()); } if (newDefinition instanceof DMNElement && definition instanceof DMNElement) { final DMNElement dmnElement = (DMNElement) definition; if (!StringUtils.isEmpty(dmnElement.getId().getValue())) { ((DMNElement) newDefinition).getId().setValue(dmnElement.getId().getValue()); } } final Optional<DMNDiagramElement> currentDMNDiagramElement = getDMNDiagramsSession().getCurrentDMNDiagramElement(); if (currentDMNDiagramElement.isPresent() && newDefinition instanceof HasContentDefinitionId) { ((HasContentDefinitionId) newDefinition).setDiagramId(currentDMNDiagramElement.get().getId().getValue()); } } @Inject ObserverBuilderControl(final ClientDefinitionManager clientDefinitionManager,
final ClientFactoryService clientFactoryServices,
final RuleManager ruleManager,
final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final ClientTranslationMessages translationMessages,
final GraphBoundsIndexer graphBoundsIndexer,
final Event<CanvasSelectionEvent> canvasSelectionEvent,
final DMNDiagramsSession dmnDiagramsSession); }
|
ObserverBuilderControl extends org.kie.workbench.common.stunner.core.client.canvas.controls.builder.impl.ObserverBuilderControl { @Override @SuppressWarnings("unchecked") protected void updateElementFromDefinition(final Element element, final Object definition) { final Object content = element.getContent(); if (!(content instanceof View)) { return; } final Object newDefinition = ((View) content).getDefinition(); if (newDefinition instanceof HasName && definition instanceof HasName) { ((HasName) newDefinition).getName().setValue(((HasName) definition).getName().getValue()); } if (newDefinition instanceof DynamicReadOnly && definition instanceof DynamicReadOnly) { ((DynamicReadOnly) newDefinition).setAllowOnlyVisualChange(((DynamicReadOnly) definition).isAllowOnlyVisualChange()); } if (newDefinition instanceof HasVariable && definition instanceof HasVariable) { ((HasVariable) newDefinition).setVariable(((HasVariable) definition).getVariable()); } if (newDefinition instanceof BusinessKnowledgeModel && definition instanceof BusinessKnowledgeModel) { ((BusinessKnowledgeModel) newDefinition).setEncapsulatedLogic(((BusinessKnowledgeModel) definition).getEncapsulatedLogic()); } if (newDefinition instanceof HasExpression && definition instanceof HasExpression) { ((HasExpression) newDefinition).setExpression(((HasExpression) definition).getExpression()); } if (newDefinition instanceof DMNElement && definition instanceof DMNElement) { final DMNElement dmnElement = (DMNElement) definition; if (!StringUtils.isEmpty(dmnElement.getId().getValue())) { ((DMNElement) newDefinition).getId().setValue(dmnElement.getId().getValue()); } } final Optional<DMNDiagramElement> currentDMNDiagramElement = getDMNDiagramsSession().getCurrentDMNDiagramElement(); if (currentDMNDiagramElement.isPresent() && newDefinition instanceof HasContentDefinitionId) { ((HasContentDefinitionId) newDefinition).setDiagramId(currentDMNDiagramElement.get().getId().getValue()); } } @Inject ObserverBuilderControl(final ClientDefinitionManager clientDefinitionManager,
final ClientFactoryService clientFactoryServices,
final RuleManager ruleManager,
final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final ClientTranslationMessages translationMessages,
final GraphBoundsIndexer graphBoundsIndexer,
final Event<CanvasSelectionEvent> canvasSelectionEvent,
final DMNDiagramsSession dmnDiagramsSession); }
|
@Test public void checkPriorityLessThanCatchAll() { assertTrue(provider.getPriority() < TextPropertyProviderFactory.CATCH_ALL_PRIORITY); }
|
@Override public int getPriority() { return 1; }
|
DRGElementTextPropertyProviderImpl implements TextPropertyProvider { @Override public int getPriority() { return 1; } }
|
DRGElementTextPropertyProviderImpl implements TextPropertyProvider { @Override public int getPriority() { return 1; } DRGElementTextPropertyProviderImpl(); @Inject DRGElementTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); }
|
DRGElementTextPropertyProviderImpl implements TextPropertyProvider { @Override public int getPriority() { return 1; } 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 int getPriority() { return 1; } 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); }
|
@Test @SuppressWarnings("unchecked") public void checkSupportsDRGElement() { assertTrue(provider.supports(element)); final Element other = mock(Element.class); final Definition otherContent = mock(Definition.class); final TextAnnotation otherDefinition = mock(TextAnnotation.class); when(other.getContent()).thenReturn(otherContent); when(otherContent.getDefinition()).thenReturn(otherDefinition); assertFalse(provider.supports(other)); }
|
@Override public boolean supports(final Element<? extends Definition> element) { return DefinitionUtils.getElementDefinition(element) instanceof DRGElement; }
|
DRGElementTextPropertyProviderImpl implements TextPropertyProvider { @Override public boolean supports(final Element<? extends Definition> element) { return DefinitionUtils.getElementDefinition(element) instanceof DRGElement; } }
|
DRGElementTextPropertyProviderImpl implements TextPropertyProvider { @Override public boolean supports(final Element<? extends Definition> element) { return DefinitionUtils.getElementDefinition(element) instanceof DRGElement; } DRGElementTextPropertyProviderImpl(); @Inject DRGElementTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); }
|
DRGElementTextPropertyProviderImpl implements TextPropertyProvider { @Override public boolean supports(final Element<? extends Definition> element) { return DefinitionUtils.getElementDefinition(element) instanceof DRGElement; } 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 boolean supports(final Element<? extends Definition> element) { return DefinitionUtils.getElementDefinition(element) instanceof DRGElement; } 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); }
|
@Test public void checkReadGetsTextFromNameProperty() { provider.getText(element); verify(definition).getNameHolder(); verify(nameHolder).getValue(); }
|
@Override public String getText(final Element<? extends Definition> element) { final DRGElement drgElement = (DRGElement) DefinitionUtils.getElementDefinition(element); return drgElement.getNameHolder().getValue().getValue(); }
|
DRGElementTextPropertyProviderImpl implements TextPropertyProvider { @Override public String getText(final Element<? extends Definition> element) { final DRGElement drgElement = (DRGElement) DefinitionUtils.getElementDefinition(element); return drgElement.getNameHolder().getValue().getValue(); } }
|
DRGElementTextPropertyProviderImpl implements TextPropertyProvider { @Override public String getText(final Element<? extends Definition> element) { final DRGElement drgElement = (DRGElement) DefinitionUtils.getElementDefinition(element); return drgElement.getNameHolder().getValue().getValue(); } DRGElementTextPropertyProviderImpl(); @Inject DRGElementTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); }
|
DRGElementTextPropertyProviderImpl implements TextPropertyProvider { @Override public String getText(final Element<? extends Definition> element) { final DRGElement drgElement = (DRGElement) DefinitionUtils.getElementDefinition(element); return drgElement.getNameHolder().getValue().getValue(); } 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 String getText(final Element<? extends Definition> element) { final DRGElement drgElement = (DRGElement) DefinitionUtils.getElementDefinition(element); return drgElement.getNameHolder().getValue().getValue(); } 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); }
|
@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); }
|
@Test public void checkWriteUsesCommandToUpdateTextPropertyWithWhitespace() { provider.setText(canvasHandler, commandManager, element, NAME_VALUE_WITH_WHITESPACE); 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); }
|
@Test public void checkPriorityLessThanCatchAll() { assertTrue(provider.getPriority() < TextPropertyProviderFactory.CATCH_ALL_PRIORITY); }
|
@Override public int getPriority() { return 1; }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public int getPriority() { return 1; } }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public int getPriority() { return 1; } DMNDiagramTextPropertyProviderImpl(); @Inject DMNDiagramTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public int getPriority() { return 1; } DMNDiagramTextPropertyProviderImpl(); @Inject DMNDiagramTextPropertyProviderImpl(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); }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public int getPriority() { return 1; } DMNDiagramTextPropertyProviderImpl(); @Inject DMNDiagramTextPropertyProviderImpl(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); }
|
@Test public void onContextMenu_WithGridWidget_WithCellSelectionStrategy_CellNotSelected() { when(nativeEvent.getClientX()).thenReturn((int) (COLUMN0_WIDTH / 2)); when(nativeEvent.getClientY()).thenReturn((int) (HEADER_HEIGHT + ROW_HEIGHT + ROW_HEIGHT / 2)); final BaseGrid gridWidget = mockGridWidget(); when(gridLayer.getGridWidgets()).thenReturn(Collections.singleton(gridWidget)); final MockCell cell = mock(MockCell.class); final CellSelectionStrategy selectionStrategy = mock(CellSelectionStrategy.class); gridWidget.getModel().setCell(1, 0, () -> cell); when(cell.getEditor()).thenReturn(Optional.of(editor)); when(cell.getSelectionStrategy()).thenReturn(selectionStrategy); handler.onContextMenu(event); verify(cellSelectionHandler).selectCellIfRequired(eq(1), eq(0), eq(gridWidget), eq(false), eq(false)); }
|
@Override @SuppressWarnings("unchecked") public void onContextMenu(final ContextMenuEvent event) { event.preventDefault(); event.stopPropagation(); final int canvasX = getRelativeXOfEvent(event); final int canvasY = getRelativeYOfEvent(event); final boolean isShiftKeyDown = event.getNativeEvent().getShiftKey(); final boolean isControlKeyDown = event.getNativeEvent().getCtrlKey(); final List<CandidateGridWidget> candidateGridWidgets = new ArrayList<>(); for (GridWidget gridWidget : gridLayer.getGridWidgets()) { if (DynamicReadOnlyUtils.isOnlyVisualChangeAllowed(gridWidget)) { continue; } final GridData gridModel = gridWidget.getModel(); final Point2D ap = convertDOMToGridCoordinate(gridWidget, new Point2D(canvasX, canvasY)); final Integer uiHeaderRowIndex = getUiHeaderRowIndex(gridWidget, ap); final Integer uiColumnIndex = getUiColumnIndex(gridWidget, ap.getX()); if (Objects.nonNull(uiHeaderRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridColumn.HeaderMetaData hasCellEditorControls = gridModel.getColumns().get(uiColumnIndex).getHeaderMetaData().get(uiHeaderRowIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiHeaderRowIndex, uiColumnIndex, hasCellEditorControls, candidateGridWidgets, () -> cellSelectionHandler.selectHeaderCellIfRequired(uiHeaderRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } final Integer uiRowIndex = getUiRowIndex(gridWidget, ap.getY()); if (Objects.nonNull(uiRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridCell<?> hasCellEditorControls = gridModel.getCell(uiRowIndex, uiColumnIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiRowIndex, uiColumnIndex, gridWidget, candidateGridWidgets, () -> cellSelectionHandler.selectCellIfRequired(uiRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } } if (candidateGridWidgets.isEmpty()) { return; } final CandidateGridWidget candidateGridWidget = candidateGridWidgets.get(candidateGridWidgets.size() - 1); final Point2D ap = candidateGridWidget.ap; final int uiRowIndex = candidateGridWidget.uiRowIndex; final int uiColumnIndex = candidateGridWidget.uiColumnIndex; final Object binding = candidateGridWidget.binding; final HasCellEditorControls hasCellEditorControls = candidateGridWidget.hasCellEditorControls; final Optional<HasCellEditorControls.Editor> editor = hasCellEditorControls.getEditor(); editor.ifPresent(e -> { candidateGridWidget.ensureCellSelectedCommand.execute(); e.bind(binding, uiRowIndex, uiColumnIndex); cellEditorControls.show(e, (int) (ap.getX()), (int) (ap.getY())); }); }
|
DMNGridPanelContextMenuHandler implements ContextMenuHandler { @Override @SuppressWarnings("unchecked") public void onContextMenu(final ContextMenuEvent event) { event.preventDefault(); event.stopPropagation(); final int canvasX = getRelativeXOfEvent(event); final int canvasY = getRelativeYOfEvent(event); final boolean isShiftKeyDown = event.getNativeEvent().getShiftKey(); final boolean isControlKeyDown = event.getNativeEvent().getCtrlKey(); final List<CandidateGridWidget> candidateGridWidgets = new ArrayList<>(); for (GridWidget gridWidget : gridLayer.getGridWidgets()) { if (DynamicReadOnlyUtils.isOnlyVisualChangeAllowed(gridWidget)) { continue; } final GridData gridModel = gridWidget.getModel(); final Point2D ap = convertDOMToGridCoordinate(gridWidget, new Point2D(canvasX, canvasY)); final Integer uiHeaderRowIndex = getUiHeaderRowIndex(gridWidget, ap); final Integer uiColumnIndex = getUiColumnIndex(gridWidget, ap.getX()); if (Objects.nonNull(uiHeaderRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridColumn.HeaderMetaData hasCellEditorControls = gridModel.getColumns().get(uiColumnIndex).getHeaderMetaData().get(uiHeaderRowIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiHeaderRowIndex, uiColumnIndex, hasCellEditorControls, candidateGridWidgets, () -> cellSelectionHandler.selectHeaderCellIfRequired(uiHeaderRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } final Integer uiRowIndex = getUiRowIndex(gridWidget, ap.getY()); if (Objects.nonNull(uiRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridCell<?> hasCellEditorControls = gridModel.getCell(uiRowIndex, uiColumnIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiRowIndex, uiColumnIndex, gridWidget, candidateGridWidgets, () -> cellSelectionHandler.selectCellIfRequired(uiRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } } if (candidateGridWidgets.isEmpty()) { return; } final CandidateGridWidget candidateGridWidget = candidateGridWidgets.get(candidateGridWidgets.size() - 1); final Point2D ap = candidateGridWidget.ap; final int uiRowIndex = candidateGridWidget.uiRowIndex; final int uiColumnIndex = candidateGridWidget.uiColumnIndex; final Object binding = candidateGridWidget.binding; final HasCellEditorControls hasCellEditorControls = candidateGridWidget.hasCellEditorControls; final Optional<HasCellEditorControls.Editor> editor = hasCellEditorControls.getEditor(); editor.ifPresent(e -> { candidateGridWidget.ensureCellSelectedCommand.execute(); e.bind(binding, uiRowIndex, uiColumnIndex); cellEditorControls.show(e, (int) (ap.getX()), (int) (ap.getY())); }); } }
|
DMNGridPanelContextMenuHandler implements ContextMenuHandler { @Override @SuppressWarnings("unchecked") public void onContextMenu(final ContextMenuEvent event) { event.preventDefault(); event.stopPropagation(); final int canvasX = getRelativeXOfEvent(event); final int canvasY = getRelativeYOfEvent(event); final boolean isShiftKeyDown = event.getNativeEvent().getShiftKey(); final boolean isControlKeyDown = event.getNativeEvent().getCtrlKey(); final List<CandidateGridWidget> candidateGridWidgets = new ArrayList<>(); for (GridWidget gridWidget : gridLayer.getGridWidgets()) { if (DynamicReadOnlyUtils.isOnlyVisualChangeAllowed(gridWidget)) { continue; } final GridData gridModel = gridWidget.getModel(); final Point2D ap = convertDOMToGridCoordinate(gridWidget, new Point2D(canvasX, canvasY)); final Integer uiHeaderRowIndex = getUiHeaderRowIndex(gridWidget, ap); final Integer uiColumnIndex = getUiColumnIndex(gridWidget, ap.getX()); if (Objects.nonNull(uiHeaderRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridColumn.HeaderMetaData hasCellEditorControls = gridModel.getColumns().get(uiColumnIndex).getHeaderMetaData().get(uiHeaderRowIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiHeaderRowIndex, uiColumnIndex, hasCellEditorControls, candidateGridWidgets, () -> cellSelectionHandler.selectHeaderCellIfRequired(uiHeaderRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } final Integer uiRowIndex = getUiRowIndex(gridWidget, ap.getY()); if (Objects.nonNull(uiRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridCell<?> hasCellEditorControls = gridModel.getCell(uiRowIndex, uiColumnIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiRowIndex, uiColumnIndex, gridWidget, candidateGridWidgets, () -> cellSelectionHandler.selectCellIfRequired(uiRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } } if (candidateGridWidgets.isEmpty()) { return; } final CandidateGridWidget candidateGridWidget = candidateGridWidgets.get(candidateGridWidgets.size() - 1); final Point2D ap = candidateGridWidget.ap; final int uiRowIndex = candidateGridWidget.uiRowIndex; final int uiColumnIndex = candidateGridWidget.uiColumnIndex; final Object binding = candidateGridWidget.binding; final HasCellEditorControls hasCellEditorControls = candidateGridWidget.hasCellEditorControls; final Optional<HasCellEditorControls.Editor> editor = hasCellEditorControls.getEditor(); editor.ifPresent(e -> { candidateGridWidget.ensureCellSelectedCommand.execute(); e.bind(binding, uiRowIndex, uiColumnIndex); cellEditorControls.show(e, (int) (ap.getX()), (int) (ap.getY())); }); } DMNGridPanelContextMenuHandler(final DMNGridLayer gridLayer,
final CellEditorControlsView.Presenter cellEditorControls,
final DMNGridPanelCellSelectionHandler cellSelectionHandler); }
|
DMNGridPanelContextMenuHandler implements ContextMenuHandler { @Override @SuppressWarnings("unchecked") public void onContextMenu(final ContextMenuEvent event) { event.preventDefault(); event.stopPropagation(); final int canvasX = getRelativeXOfEvent(event); final int canvasY = getRelativeYOfEvent(event); final boolean isShiftKeyDown = event.getNativeEvent().getShiftKey(); final boolean isControlKeyDown = event.getNativeEvent().getCtrlKey(); final List<CandidateGridWidget> candidateGridWidgets = new ArrayList<>(); for (GridWidget gridWidget : gridLayer.getGridWidgets()) { if (DynamicReadOnlyUtils.isOnlyVisualChangeAllowed(gridWidget)) { continue; } final GridData gridModel = gridWidget.getModel(); final Point2D ap = convertDOMToGridCoordinate(gridWidget, new Point2D(canvasX, canvasY)); final Integer uiHeaderRowIndex = getUiHeaderRowIndex(gridWidget, ap); final Integer uiColumnIndex = getUiColumnIndex(gridWidget, ap.getX()); if (Objects.nonNull(uiHeaderRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridColumn.HeaderMetaData hasCellEditorControls = gridModel.getColumns().get(uiColumnIndex).getHeaderMetaData().get(uiHeaderRowIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiHeaderRowIndex, uiColumnIndex, hasCellEditorControls, candidateGridWidgets, () -> cellSelectionHandler.selectHeaderCellIfRequired(uiHeaderRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } final Integer uiRowIndex = getUiRowIndex(gridWidget, ap.getY()); if (Objects.nonNull(uiRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridCell<?> hasCellEditorControls = gridModel.getCell(uiRowIndex, uiColumnIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiRowIndex, uiColumnIndex, gridWidget, candidateGridWidgets, () -> cellSelectionHandler.selectCellIfRequired(uiRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } } if (candidateGridWidgets.isEmpty()) { return; } final CandidateGridWidget candidateGridWidget = candidateGridWidgets.get(candidateGridWidgets.size() - 1); final Point2D ap = candidateGridWidget.ap; final int uiRowIndex = candidateGridWidget.uiRowIndex; final int uiColumnIndex = candidateGridWidget.uiColumnIndex; final Object binding = candidateGridWidget.binding; final HasCellEditorControls hasCellEditorControls = candidateGridWidget.hasCellEditorControls; final Optional<HasCellEditorControls.Editor> editor = hasCellEditorControls.getEditor(); editor.ifPresent(e -> { candidateGridWidget.ensureCellSelectedCommand.execute(); e.bind(binding, uiRowIndex, uiColumnIndex); cellEditorControls.show(e, (int) (ap.getX()), (int) (ap.getY())); }); } DMNGridPanelContextMenuHandler(final DMNGridLayer gridLayer,
final CellEditorControlsView.Presenter cellEditorControls,
final DMNGridPanelCellSelectionHandler cellSelectionHandler); @Override @SuppressWarnings("unchecked") void onContextMenu(final ContextMenuEvent event); }
|
DMNGridPanelContextMenuHandler implements ContextMenuHandler { @Override @SuppressWarnings("unchecked") public void onContextMenu(final ContextMenuEvent event) { event.preventDefault(); event.stopPropagation(); final int canvasX = getRelativeXOfEvent(event); final int canvasY = getRelativeYOfEvent(event); final boolean isShiftKeyDown = event.getNativeEvent().getShiftKey(); final boolean isControlKeyDown = event.getNativeEvent().getCtrlKey(); final List<CandidateGridWidget> candidateGridWidgets = new ArrayList<>(); for (GridWidget gridWidget : gridLayer.getGridWidgets()) { if (DynamicReadOnlyUtils.isOnlyVisualChangeAllowed(gridWidget)) { continue; } final GridData gridModel = gridWidget.getModel(); final Point2D ap = convertDOMToGridCoordinate(gridWidget, new Point2D(canvasX, canvasY)); final Integer uiHeaderRowIndex = getUiHeaderRowIndex(gridWidget, ap); final Integer uiColumnIndex = getUiColumnIndex(gridWidget, ap.getX()); if (Objects.nonNull(uiHeaderRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridColumn.HeaderMetaData hasCellEditorControls = gridModel.getColumns().get(uiColumnIndex).getHeaderMetaData().get(uiHeaderRowIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiHeaderRowIndex, uiColumnIndex, hasCellEditorControls, candidateGridWidgets, () -> cellSelectionHandler.selectHeaderCellIfRequired(uiHeaderRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } final Integer uiRowIndex = getUiRowIndex(gridWidget, ap.getY()); if (Objects.nonNull(uiRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridCell<?> hasCellEditorControls = gridModel.getCell(uiRowIndex, uiColumnIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiRowIndex, uiColumnIndex, gridWidget, candidateGridWidgets, () -> cellSelectionHandler.selectCellIfRequired(uiRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } } if (candidateGridWidgets.isEmpty()) { return; } final CandidateGridWidget candidateGridWidget = candidateGridWidgets.get(candidateGridWidgets.size() - 1); final Point2D ap = candidateGridWidget.ap; final int uiRowIndex = candidateGridWidget.uiRowIndex; final int uiColumnIndex = candidateGridWidget.uiColumnIndex; final Object binding = candidateGridWidget.binding; final HasCellEditorControls hasCellEditorControls = candidateGridWidget.hasCellEditorControls; final Optional<HasCellEditorControls.Editor> editor = hasCellEditorControls.getEditor(); editor.ifPresent(e -> { candidateGridWidget.ensureCellSelectedCommand.execute(); e.bind(binding, uiRowIndex, uiColumnIndex); cellEditorControls.show(e, (int) (ap.getX()), (int) (ap.getY())); }); } DMNGridPanelContextMenuHandler(final DMNGridLayer gridLayer,
final CellEditorControlsView.Presenter cellEditorControls,
final DMNGridPanelCellSelectionHandler cellSelectionHandler); @Override @SuppressWarnings("unchecked") void onContextMenu(final ContextMenuEvent event); }
|
@Test @SuppressWarnings("unchecked") public void checkSupportsDMNDiagram() { assertTrue(provider.supports(element)); final Element other = mock(Element.class); final Definition otherContent = mock(Definition.class); final TextAnnotation otherDefinition = mock(TextAnnotation.class); when(other.getContent()).thenReturn(otherContent); when(otherContent.getDefinition()).thenReturn(otherDefinition); assertFalse(provider.supports(other)); }
|
@Override public boolean supports(final Element<? extends Definition> element) { return DefinitionUtils.getElementDefinition(element) instanceof DMNDiagram; }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public boolean supports(final Element<? extends Definition> element) { return DefinitionUtils.getElementDefinition(element) instanceof DMNDiagram; } }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public boolean supports(final Element<? extends Definition> element) { return DefinitionUtils.getElementDefinition(element) instanceof DMNDiagram; } DMNDiagramTextPropertyProviderImpl(); @Inject DMNDiagramTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public boolean supports(final Element<? extends Definition> element) { return DefinitionUtils.getElementDefinition(element) instanceof DMNDiagram; } DMNDiagramTextPropertyProviderImpl(); @Inject DMNDiagramTextPropertyProviderImpl(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); }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public boolean supports(final Element<? extends Definition> element) { return DefinitionUtils.getElementDefinition(element) instanceof DMNDiagram; } DMNDiagramTextPropertyProviderImpl(); @Inject DMNDiagramTextPropertyProviderImpl(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); }
|
@Test public void checkReadGetsTextFromNameProperty() { provider.getText(element); verify(definitions).getNameHolder(); verify(nameHolder).getValue(); }
|
@Override public String getText(final Element<? extends Definition> element) { final DMNDiagram dmnDiagram = (DMNDiagram) DefinitionUtils.getElementDefinition(element); return dmnDiagram.getDefinitions().getNameHolder().getValue().getValue(); }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public String getText(final Element<? extends Definition> element) { final DMNDiagram dmnDiagram = (DMNDiagram) DefinitionUtils.getElementDefinition(element); return dmnDiagram.getDefinitions().getNameHolder().getValue().getValue(); } }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public String getText(final Element<? extends Definition> element) { final DMNDiagram dmnDiagram = (DMNDiagram) DefinitionUtils.getElementDefinition(element); return dmnDiagram.getDefinitions().getNameHolder().getValue().getValue(); } DMNDiagramTextPropertyProviderImpl(); @Inject DMNDiagramTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public String getText(final Element<? extends Definition> element) { final DMNDiagram dmnDiagram = (DMNDiagram) DefinitionUtils.getElementDefinition(element); return dmnDiagram.getDefinitions().getNameHolder().getValue().getValue(); } DMNDiagramTextPropertyProviderImpl(); @Inject DMNDiagramTextPropertyProviderImpl(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); }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public String getText(final Element<? extends Definition> element) { final DMNDiagram dmnDiagram = (DMNDiagram) DefinitionUtils.getElementDefinition(element); return dmnDiagram.getDefinitions().getNameHolder().getValue().getValue(); } DMNDiagramTextPropertyProviderImpl(); @Inject DMNDiagramTextPropertyProviderImpl(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); }
|
@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 = ((DMNDiagram) DefinitionUtils.getElementDefinition(element)).getDefinitions(); final CanvasCommand<AbstractCanvasHandler> command = canvasCommandFactory.updatePropertyValue(element, definitionUtils.getNameIdentifier(definition), new Name(NameUtils.normaliseName(text))); commandManager.execute(canvasHandler, command); }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public void setText(final AbstractCanvasHandler canvasHandler, final CanvasCommandManager<AbstractCanvasHandler> commandManager, final Element<? extends Definition> element, final String text) { final Object definition = ((DMNDiagram) DefinitionUtils.getElementDefinition(element)).getDefinitions(); final CanvasCommand<AbstractCanvasHandler> command = canvasCommandFactory.updatePropertyValue(element, definitionUtils.getNameIdentifier(definition), new Name(NameUtils.normaliseName(text))); commandManager.execute(canvasHandler, command); } }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public void setText(final AbstractCanvasHandler canvasHandler, final CanvasCommandManager<AbstractCanvasHandler> commandManager, final Element<? extends Definition> element, final String text) { final Object definition = ((DMNDiagram) DefinitionUtils.getElementDefinition(element)).getDefinitions(); final CanvasCommand<AbstractCanvasHandler> command = canvasCommandFactory.updatePropertyValue(element, definitionUtils.getNameIdentifier(definition), new Name(NameUtils.normaliseName(text))); commandManager.execute(canvasHandler, command); } DMNDiagramTextPropertyProviderImpl(); @Inject DMNDiagramTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public void setText(final AbstractCanvasHandler canvasHandler, final CanvasCommandManager<AbstractCanvasHandler> commandManager, final Element<? extends Definition> element, final String text) { final Object definition = ((DMNDiagram) DefinitionUtils.getElementDefinition(element)).getDefinitions(); final CanvasCommand<AbstractCanvasHandler> command = canvasCommandFactory.updatePropertyValue(element, definitionUtils.getNameIdentifier(definition), new Name(NameUtils.normaliseName(text))); commandManager.execute(canvasHandler, command); } DMNDiagramTextPropertyProviderImpl(); @Inject DMNDiagramTextPropertyProviderImpl(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); }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public void setText(final AbstractCanvasHandler canvasHandler, final CanvasCommandManager<AbstractCanvasHandler> commandManager, final Element<? extends Definition> element, final String text) { final Object definition = ((DMNDiagram) DefinitionUtils.getElementDefinition(element)).getDefinitions(); final CanvasCommand<AbstractCanvasHandler> command = canvasCommandFactory.updatePropertyValue(element, definitionUtils.getNameIdentifier(definition), new Name(NameUtils.normaliseName(text))); commandManager.execute(canvasHandler, command); } DMNDiagramTextPropertyProviderImpl(); @Inject DMNDiagramTextPropertyProviderImpl(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); }
|
@Test public void checkWriteUsesCommandToUpdateTextPropertyWithWhitespace() { provider.setText(canvasHandler, commandManager, element, NAME_VALUE_WITH_WHITESPACE); 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 = ((DMNDiagram) DefinitionUtils.getElementDefinition(element)).getDefinitions(); final CanvasCommand<AbstractCanvasHandler> command = canvasCommandFactory.updatePropertyValue(element, definitionUtils.getNameIdentifier(definition), new Name(NameUtils.normaliseName(text))); commandManager.execute(canvasHandler, command); }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public void setText(final AbstractCanvasHandler canvasHandler, final CanvasCommandManager<AbstractCanvasHandler> commandManager, final Element<? extends Definition> element, final String text) { final Object definition = ((DMNDiagram) DefinitionUtils.getElementDefinition(element)).getDefinitions(); final CanvasCommand<AbstractCanvasHandler> command = canvasCommandFactory.updatePropertyValue(element, definitionUtils.getNameIdentifier(definition), new Name(NameUtils.normaliseName(text))); commandManager.execute(canvasHandler, command); } }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public void setText(final AbstractCanvasHandler canvasHandler, final CanvasCommandManager<AbstractCanvasHandler> commandManager, final Element<? extends Definition> element, final String text) { final Object definition = ((DMNDiagram) DefinitionUtils.getElementDefinition(element)).getDefinitions(); final CanvasCommand<AbstractCanvasHandler> command = canvasCommandFactory.updatePropertyValue(element, definitionUtils.getNameIdentifier(definition), new Name(NameUtils.normaliseName(text))); commandManager.execute(canvasHandler, command); } DMNDiagramTextPropertyProviderImpl(); @Inject DMNDiagramTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public void setText(final AbstractCanvasHandler canvasHandler, final CanvasCommandManager<AbstractCanvasHandler> commandManager, final Element<? extends Definition> element, final String text) { final Object definition = ((DMNDiagram) DefinitionUtils.getElementDefinition(element)).getDefinitions(); final CanvasCommand<AbstractCanvasHandler> command = canvasCommandFactory.updatePropertyValue(element, definitionUtils.getNameIdentifier(definition), new Name(NameUtils.normaliseName(text))); commandManager.execute(canvasHandler, command); } DMNDiagramTextPropertyProviderImpl(); @Inject DMNDiagramTextPropertyProviderImpl(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); }
|
DMNDiagramTextPropertyProviderImpl implements TextPropertyProvider { @Override public void setText(final AbstractCanvasHandler canvasHandler, final CanvasCommandManager<AbstractCanvasHandler> commandManager, final Element<? extends Definition> element, final String text) { final Object definition = ((DMNDiagram) DefinitionUtils.getElementDefinition(element)).getDefinitions(); final CanvasCommand<AbstractCanvasHandler> command = canvasCommandFactory.updatePropertyValue(element, definitionUtils.getNameIdentifier(definition), new Name(NameUtils.normaliseName(text))); commandManager.execute(canvasHandler, command); } DMNDiagramTextPropertyProviderImpl(); @Inject DMNDiagramTextPropertyProviderImpl(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); }
|
@Test public void checkPriorityLessThanCatchAll() { assertTrue(provider.getPriority() < TextPropertyProviderFactory.CATCH_ALL_PRIORITY); }
|
@Override public int getPriority() { return 0; }
|
TextAnnotationTextPropertyProviderImpl implements TextPropertyProvider { @Override public int getPriority() { return 0; } }
|
TextAnnotationTextPropertyProviderImpl implements TextPropertyProvider { @Override public int getPriority() { return 0; } TextAnnotationTextPropertyProviderImpl(); @Inject TextAnnotationTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); }
|
TextAnnotationTextPropertyProviderImpl implements TextPropertyProvider { @Override public int getPriority() { return 0; } TextAnnotationTextPropertyProviderImpl(); @Inject TextAnnotationTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); @Override int getPriority(); @Override boolean supports(final Element<? extends Definition> element); @Override void setText(final AbstractCanvasHandler canvasHandler,
final CanvasCommandManager<AbstractCanvasHandler> commandManager,
final Element<? extends Definition> element,
final String text); @Override String getText(final Element<? extends Definition> element); }
|
TextAnnotationTextPropertyProviderImpl implements TextPropertyProvider { @Override public int getPriority() { return 0; } TextAnnotationTextPropertyProviderImpl(); @Inject TextAnnotationTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); @Override int getPriority(); @Override boolean supports(final Element<? extends Definition> element); @Override void setText(final AbstractCanvasHandler canvasHandler,
final CanvasCommandManager<AbstractCanvasHandler> commandManager,
final Element<? extends Definition> element,
final String text); @Override String getText(final Element<? extends Definition> element); }
|
@Test @SuppressWarnings("unchecked") public void checkSupportsTextAnnotationElements() { assertTrue(provider.supports(element)); final Element other = mock(Element.class); final Definition otherContent = mock(Definition.class); final InputData otherDefinition = mock(InputData.class); when(other.getContent()).thenReturn(otherContent); when(otherContent.getDefinition()).thenReturn(otherDefinition); assertFalse(provider.supports(other)); }
|
@Override public boolean supports(final Element<? extends Definition> element) { return DefinitionUtils.getElementDefinition(element) instanceof TextAnnotation; }
|
TextAnnotationTextPropertyProviderImpl implements TextPropertyProvider { @Override public boolean supports(final Element<? extends Definition> element) { return DefinitionUtils.getElementDefinition(element) instanceof TextAnnotation; } }
|
TextAnnotationTextPropertyProviderImpl implements TextPropertyProvider { @Override public boolean supports(final Element<? extends Definition> element) { return DefinitionUtils.getElementDefinition(element) instanceof TextAnnotation; } TextAnnotationTextPropertyProviderImpl(); @Inject TextAnnotationTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); }
|
TextAnnotationTextPropertyProviderImpl implements TextPropertyProvider { @Override public boolean supports(final Element<? extends Definition> element) { return DefinitionUtils.getElementDefinition(element) instanceof TextAnnotation; } TextAnnotationTextPropertyProviderImpl(); @Inject TextAnnotationTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); @Override int getPriority(); @Override boolean supports(final Element<? extends Definition> element); @Override void setText(final AbstractCanvasHandler canvasHandler,
final CanvasCommandManager<AbstractCanvasHandler> commandManager,
final Element<? extends Definition> element,
final String text); @Override String getText(final Element<? extends Definition> element); }
|
TextAnnotationTextPropertyProviderImpl implements TextPropertyProvider { @Override public boolean supports(final Element<? extends Definition> element) { return DefinitionUtils.getElementDefinition(element) instanceof TextAnnotation; } TextAnnotationTextPropertyProviderImpl(); @Inject TextAnnotationTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); @Override int getPriority(); @Override boolean supports(final Element<? extends Definition> element); @Override void setText(final AbstractCanvasHandler canvasHandler,
final CanvasCommandManager<AbstractCanvasHandler> commandManager,
final Element<? extends Definition> element,
final String text); @Override String getText(final Element<? extends Definition> element); }
|
@Test public void checkReadGetsTextFromTextProperty() { provider.getText(element); verify(text).getValue(); }
|
@Override public String getText(final Element<? extends Definition> element) { final TextAnnotation ta = (TextAnnotation) DefinitionUtils.getElementDefinition(element); final String text = ta.getText().getValue(); return text; }
|
TextAnnotationTextPropertyProviderImpl implements TextPropertyProvider { @Override public String getText(final Element<? extends Definition> element) { final TextAnnotation ta = (TextAnnotation) DefinitionUtils.getElementDefinition(element); final String text = ta.getText().getValue(); return text; } }
|
TextAnnotationTextPropertyProviderImpl implements TextPropertyProvider { @Override public String getText(final Element<? extends Definition> element) { final TextAnnotation ta = (TextAnnotation) DefinitionUtils.getElementDefinition(element); final String text = ta.getText().getValue(); return text; } TextAnnotationTextPropertyProviderImpl(); @Inject TextAnnotationTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); }
|
TextAnnotationTextPropertyProviderImpl implements TextPropertyProvider { @Override public String getText(final Element<? extends Definition> element) { final TextAnnotation ta = (TextAnnotation) DefinitionUtils.getElementDefinition(element); final String text = ta.getText().getValue(); return text; } TextAnnotationTextPropertyProviderImpl(); @Inject TextAnnotationTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); @Override int getPriority(); @Override boolean supports(final Element<? extends Definition> element); @Override void setText(final AbstractCanvasHandler canvasHandler,
final CanvasCommandManager<AbstractCanvasHandler> commandManager,
final Element<? extends Definition> element,
final String text); @Override String getText(final Element<? extends Definition> element); }
|
TextAnnotationTextPropertyProviderImpl implements TextPropertyProvider { @Override public String getText(final Element<? extends Definition> element) { final TextAnnotation ta = (TextAnnotation) DefinitionUtils.getElementDefinition(element); final String text = ta.getText().getValue(); return text; } TextAnnotationTextPropertyProviderImpl(); @Inject TextAnnotationTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); @Override int getPriority(); @Override boolean supports(final Element<? extends Definition> element); @Override void setText(final AbstractCanvasHandler canvasHandler,
final CanvasCommandManager<AbstractCanvasHandler> commandManager,
final Element<? extends Definition> element,
final String text); @Override String getText(final Element<? extends Definition> element); }
|
@Test public void checkWriteUsesCommandToUpdateTextProperty() { provider.setText(canvasHandler, commandManager, element, NAME_VALUE); verify(canvasCommandFactory).updatePropertyValue(element, NAME_FIELD, NAME_VALUE); 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), text); commandManager.execute(canvasHandler, command); }
|
TextAnnotationTextPropertyProviderImpl 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), text); commandManager.execute(canvasHandler, command); } }
|
TextAnnotationTextPropertyProviderImpl 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), text); commandManager.execute(canvasHandler, command); } TextAnnotationTextPropertyProviderImpl(); @Inject TextAnnotationTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); }
|
TextAnnotationTextPropertyProviderImpl 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), text); commandManager.execute(canvasHandler, command); } TextAnnotationTextPropertyProviderImpl(); @Inject TextAnnotationTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); @Override int getPriority(); @Override boolean supports(final Element<? extends Definition> element); @Override void setText(final AbstractCanvasHandler canvasHandler,
final CanvasCommandManager<AbstractCanvasHandler> commandManager,
final Element<? extends Definition> element,
final String text); @Override String getText(final Element<? extends Definition> element); }
|
TextAnnotationTextPropertyProviderImpl 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), text); commandManager.execute(canvasHandler, command); } TextAnnotationTextPropertyProviderImpl(); @Inject TextAnnotationTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
final DefinitionUtils definitionUtils); @Override int getPriority(); @Override boolean supports(final Element<? extends Definition> element); @Override void setText(final AbstractCanvasHandler canvasHandler,
final CanvasCommandManager<AbstractCanvasHandler> commandManager,
final Element<? extends Definition> element,
final String text); @Override String getText(final Element<? extends Definition> element); }
|
@Test public void testCopy() { final QNameHolder source = new QNameHolder(BuiltInType.BOOLEAN.asQName()); final QNameHolder target = source.copy(); assertNotNull(target); assertEquals(BuiltInType.BOOLEAN.asQName(), target.getValue()); }
|
public QNameHolder copy() { return new QNameHolder(Optional.ofNullable(value).map(QName::copy).orElse(null)); }
|
QNameHolder implements DMNProperty { public QNameHolder copy() { return new QNameHolder(Optional.ofNullable(value).map(QName::copy).orElse(null)); } }
|
QNameHolder implements DMNProperty { public QNameHolder copy() { return new QNameHolder(Optional.ofNullable(value).map(QName::copy).orElse(null)); } QNameHolder(); QNameHolder(final QName value); }
|
QNameHolder implements DMNProperty { public QNameHolder copy() { return new QNameHolder(Optional.ofNullable(value).map(QName::copy).orElse(null)); } QNameHolder(); QNameHolder(final QName value); QNameHolder copy(); PropertyType getType(); QName getValue(); void setValue(final QName value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
QNameHolder implements DMNProperty { public QNameHolder copy() { return new QNameHolder(Optional.ofNullable(value).map(QName::copy).orElse(null)); } QNameHolder(); QNameHolder(final QName value); QNameHolder copy(); PropertyType getType(); QName getValue(); void setValue(final QName value); @Override boolean equals(final Object o); @Override int hashCode(); @Type
static final PropertyType type; }
|
@Test public void testCopy() { final LocationURI source = new LocationURI(LOCATION_URI); final LocationURI target = source.copy(); assertNotNull(target); assertEquals(LOCATION_URI, target.getValue()); }
|
public LocationURI copy() { return new LocationURI(value); }
|
LocationURI implements DMNProperty { public LocationURI copy() { return new LocationURI(value); } }
|
LocationURI implements DMNProperty { public LocationURI copy() { return new LocationURI(value); } LocationURI(); LocationURI(final String value); }
|
LocationURI implements DMNProperty { public LocationURI copy() { return new LocationURI(value); } LocationURI(); LocationURI(final String value); LocationURI copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
LocationURI implements DMNProperty { public LocationURI copy() { return new LocationURI(value); } LocationURI(); LocationURI(final String value); LocationURI copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void onContextMenu_WithGridWidget_WithCellSelectionStrategy_CellAlreadySelected() { when(nativeEvent.getClientX()).thenReturn((int) (COLUMN0_WIDTH / 2)); when(nativeEvent.getClientY()).thenReturn((int) (ROW_HEIGHT + ROW_HEIGHT / 2)); final BaseGrid gridWidget = mockGridWidget(); when(gridLayer.getGridWidgets()).thenReturn(Collections.singleton(gridWidget)); gridWidget.selectCell(1, 0, false, false); final MockCell cell = mock(MockCell.class); final CellSelectionStrategy selectionStrategy = mock(CellSelectionStrategy.class); gridWidget.getModel().setCell(1, 0, () -> cell); when(cell.getEditor()).thenReturn(Optional.of(editor)); when(cell.getSelectionStrategy()).thenReturn(selectionStrategy); handler.onContextMenu(event); verify(selectionStrategy, never()).handleSelection(any(GridData.class), anyInt(), anyInt(), anyBoolean(), anyBoolean()); }
|
@Override @SuppressWarnings("unchecked") public void onContextMenu(final ContextMenuEvent event) { event.preventDefault(); event.stopPropagation(); final int canvasX = getRelativeXOfEvent(event); final int canvasY = getRelativeYOfEvent(event); final boolean isShiftKeyDown = event.getNativeEvent().getShiftKey(); final boolean isControlKeyDown = event.getNativeEvent().getCtrlKey(); final List<CandidateGridWidget> candidateGridWidgets = new ArrayList<>(); for (GridWidget gridWidget : gridLayer.getGridWidgets()) { if (DynamicReadOnlyUtils.isOnlyVisualChangeAllowed(gridWidget)) { continue; } final GridData gridModel = gridWidget.getModel(); final Point2D ap = convertDOMToGridCoordinate(gridWidget, new Point2D(canvasX, canvasY)); final Integer uiHeaderRowIndex = getUiHeaderRowIndex(gridWidget, ap); final Integer uiColumnIndex = getUiColumnIndex(gridWidget, ap.getX()); if (Objects.nonNull(uiHeaderRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridColumn.HeaderMetaData hasCellEditorControls = gridModel.getColumns().get(uiColumnIndex).getHeaderMetaData().get(uiHeaderRowIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiHeaderRowIndex, uiColumnIndex, hasCellEditorControls, candidateGridWidgets, () -> cellSelectionHandler.selectHeaderCellIfRequired(uiHeaderRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } final Integer uiRowIndex = getUiRowIndex(gridWidget, ap.getY()); if (Objects.nonNull(uiRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridCell<?> hasCellEditorControls = gridModel.getCell(uiRowIndex, uiColumnIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiRowIndex, uiColumnIndex, gridWidget, candidateGridWidgets, () -> cellSelectionHandler.selectCellIfRequired(uiRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } } if (candidateGridWidgets.isEmpty()) { return; } final CandidateGridWidget candidateGridWidget = candidateGridWidgets.get(candidateGridWidgets.size() - 1); final Point2D ap = candidateGridWidget.ap; final int uiRowIndex = candidateGridWidget.uiRowIndex; final int uiColumnIndex = candidateGridWidget.uiColumnIndex; final Object binding = candidateGridWidget.binding; final HasCellEditorControls hasCellEditorControls = candidateGridWidget.hasCellEditorControls; final Optional<HasCellEditorControls.Editor> editor = hasCellEditorControls.getEditor(); editor.ifPresent(e -> { candidateGridWidget.ensureCellSelectedCommand.execute(); e.bind(binding, uiRowIndex, uiColumnIndex); cellEditorControls.show(e, (int) (ap.getX()), (int) (ap.getY())); }); }
|
DMNGridPanelContextMenuHandler implements ContextMenuHandler { @Override @SuppressWarnings("unchecked") public void onContextMenu(final ContextMenuEvent event) { event.preventDefault(); event.stopPropagation(); final int canvasX = getRelativeXOfEvent(event); final int canvasY = getRelativeYOfEvent(event); final boolean isShiftKeyDown = event.getNativeEvent().getShiftKey(); final boolean isControlKeyDown = event.getNativeEvent().getCtrlKey(); final List<CandidateGridWidget> candidateGridWidgets = new ArrayList<>(); for (GridWidget gridWidget : gridLayer.getGridWidgets()) { if (DynamicReadOnlyUtils.isOnlyVisualChangeAllowed(gridWidget)) { continue; } final GridData gridModel = gridWidget.getModel(); final Point2D ap = convertDOMToGridCoordinate(gridWidget, new Point2D(canvasX, canvasY)); final Integer uiHeaderRowIndex = getUiHeaderRowIndex(gridWidget, ap); final Integer uiColumnIndex = getUiColumnIndex(gridWidget, ap.getX()); if (Objects.nonNull(uiHeaderRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridColumn.HeaderMetaData hasCellEditorControls = gridModel.getColumns().get(uiColumnIndex).getHeaderMetaData().get(uiHeaderRowIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiHeaderRowIndex, uiColumnIndex, hasCellEditorControls, candidateGridWidgets, () -> cellSelectionHandler.selectHeaderCellIfRequired(uiHeaderRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } final Integer uiRowIndex = getUiRowIndex(gridWidget, ap.getY()); if (Objects.nonNull(uiRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridCell<?> hasCellEditorControls = gridModel.getCell(uiRowIndex, uiColumnIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiRowIndex, uiColumnIndex, gridWidget, candidateGridWidgets, () -> cellSelectionHandler.selectCellIfRequired(uiRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } } if (candidateGridWidgets.isEmpty()) { return; } final CandidateGridWidget candidateGridWidget = candidateGridWidgets.get(candidateGridWidgets.size() - 1); final Point2D ap = candidateGridWidget.ap; final int uiRowIndex = candidateGridWidget.uiRowIndex; final int uiColumnIndex = candidateGridWidget.uiColumnIndex; final Object binding = candidateGridWidget.binding; final HasCellEditorControls hasCellEditorControls = candidateGridWidget.hasCellEditorControls; final Optional<HasCellEditorControls.Editor> editor = hasCellEditorControls.getEditor(); editor.ifPresent(e -> { candidateGridWidget.ensureCellSelectedCommand.execute(); e.bind(binding, uiRowIndex, uiColumnIndex); cellEditorControls.show(e, (int) (ap.getX()), (int) (ap.getY())); }); } }
|
DMNGridPanelContextMenuHandler implements ContextMenuHandler { @Override @SuppressWarnings("unchecked") public void onContextMenu(final ContextMenuEvent event) { event.preventDefault(); event.stopPropagation(); final int canvasX = getRelativeXOfEvent(event); final int canvasY = getRelativeYOfEvent(event); final boolean isShiftKeyDown = event.getNativeEvent().getShiftKey(); final boolean isControlKeyDown = event.getNativeEvent().getCtrlKey(); final List<CandidateGridWidget> candidateGridWidgets = new ArrayList<>(); for (GridWidget gridWidget : gridLayer.getGridWidgets()) { if (DynamicReadOnlyUtils.isOnlyVisualChangeAllowed(gridWidget)) { continue; } final GridData gridModel = gridWidget.getModel(); final Point2D ap = convertDOMToGridCoordinate(gridWidget, new Point2D(canvasX, canvasY)); final Integer uiHeaderRowIndex = getUiHeaderRowIndex(gridWidget, ap); final Integer uiColumnIndex = getUiColumnIndex(gridWidget, ap.getX()); if (Objects.nonNull(uiHeaderRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridColumn.HeaderMetaData hasCellEditorControls = gridModel.getColumns().get(uiColumnIndex).getHeaderMetaData().get(uiHeaderRowIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiHeaderRowIndex, uiColumnIndex, hasCellEditorControls, candidateGridWidgets, () -> cellSelectionHandler.selectHeaderCellIfRequired(uiHeaderRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } final Integer uiRowIndex = getUiRowIndex(gridWidget, ap.getY()); if (Objects.nonNull(uiRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridCell<?> hasCellEditorControls = gridModel.getCell(uiRowIndex, uiColumnIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiRowIndex, uiColumnIndex, gridWidget, candidateGridWidgets, () -> cellSelectionHandler.selectCellIfRequired(uiRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } } if (candidateGridWidgets.isEmpty()) { return; } final CandidateGridWidget candidateGridWidget = candidateGridWidgets.get(candidateGridWidgets.size() - 1); final Point2D ap = candidateGridWidget.ap; final int uiRowIndex = candidateGridWidget.uiRowIndex; final int uiColumnIndex = candidateGridWidget.uiColumnIndex; final Object binding = candidateGridWidget.binding; final HasCellEditorControls hasCellEditorControls = candidateGridWidget.hasCellEditorControls; final Optional<HasCellEditorControls.Editor> editor = hasCellEditorControls.getEditor(); editor.ifPresent(e -> { candidateGridWidget.ensureCellSelectedCommand.execute(); e.bind(binding, uiRowIndex, uiColumnIndex); cellEditorControls.show(e, (int) (ap.getX()), (int) (ap.getY())); }); } DMNGridPanelContextMenuHandler(final DMNGridLayer gridLayer,
final CellEditorControlsView.Presenter cellEditorControls,
final DMNGridPanelCellSelectionHandler cellSelectionHandler); }
|
DMNGridPanelContextMenuHandler implements ContextMenuHandler { @Override @SuppressWarnings("unchecked") public void onContextMenu(final ContextMenuEvent event) { event.preventDefault(); event.stopPropagation(); final int canvasX = getRelativeXOfEvent(event); final int canvasY = getRelativeYOfEvent(event); final boolean isShiftKeyDown = event.getNativeEvent().getShiftKey(); final boolean isControlKeyDown = event.getNativeEvent().getCtrlKey(); final List<CandidateGridWidget> candidateGridWidgets = new ArrayList<>(); for (GridWidget gridWidget : gridLayer.getGridWidgets()) { if (DynamicReadOnlyUtils.isOnlyVisualChangeAllowed(gridWidget)) { continue; } final GridData gridModel = gridWidget.getModel(); final Point2D ap = convertDOMToGridCoordinate(gridWidget, new Point2D(canvasX, canvasY)); final Integer uiHeaderRowIndex = getUiHeaderRowIndex(gridWidget, ap); final Integer uiColumnIndex = getUiColumnIndex(gridWidget, ap.getX()); if (Objects.nonNull(uiHeaderRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridColumn.HeaderMetaData hasCellEditorControls = gridModel.getColumns().get(uiColumnIndex).getHeaderMetaData().get(uiHeaderRowIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiHeaderRowIndex, uiColumnIndex, hasCellEditorControls, candidateGridWidgets, () -> cellSelectionHandler.selectHeaderCellIfRequired(uiHeaderRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } final Integer uiRowIndex = getUiRowIndex(gridWidget, ap.getY()); if (Objects.nonNull(uiRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridCell<?> hasCellEditorControls = gridModel.getCell(uiRowIndex, uiColumnIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiRowIndex, uiColumnIndex, gridWidget, candidateGridWidgets, () -> cellSelectionHandler.selectCellIfRequired(uiRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } } if (candidateGridWidgets.isEmpty()) { return; } final CandidateGridWidget candidateGridWidget = candidateGridWidgets.get(candidateGridWidgets.size() - 1); final Point2D ap = candidateGridWidget.ap; final int uiRowIndex = candidateGridWidget.uiRowIndex; final int uiColumnIndex = candidateGridWidget.uiColumnIndex; final Object binding = candidateGridWidget.binding; final HasCellEditorControls hasCellEditorControls = candidateGridWidget.hasCellEditorControls; final Optional<HasCellEditorControls.Editor> editor = hasCellEditorControls.getEditor(); editor.ifPresent(e -> { candidateGridWidget.ensureCellSelectedCommand.execute(); e.bind(binding, uiRowIndex, uiColumnIndex); cellEditorControls.show(e, (int) (ap.getX()), (int) (ap.getY())); }); } DMNGridPanelContextMenuHandler(final DMNGridLayer gridLayer,
final CellEditorControlsView.Presenter cellEditorControls,
final DMNGridPanelCellSelectionHandler cellSelectionHandler); @Override @SuppressWarnings("unchecked") void onContextMenu(final ContextMenuEvent event); }
|
DMNGridPanelContextMenuHandler implements ContextMenuHandler { @Override @SuppressWarnings("unchecked") public void onContextMenu(final ContextMenuEvent event) { event.preventDefault(); event.stopPropagation(); final int canvasX = getRelativeXOfEvent(event); final int canvasY = getRelativeYOfEvent(event); final boolean isShiftKeyDown = event.getNativeEvent().getShiftKey(); final boolean isControlKeyDown = event.getNativeEvent().getCtrlKey(); final List<CandidateGridWidget> candidateGridWidgets = new ArrayList<>(); for (GridWidget gridWidget : gridLayer.getGridWidgets()) { if (DynamicReadOnlyUtils.isOnlyVisualChangeAllowed(gridWidget)) { continue; } final GridData gridModel = gridWidget.getModel(); final Point2D ap = convertDOMToGridCoordinate(gridWidget, new Point2D(canvasX, canvasY)); final Integer uiHeaderRowIndex = getUiHeaderRowIndex(gridWidget, ap); final Integer uiColumnIndex = getUiColumnIndex(gridWidget, ap.getX()); if (Objects.nonNull(uiHeaderRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridColumn.HeaderMetaData hasCellEditorControls = gridModel.getColumns().get(uiColumnIndex).getHeaderMetaData().get(uiHeaderRowIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiHeaderRowIndex, uiColumnIndex, hasCellEditorControls, candidateGridWidgets, () -> cellSelectionHandler.selectHeaderCellIfRequired(uiHeaderRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } final Integer uiRowIndex = getUiRowIndex(gridWidget, ap.getY()); if (Objects.nonNull(uiRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridCell<?> hasCellEditorControls = gridModel.getCell(uiRowIndex, uiColumnIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiRowIndex, uiColumnIndex, gridWidget, candidateGridWidgets, () -> cellSelectionHandler.selectCellIfRequired(uiRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } } if (candidateGridWidgets.isEmpty()) { return; } final CandidateGridWidget candidateGridWidget = candidateGridWidgets.get(candidateGridWidgets.size() - 1); final Point2D ap = candidateGridWidget.ap; final int uiRowIndex = candidateGridWidget.uiRowIndex; final int uiColumnIndex = candidateGridWidget.uiColumnIndex; final Object binding = candidateGridWidget.binding; final HasCellEditorControls hasCellEditorControls = candidateGridWidget.hasCellEditorControls; final Optional<HasCellEditorControls.Editor> editor = hasCellEditorControls.getEditor(); editor.ifPresent(e -> { candidateGridWidget.ensureCellSelectedCommand.execute(); e.bind(binding, uiRowIndex, uiColumnIndex); cellEditorControls.show(e, (int) (ap.getX()), (int) (ap.getY())); }); } DMNGridPanelContextMenuHandler(final DMNGridLayer gridLayer,
final CellEditorControlsView.Presenter cellEditorControls,
final DMNGridPanelCellSelectionHandler cellSelectionHandler); @Override @SuppressWarnings("unchecked") void onContextMenu(final ContextMenuEvent event); }
|
@Test public void testTypeName() { assertEquals(NameFieldType.NAME, new NameFieldType().getTypeName()); }
|
@Override public String getTypeName() { return NAME; }
|
NameFieldType implements FieldType { @Override public String getTypeName() { return NAME; } }
|
NameFieldType implements FieldType { @Override public String getTypeName() { return NAME; } }
|
NameFieldType implements FieldType { @Override public String getTypeName() { return NAME; } @Override String getTypeName(); }
|
NameFieldType implements FieldType { @Override public String getTypeName() { return NAME; } @Override String getTypeName(); static final String NAME; }
|
@Test public void testDefaultConstructor() { assertNotNull(holder4.getValue()); assertEquals(NameHolder.DEFAULT_NAME, holder4.getValue().getValue()); }
|
public Name getValue() { return value; }
|
NameHolder implements DMNProperty { public Name getValue() { return value; } }
|
NameHolder implements DMNProperty { public Name getValue() { return value; } NameHolder(); NameHolder(final Name value); }
|
NameHolder implements DMNProperty { public Name getValue() { return value; } NameHolder(); NameHolder(final Name value); NameHolder copy(); Name getValue(); void setValue(final Name value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
NameHolder implements DMNProperty { public Name getValue() { return value; } NameHolder(); NameHolder(final Name value); NameHolder copy(); Name getValue(); void setValue(final Name value); @Override boolean equals(final Object o); @Override int hashCode(); static final String DEFAULT_NAME; @Type
static final PropertyType type; }
|
@Test public void testGetValue() { assertEquals(NAME, holder1.getValue().getValue()); }
|
public Name getValue() { return value; }
|
NameHolder implements DMNProperty { public Name getValue() { return value; } }
|
NameHolder implements DMNProperty { public Name getValue() { return value; } NameHolder(); NameHolder(final Name value); }
|
NameHolder implements DMNProperty { public Name getValue() { return value; } NameHolder(); NameHolder(final Name value); NameHolder copy(); Name getValue(); void setValue(final Name value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
NameHolder implements DMNProperty { public Name getValue() { return value; } NameHolder(); NameHolder(final Name value); NameHolder copy(); Name getValue(); void setValue(final Name value); @Override boolean equals(final Object o); @Override int hashCode(); static final String DEFAULT_NAME; @Type
static final PropertyType type; }
|
@Test public void testSetValue() { holder1.setValue(new Name()); assertEquals("", holder1.getValue().getValue()); }
|
public void setValue(final Name value) { this.value = value; }
|
NameHolder implements DMNProperty { public void setValue(final Name value) { this.value = value; } }
|
NameHolder implements DMNProperty { public void setValue(final Name value) { this.value = value; } NameHolder(); NameHolder(final Name value); }
|
NameHolder implements DMNProperty { public void setValue(final Name value) { this.value = value; } NameHolder(); NameHolder(final Name value); NameHolder copy(); Name getValue(); void setValue(final Name value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
NameHolder implements DMNProperty { public void setValue(final Name value) { this.value = value; } NameHolder(); NameHolder(final Name value); NameHolder copy(); Name getValue(); void setValue(final Name value); @Override boolean equals(final Object o); @Override int hashCode(); static final String DEFAULT_NAME; @Type
static final PropertyType type; }
|
@Test public void testEquals() { assertEquals(holder1, holder1); assertEquals(holder1, holder2); assertNotEquals(holder1, holder3); assertNotEquals(holder2, holder3); assertNotEquals(holder1, "Cheese"); }
|
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof NameHolder)) { return false; } final NameHolder name = (NameHolder) o; return Objects.equals(value, name.value); }
|
NameHolder implements DMNProperty { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof NameHolder)) { return false; } final NameHolder name = (NameHolder) o; return Objects.equals(value, name.value); } }
|
NameHolder implements DMNProperty { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof NameHolder)) { return false; } final NameHolder name = (NameHolder) o; return Objects.equals(value, name.value); } NameHolder(); NameHolder(final Name value); }
|
NameHolder implements DMNProperty { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof NameHolder)) { return false; } final NameHolder name = (NameHolder) o; return Objects.equals(value, name.value); } NameHolder(); NameHolder(final Name value); NameHolder copy(); Name getValue(); void setValue(final Name value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
NameHolder implements DMNProperty { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof NameHolder)) { return false; } final NameHolder name = (NameHolder) o; return Objects.equals(value, name.value); } NameHolder(); NameHolder(final Name value); NameHolder copy(); Name getValue(); void setValue(final Name value); @Override boolean equals(final Object o); @Override int hashCode(); static final String DEFAULT_NAME; @Type
static final PropertyType type; }
|
@Test public void testHashCode() { assertEquals(holder1.hashCode(), holder2.hashCode()); assertNotEquals(holder1.hashCode(), holder3.hashCode()); assertNotEquals(holder2.hashCode(), holder3.hashCode()); }
|
@Override public int hashCode() { return HashUtil.combineHashCodes(value != null ? value.hashCode() : 0); }
|
NameHolder implements DMNProperty { @Override public int hashCode() { return HashUtil.combineHashCodes(value != null ? value.hashCode() : 0); } }
|
NameHolder implements DMNProperty { @Override public int hashCode() { return HashUtil.combineHashCodes(value != null ? value.hashCode() : 0); } NameHolder(); NameHolder(final Name value); }
|
NameHolder implements DMNProperty { @Override public int hashCode() { return HashUtil.combineHashCodes(value != null ? value.hashCode() : 0); } NameHolder(); NameHolder(final Name value); NameHolder copy(); Name getValue(); void setValue(final Name value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
NameHolder implements DMNProperty { @Override public int hashCode() { return HashUtil.combineHashCodes(value != null ? value.hashCode() : 0); } NameHolder(); NameHolder(final Name value); NameHolder copy(); Name getValue(); void setValue(final Name value); @Override boolean equals(final Object o); @Override int hashCode(); static final String DEFAULT_NAME; @Type
static final PropertyType type; }
|
@Test public void testCopy() { final NameHolder source = new NameHolder(new Name(NAME)); final NameHolder target = source.copy(); assertNotNull(target); assertEquals(NAME, target.getValue().getValue()); }
|
public NameHolder copy() { return new NameHolder(Optional.ofNullable(value).map(Name::copy).orElse(null)); }
|
NameHolder implements DMNProperty { public NameHolder copy() { return new NameHolder(Optional.ofNullable(value).map(Name::copy).orElse(null)); } }
|
NameHolder implements DMNProperty { public NameHolder copy() { return new NameHolder(Optional.ofNullable(value).map(Name::copy).orElse(null)); } NameHolder(); NameHolder(final Name value); }
|
NameHolder implements DMNProperty { public NameHolder copy() { return new NameHolder(Optional.ofNullable(value).map(Name::copy).orElse(null)); } NameHolder(); NameHolder(final Name value); NameHolder copy(); Name getValue(); void setValue(final Name value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
NameHolder implements DMNProperty { public NameHolder copy() { return new NameHolder(Optional.ofNullable(value).map(Name::copy).orElse(null)); } NameHolder(); NameHolder(final Name value); NameHolder copy(); Name getValue(); void setValue(final Name value); @Override boolean equals(final Object o); @Override int hashCode(); static final String DEFAULT_NAME; @Type
static final PropertyType type; }
|
@Test public void testCopy() { final Question source = new Question(QUESTION_VALUE); final Question target = source.copy(); assertNotNull(target); assertEquals(QUESTION_VALUE, target.getValue()); }
|
public Question copy() { return new Question(value); }
|
Question implements DMNProperty { public Question copy() { return new Question(value); } }
|
Question implements DMNProperty { public Question copy() { return new Question(value); } Question(); Question(final String value); }
|
Question implements DMNProperty { public Question copy() { return new Question(value); } Question(); Question(final String value); Question copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
Question implements DMNProperty { public Question copy() { return new Question(value); } Question(); Question(final String value); Question copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testZeroParameterConstructor() { this.expressionLanguage = new ExpressionLanguage(); assertEquals("", expressionLanguage.getValue()); }
|
public String getValue() { return value; }
|
ExpressionLanguage implements DMNProperty { public String getValue() { return value; } }
|
ExpressionLanguage implements DMNProperty { public String getValue() { return value; } ExpressionLanguage(); ExpressionLanguage(final String value); }
|
ExpressionLanguage implements DMNProperty { public String getValue() { return value; } ExpressionLanguage(); ExpressionLanguage(final String value); ExpressionLanguage copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
ExpressionLanguage implements DMNProperty { public String getValue() { return value; } ExpressionLanguage(); ExpressionLanguage(final String value); ExpressionLanguage copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testOneParameterConstructor() { this.expressionLanguage = new ExpressionLanguage(VALUE); assertEquals(VALUE, expressionLanguage.getValue()); }
|
public String getValue() { return value; }
|
ExpressionLanguage implements DMNProperty { public String getValue() { return value; } }
|
ExpressionLanguage implements DMNProperty { public String getValue() { return value; } ExpressionLanguage(); ExpressionLanguage(final String value); }
|
ExpressionLanguage implements DMNProperty { public String getValue() { return value; } ExpressionLanguage(); ExpressionLanguage(final String value); ExpressionLanguage copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
ExpressionLanguage implements DMNProperty { public String getValue() { return value; } ExpressionLanguage(); ExpressionLanguage(final String value); ExpressionLanguage copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test @SuppressWarnings("unchecked") public void onContextMenu_WithMultipleOverlappingGridWidgets() { final int EVENT_X = (int) (COLUMN0_WIDTH / 2); final int EVENT_Y = (int) (HEADER_HEIGHT + ROW_HEIGHT + ROW_HEIGHT / 2); when(nativeEvent.getClientX()).thenReturn(EVENT_X); when(nativeEvent.getClientY()).thenReturn(EVENT_Y); final BaseGrid gridWidget1 = mockGridWidget(); final BaseGrid gridWidget2 = mockGridWidget(); final Set<GridWidget> gridWidgets = new LinkedHashSet<>(); gridWidgets.add(gridWidget1); gridWidgets.add(gridWidget2); when(gridLayer.getGridWidgets()).thenReturn(gridWidgets); final MockCell cell1 = mock(MockCell.class); gridWidget1.getModel().setCell(1, 0, () -> cell1); when(cell1.getEditor()).thenReturn(Optional.of(editor)); final MockCell cell2 = mock(MockCell.class); gridWidget2.getModel().setCell(1, 0, () -> cell2); when(cell2.getEditor()).thenReturn(Optional.of(editor)); handler.onContextMenu(event); verify(editor).bind(eq(gridWidget2), eq(1), eq(0)); verify(cellEditorControls).show(eq(editor), eq(EVENT_X), eq(EVENT_Y)); }
|
@Override @SuppressWarnings("unchecked") public void onContextMenu(final ContextMenuEvent event) { event.preventDefault(); event.stopPropagation(); final int canvasX = getRelativeXOfEvent(event); final int canvasY = getRelativeYOfEvent(event); final boolean isShiftKeyDown = event.getNativeEvent().getShiftKey(); final boolean isControlKeyDown = event.getNativeEvent().getCtrlKey(); final List<CandidateGridWidget> candidateGridWidgets = new ArrayList<>(); for (GridWidget gridWidget : gridLayer.getGridWidgets()) { if (DynamicReadOnlyUtils.isOnlyVisualChangeAllowed(gridWidget)) { continue; } final GridData gridModel = gridWidget.getModel(); final Point2D ap = convertDOMToGridCoordinate(gridWidget, new Point2D(canvasX, canvasY)); final Integer uiHeaderRowIndex = getUiHeaderRowIndex(gridWidget, ap); final Integer uiColumnIndex = getUiColumnIndex(gridWidget, ap.getX()); if (Objects.nonNull(uiHeaderRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridColumn.HeaderMetaData hasCellEditorControls = gridModel.getColumns().get(uiColumnIndex).getHeaderMetaData().get(uiHeaderRowIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiHeaderRowIndex, uiColumnIndex, hasCellEditorControls, candidateGridWidgets, () -> cellSelectionHandler.selectHeaderCellIfRequired(uiHeaderRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } final Integer uiRowIndex = getUiRowIndex(gridWidget, ap.getY()); if (Objects.nonNull(uiRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridCell<?> hasCellEditorControls = gridModel.getCell(uiRowIndex, uiColumnIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiRowIndex, uiColumnIndex, gridWidget, candidateGridWidgets, () -> cellSelectionHandler.selectCellIfRequired(uiRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } } if (candidateGridWidgets.isEmpty()) { return; } final CandidateGridWidget candidateGridWidget = candidateGridWidgets.get(candidateGridWidgets.size() - 1); final Point2D ap = candidateGridWidget.ap; final int uiRowIndex = candidateGridWidget.uiRowIndex; final int uiColumnIndex = candidateGridWidget.uiColumnIndex; final Object binding = candidateGridWidget.binding; final HasCellEditorControls hasCellEditorControls = candidateGridWidget.hasCellEditorControls; final Optional<HasCellEditorControls.Editor> editor = hasCellEditorControls.getEditor(); editor.ifPresent(e -> { candidateGridWidget.ensureCellSelectedCommand.execute(); e.bind(binding, uiRowIndex, uiColumnIndex); cellEditorControls.show(e, (int) (ap.getX()), (int) (ap.getY())); }); }
|
DMNGridPanelContextMenuHandler implements ContextMenuHandler { @Override @SuppressWarnings("unchecked") public void onContextMenu(final ContextMenuEvent event) { event.preventDefault(); event.stopPropagation(); final int canvasX = getRelativeXOfEvent(event); final int canvasY = getRelativeYOfEvent(event); final boolean isShiftKeyDown = event.getNativeEvent().getShiftKey(); final boolean isControlKeyDown = event.getNativeEvent().getCtrlKey(); final List<CandidateGridWidget> candidateGridWidgets = new ArrayList<>(); for (GridWidget gridWidget : gridLayer.getGridWidgets()) { if (DynamicReadOnlyUtils.isOnlyVisualChangeAllowed(gridWidget)) { continue; } final GridData gridModel = gridWidget.getModel(); final Point2D ap = convertDOMToGridCoordinate(gridWidget, new Point2D(canvasX, canvasY)); final Integer uiHeaderRowIndex = getUiHeaderRowIndex(gridWidget, ap); final Integer uiColumnIndex = getUiColumnIndex(gridWidget, ap.getX()); if (Objects.nonNull(uiHeaderRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridColumn.HeaderMetaData hasCellEditorControls = gridModel.getColumns().get(uiColumnIndex).getHeaderMetaData().get(uiHeaderRowIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiHeaderRowIndex, uiColumnIndex, hasCellEditorControls, candidateGridWidgets, () -> cellSelectionHandler.selectHeaderCellIfRequired(uiHeaderRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } final Integer uiRowIndex = getUiRowIndex(gridWidget, ap.getY()); if (Objects.nonNull(uiRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridCell<?> hasCellEditorControls = gridModel.getCell(uiRowIndex, uiColumnIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiRowIndex, uiColumnIndex, gridWidget, candidateGridWidgets, () -> cellSelectionHandler.selectCellIfRequired(uiRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } } if (candidateGridWidgets.isEmpty()) { return; } final CandidateGridWidget candidateGridWidget = candidateGridWidgets.get(candidateGridWidgets.size() - 1); final Point2D ap = candidateGridWidget.ap; final int uiRowIndex = candidateGridWidget.uiRowIndex; final int uiColumnIndex = candidateGridWidget.uiColumnIndex; final Object binding = candidateGridWidget.binding; final HasCellEditorControls hasCellEditorControls = candidateGridWidget.hasCellEditorControls; final Optional<HasCellEditorControls.Editor> editor = hasCellEditorControls.getEditor(); editor.ifPresent(e -> { candidateGridWidget.ensureCellSelectedCommand.execute(); e.bind(binding, uiRowIndex, uiColumnIndex); cellEditorControls.show(e, (int) (ap.getX()), (int) (ap.getY())); }); } }
|
DMNGridPanelContextMenuHandler implements ContextMenuHandler { @Override @SuppressWarnings("unchecked") public void onContextMenu(final ContextMenuEvent event) { event.preventDefault(); event.stopPropagation(); final int canvasX = getRelativeXOfEvent(event); final int canvasY = getRelativeYOfEvent(event); final boolean isShiftKeyDown = event.getNativeEvent().getShiftKey(); final boolean isControlKeyDown = event.getNativeEvent().getCtrlKey(); final List<CandidateGridWidget> candidateGridWidgets = new ArrayList<>(); for (GridWidget gridWidget : gridLayer.getGridWidgets()) { if (DynamicReadOnlyUtils.isOnlyVisualChangeAllowed(gridWidget)) { continue; } final GridData gridModel = gridWidget.getModel(); final Point2D ap = convertDOMToGridCoordinate(gridWidget, new Point2D(canvasX, canvasY)); final Integer uiHeaderRowIndex = getUiHeaderRowIndex(gridWidget, ap); final Integer uiColumnIndex = getUiColumnIndex(gridWidget, ap.getX()); if (Objects.nonNull(uiHeaderRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridColumn.HeaderMetaData hasCellEditorControls = gridModel.getColumns().get(uiColumnIndex).getHeaderMetaData().get(uiHeaderRowIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiHeaderRowIndex, uiColumnIndex, hasCellEditorControls, candidateGridWidgets, () -> cellSelectionHandler.selectHeaderCellIfRequired(uiHeaderRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } final Integer uiRowIndex = getUiRowIndex(gridWidget, ap.getY()); if (Objects.nonNull(uiRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridCell<?> hasCellEditorControls = gridModel.getCell(uiRowIndex, uiColumnIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiRowIndex, uiColumnIndex, gridWidget, candidateGridWidgets, () -> cellSelectionHandler.selectCellIfRequired(uiRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } } if (candidateGridWidgets.isEmpty()) { return; } final CandidateGridWidget candidateGridWidget = candidateGridWidgets.get(candidateGridWidgets.size() - 1); final Point2D ap = candidateGridWidget.ap; final int uiRowIndex = candidateGridWidget.uiRowIndex; final int uiColumnIndex = candidateGridWidget.uiColumnIndex; final Object binding = candidateGridWidget.binding; final HasCellEditorControls hasCellEditorControls = candidateGridWidget.hasCellEditorControls; final Optional<HasCellEditorControls.Editor> editor = hasCellEditorControls.getEditor(); editor.ifPresent(e -> { candidateGridWidget.ensureCellSelectedCommand.execute(); e.bind(binding, uiRowIndex, uiColumnIndex); cellEditorControls.show(e, (int) (ap.getX()), (int) (ap.getY())); }); } DMNGridPanelContextMenuHandler(final DMNGridLayer gridLayer,
final CellEditorControlsView.Presenter cellEditorControls,
final DMNGridPanelCellSelectionHandler cellSelectionHandler); }
|
DMNGridPanelContextMenuHandler implements ContextMenuHandler { @Override @SuppressWarnings("unchecked") public void onContextMenu(final ContextMenuEvent event) { event.preventDefault(); event.stopPropagation(); final int canvasX = getRelativeXOfEvent(event); final int canvasY = getRelativeYOfEvent(event); final boolean isShiftKeyDown = event.getNativeEvent().getShiftKey(); final boolean isControlKeyDown = event.getNativeEvent().getCtrlKey(); final List<CandidateGridWidget> candidateGridWidgets = new ArrayList<>(); for (GridWidget gridWidget : gridLayer.getGridWidgets()) { if (DynamicReadOnlyUtils.isOnlyVisualChangeAllowed(gridWidget)) { continue; } final GridData gridModel = gridWidget.getModel(); final Point2D ap = convertDOMToGridCoordinate(gridWidget, new Point2D(canvasX, canvasY)); final Integer uiHeaderRowIndex = getUiHeaderRowIndex(gridWidget, ap); final Integer uiColumnIndex = getUiColumnIndex(gridWidget, ap.getX()); if (Objects.nonNull(uiHeaderRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridColumn.HeaderMetaData hasCellEditorControls = gridModel.getColumns().get(uiColumnIndex).getHeaderMetaData().get(uiHeaderRowIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiHeaderRowIndex, uiColumnIndex, hasCellEditorControls, candidateGridWidgets, () -> cellSelectionHandler.selectHeaderCellIfRequired(uiHeaderRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } final Integer uiRowIndex = getUiRowIndex(gridWidget, ap.getY()); if (Objects.nonNull(uiRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridCell<?> hasCellEditorControls = gridModel.getCell(uiRowIndex, uiColumnIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiRowIndex, uiColumnIndex, gridWidget, candidateGridWidgets, () -> cellSelectionHandler.selectCellIfRequired(uiRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } } if (candidateGridWidgets.isEmpty()) { return; } final CandidateGridWidget candidateGridWidget = candidateGridWidgets.get(candidateGridWidgets.size() - 1); final Point2D ap = candidateGridWidget.ap; final int uiRowIndex = candidateGridWidget.uiRowIndex; final int uiColumnIndex = candidateGridWidget.uiColumnIndex; final Object binding = candidateGridWidget.binding; final HasCellEditorControls hasCellEditorControls = candidateGridWidget.hasCellEditorControls; final Optional<HasCellEditorControls.Editor> editor = hasCellEditorControls.getEditor(); editor.ifPresent(e -> { candidateGridWidget.ensureCellSelectedCommand.execute(); e.bind(binding, uiRowIndex, uiColumnIndex); cellEditorControls.show(e, (int) (ap.getX()), (int) (ap.getY())); }); } DMNGridPanelContextMenuHandler(final DMNGridLayer gridLayer,
final CellEditorControlsView.Presenter cellEditorControls,
final DMNGridPanelCellSelectionHandler cellSelectionHandler); @Override @SuppressWarnings("unchecked") void onContextMenu(final ContextMenuEvent event); }
|
DMNGridPanelContextMenuHandler implements ContextMenuHandler { @Override @SuppressWarnings("unchecked") public void onContextMenu(final ContextMenuEvent event) { event.preventDefault(); event.stopPropagation(); final int canvasX = getRelativeXOfEvent(event); final int canvasY = getRelativeYOfEvent(event); final boolean isShiftKeyDown = event.getNativeEvent().getShiftKey(); final boolean isControlKeyDown = event.getNativeEvent().getCtrlKey(); final List<CandidateGridWidget> candidateGridWidgets = new ArrayList<>(); for (GridWidget gridWidget : gridLayer.getGridWidgets()) { if (DynamicReadOnlyUtils.isOnlyVisualChangeAllowed(gridWidget)) { continue; } final GridData gridModel = gridWidget.getModel(); final Point2D ap = convertDOMToGridCoordinate(gridWidget, new Point2D(canvasX, canvasY)); final Integer uiHeaderRowIndex = getUiHeaderRowIndex(gridWidget, ap); final Integer uiColumnIndex = getUiColumnIndex(gridWidget, ap.getX()); if (Objects.nonNull(uiHeaderRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridColumn.HeaderMetaData hasCellEditorControls = gridModel.getColumns().get(uiColumnIndex).getHeaderMetaData().get(uiHeaderRowIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiHeaderRowIndex, uiColumnIndex, hasCellEditorControls, candidateGridWidgets, () -> cellSelectionHandler.selectHeaderCellIfRequired(uiHeaderRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } final Integer uiRowIndex = getUiRowIndex(gridWidget, ap.getY()); if (Objects.nonNull(uiRowIndex) && Objects.nonNull(uiColumnIndex)) { final GridCell<?> hasCellEditorControls = gridModel.getCell(uiRowIndex, uiColumnIndex); registerCandidateGridWidget(hasCellEditorControls, gridWidget.getComputedLocation().add(ap), uiRowIndex, uiColumnIndex, gridWidget, candidateGridWidgets, () -> cellSelectionHandler.selectCellIfRequired(uiRowIndex, uiColumnIndex, gridWidget, isShiftKeyDown, isControlKeyDown)); } } if (candidateGridWidgets.isEmpty()) { return; } final CandidateGridWidget candidateGridWidget = candidateGridWidgets.get(candidateGridWidgets.size() - 1); final Point2D ap = candidateGridWidget.ap; final int uiRowIndex = candidateGridWidget.uiRowIndex; final int uiColumnIndex = candidateGridWidget.uiColumnIndex; final Object binding = candidateGridWidget.binding; final HasCellEditorControls hasCellEditorControls = candidateGridWidget.hasCellEditorControls; final Optional<HasCellEditorControls.Editor> editor = hasCellEditorControls.getEditor(); editor.ifPresent(e -> { candidateGridWidget.ensureCellSelectedCommand.execute(); e.bind(binding, uiRowIndex, uiColumnIndex); cellEditorControls.show(e, (int) (ap.getX()), (int) (ap.getY())); }); } DMNGridPanelContextMenuHandler(final DMNGridLayer gridLayer,
final CellEditorControlsView.Presenter cellEditorControls,
final DMNGridPanelCellSelectionHandler cellSelectionHandler); @Override @SuppressWarnings("unchecked") void onContextMenu(final ContextMenuEvent event); }
|
@Test public void testGetStandaloneRootPath() { final Path path = mock(Path.class); final org.uberfire.java.nio.file.Path expectedPath = mock(org.uberfire.java.nio.file.Path.class); doReturn(path).when(pathsHelper).newPath(STANDALONE_FILE_NAME, STANDALONE_URI); doReturn(expectedPath).when(pathsHelper).convertPath(path); final org.uberfire.java.nio.file.Path actualPath = pathsHelper.getStandaloneRootPath(); assertEquals(expectedPath, actualPath); }
|
org.uberfire.java.nio.file.Path getStandaloneRootPath() { return convertPath(newPath(STANDALONE_FILE_NAME, STANDALONE_URI)); }
|
DMNPathsHelperImpl implements DMNPathsHelper { org.uberfire.java.nio.file.Path getStandaloneRootPath() { return convertPath(newPath(STANDALONE_FILE_NAME, STANDALONE_URI)); } }
|
DMNPathsHelperImpl implements DMNPathsHelper { org.uberfire.java.nio.file.Path getStandaloneRootPath() { return convertPath(newPath(STANDALONE_FILE_NAME, STANDALONE_URI)); } DMNPathsHelperImpl(); @Inject DMNPathsHelperImpl(final RefactoringQueryService refactoringQueryService,
final DMNImportTypesHelper importTypesHelper,
final @Named("ioStrategy") IOService ioService); }
|
DMNPathsHelperImpl implements DMNPathsHelper { org.uberfire.java.nio.file.Path getStandaloneRootPath() { return convertPath(newPath(STANDALONE_FILE_NAME, STANDALONE_URI)); } DMNPathsHelperImpl(); @Inject DMNPathsHelperImpl(final RefactoringQueryService refactoringQueryService,
final DMNImportTypesHelper importTypesHelper,
final @Named("ioStrategy") IOService ioService); @Override List<Path> getModelsPaths(final WorkspaceProject workspaceProject); @Override List<Path> getDMNModelsPaths(final WorkspaceProject workspaceProject); @Override List<Path> getPMMLModelsPaths(final WorkspaceProject workspaceProject); @Override String getRelativeURI(final Path dmnModelPath,
final Path includedModelPath); }
|
DMNPathsHelperImpl implements DMNPathsHelper { org.uberfire.java.nio.file.Path getStandaloneRootPath() { return convertPath(newPath(STANDALONE_FILE_NAME, STANDALONE_URI)); } DMNPathsHelperImpl(); @Inject DMNPathsHelperImpl(final RefactoringQueryService refactoringQueryService,
final DMNImportTypesHelper importTypesHelper,
final @Named("ioStrategy") IOService ioService); @Override List<Path> getModelsPaths(final WorkspaceProject workspaceProject); @Override List<Path> getDMNModelsPaths(final WorkspaceProject workspaceProject); @Override List<Path> getPMMLModelsPaths(final WorkspaceProject workspaceProject); @Override String getRelativeURI(final Path dmnModelPath,
final Path includedModelPath); }
|
@Test public void testCopy() { final ExpressionLanguage source = new ExpressionLanguage(VALUE); final ExpressionLanguage target = source.copy(); assertNotNull(target); assertEquals(VALUE, target.getValue()); }
|
public ExpressionLanguage copy() { return new ExpressionLanguage(value); }
|
ExpressionLanguage implements DMNProperty { public ExpressionLanguage copy() { return new ExpressionLanguage(value); } }
|
ExpressionLanguage implements DMNProperty { public ExpressionLanguage copy() { return new ExpressionLanguage(value); } ExpressionLanguage(); ExpressionLanguage(final String value); }
|
ExpressionLanguage implements DMNProperty { public ExpressionLanguage copy() { return new ExpressionLanguage(value); } ExpressionLanguage(); ExpressionLanguage(final String value); ExpressionLanguage copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
ExpressionLanguage implements DMNProperty { public ExpressionLanguage copy() { return new ExpressionLanguage(value); } ExpressionLanguage(); ExpressionLanguage(final String value); ExpressionLanguage copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testGetSelectorData() { assertConstraintTypeIsPresent(ConstraintType.EXPRESSION, values); assertConstraintTypeIsPresent(ConstraintType.ENUMERATION, values); assertConstraintTypeIsPresent(ConstraintType.RANGE, values); }
|
@Override public SelectorData getSelectorData(final FormRenderingContext context) { final Map<Object, String> values = new TreeMap<>(Comparator.comparing(o -> valuePosition.get(o))); Arrays.stream(ConstraintType.values()) .forEach(scope -> values.put(scope.value(), translationService.getTranslation(KEY_PREFIX + scope.value()))); values.put("", translationService.getTranslation(KEY_PREFIX + "selectType")); return new SelectorData(values, ConstraintType.EXPRESSION.value()); }
|
ConstraintTypeDataProvider implements SelectorDataProvider { @Override public SelectorData getSelectorData(final FormRenderingContext context) { final Map<Object, String> values = new TreeMap<>(Comparator.comparing(o -> valuePosition.get(o))); Arrays.stream(ConstraintType.values()) .forEach(scope -> values.put(scope.value(), translationService.getTranslation(KEY_PREFIX + scope.value()))); values.put("", translationService.getTranslation(KEY_PREFIX + "selectType")); return new SelectorData(values, ConstraintType.EXPRESSION.value()); } }
|
ConstraintTypeDataProvider implements SelectorDataProvider { @Override public SelectorData getSelectorData(final FormRenderingContext context) { final Map<Object, String> values = new TreeMap<>(Comparator.comparing(o -> valuePosition.get(o))); Arrays.stream(ConstraintType.values()) .forEach(scope -> values.put(scope.value(), translationService.getTranslation(KEY_PREFIX + scope.value()))); values.put("", translationService.getTranslation(KEY_PREFIX + "selectType")); return new SelectorData(values, ConstraintType.EXPRESSION.value()); } @Inject ConstraintTypeDataProvider(final TranslationService translationService); }
|
ConstraintTypeDataProvider implements SelectorDataProvider { @Override public SelectorData getSelectorData(final FormRenderingContext context) { final Map<Object, String> values = new TreeMap<>(Comparator.comparing(o -> valuePosition.get(o))); Arrays.stream(ConstraintType.values()) .forEach(scope -> values.put(scope.value(), translationService.getTranslation(KEY_PREFIX + scope.value()))); values.put("", translationService.getTranslation(KEY_PREFIX + "selectType")); return new SelectorData(values, ConstraintType.EXPRESSION.value()); } @Inject ConstraintTypeDataProvider(final TranslationService translationService); @Override String getProviderName(); @Override SelectorData getSelectorData(final FormRenderingContext context); }
|
ConstraintTypeDataProvider implements SelectorDataProvider { @Override public SelectorData getSelectorData(final FormRenderingContext context) { final Map<Object, String> values = new TreeMap<>(Comparator.comparing(o -> valuePosition.get(o))); Arrays.stream(ConstraintType.values()) .forEach(scope -> values.put(scope.value(), translationService.getTranslation(KEY_PREFIX + scope.value()))); values.put("", translationService.getTranslation(KEY_PREFIX + "selectType")); return new SelectorData(values, ConstraintType.EXPRESSION.value()); } @Inject ConstraintTypeDataProvider(final TranslationService translationService); @Override String getProviderName(); @Override SelectorData getSelectorData(final FormRenderingContext context); }
|
@Test public void testCopy() { final Name source = new Name(NAME_VALUE); final Name target = source.copy(); assertNotNull(target); assertEquals(NAME_VALUE, target.getValue()); }
|
public Name copy() { return new Name(value); }
|
Name implements DMNProperty { public Name copy() { return new Name(value); } }
|
Name implements DMNProperty { public Name copy() { return new Name(value); } Name(); Name(final String value); }
|
Name implements DMNProperty { public Name copy() { return new Name(value); } Name(); Name(final String value); Name copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
Name implements DMNProperty { public Name copy() { return new Name(value); } Name(); Name(final String value); Name copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); static final transient String DEFAULT_NAME; }
|
@Test public void testCopy() { final Description source = new Description(DESCRIPTION_VALUE); final Description target = source.copy(); assertNotNull(target); assertEquals(DESCRIPTION_VALUE, target.getValue()); }
|
public Description copy() { return new Description(value); }
|
Description implements DMNProperty { public Description copy() { return new Description(value); } }
|
Description implements DMNProperty { public Description copy() { return new Description(value); } Description(); Description(final String value); }
|
Description implements DMNProperty { public Description copy() { return new Description(value); } Description(); Description(final String value); Description copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
Description implements DMNProperty { public Description copy() { return new Description(value); } Description(); Description(final String value); Description copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testName() { assertEquals(NamePropertyType.NAME, new NamePropertyType().getName()); }
|
@Override public String getName() { return NAME; }
|
NamePropertyType implements PropertyType { @Override public String getName() { return NAME; } }
|
NamePropertyType implements PropertyType { @Override public String getName() { return NAME; } }
|
NamePropertyType implements PropertyType { @Override public String getName() { return NAME; } @Override String getName(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); }
|
NamePropertyType implements PropertyType { @Override public String getName() { return NAME; } @Override String getName(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); static final String NAME; }
|
@Test public void testEqualsIdentify() { assertEquals(p1, p1); assertEquals(p1, p2); assertEquals(p1.hashCode(), p2.hashCode()); }
|
@Override public int hashCode() { return ~~getName().hashCode(); }
|
NamePropertyType implements PropertyType { @Override public int hashCode() { return ~~getName().hashCode(); } }
|
NamePropertyType implements PropertyType { @Override public int hashCode() { return ~~getName().hashCode(); } }
|
NamePropertyType implements PropertyType { @Override public int hashCode() { return ~~getName().hashCode(); } @Override String getName(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); }
|
NamePropertyType implements PropertyType { @Override public int hashCode() { return ~~getName().hashCode(); } @Override String getName(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); static final String NAME; }
|
@Test public void checkHashCode() { assertEquals(QNAME1.hashCode(), QNAME2.hashCode()); assertEquals(QNAME1.hashCode(), QNAME3.hashCode()); assertEquals(QNAME2.hashCode(), QNAME3.hashCode()); final HashSet<QName> qNames = new HashSet<>(); qNames.add(QNAME1); assertTrue(qNames.contains(QNAME2)); assertTrue(qNames.contains(QNAME3)); }
|
@Override public int hashCode() { return HashUtil.combineHashCodes(namespaceURI.hashCode(), localPart.hashCode()); }
|
QName implements DMNProperty { @Override public int hashCode() { return HashUtil.combineHashCodes(namespaceURI.hashCode(), localPart.hashCode()); } }
|
QName implements DMNProperty { @Override public int hashCode() { return HashUtil.combineHashCodes(namespaceURI.hashCode(), localPart.hashCode()); } QName(); QName(final BuiltInType type); QName(final String namespaceURI,
final String localPart); QName(final String namespaceURI,
final String localPart,
final String prefix); }
|
QName implements DMNProperty { @Override public int hashCode() { return HashUtil.combineHashCodes(namespaceURI.hashCode(), localPart.hashCode()); } QName(); QName(final BuiltInType type); QName(final String namespaceURI,
final String localPart); QName(final String namespaceURI,
final String localPart,
final String prefix); QName copy(); String getNamespaceURI(); String getLocalPart(); String getPrefix(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
QName implements DMNProperty { @Override public int hashCode() { return HashUtil.combineHashCodes(namespaceURI.hashCode(), localPart.hashCode()); } QName(); QName(final BuiltInType type); QName(final String namespaceURI,
final String localPart); QName(final String namespaceURI,
final String localPart,
final String prefix); QName copy(); String getNamespaceURI(); String getLocalPart(); String getPrefix(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); static final String NULL_NS_URI; static final String DEFAULT_NS_PREFIX; }
|
@Test public void testZeroArgumentConstructor() { final QName implicitQName = new QName(); final QName explicitQName = new QName(QName.NULL_NS_URI, BuiltInType.UNDEFINED.getName(), DMNModelInstrumentedBase.Namespace.FEEL.getPrefix()); assertEquals(explicitQName, implicitQName); }
|
public String getPrefix() { return prefix; }
|
QName implements DMNProperty { public String getPrefix() { return prefix; } }
|
QName implements DMNProperty { public String getPrefix() { return prefix; } QName(); QName(final BuiltInType type); QName(final String namespaceURI,
final String localPart); QName(final String namespaceURI,
final String localPart,
final String prefix); }
|
QName implements DMNProperty { public String getPrefix() { return prefix; } QName(); QName(final BuiltInType type); QName(final String namespaceURI,
final String localPart); QName(final String namespaceURI,
final String localPart,
final String prefix); QName copy(); String getNamespaceURI(); String getLocalPart(); String getPrefix(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
QName implements DMNProperty { public String getPrefix() { return prefix; } QName(); QName(final BuiltInType type); QName(final String namespaceURI,
final String localPart); QName(final String namespaceURI,
final String localPart,
final String prefix); QName copy(); String getNamespaceURI(); String getLocalPart(); String getPrefix(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); static final String NULL_NS_URI; static final String DEFAULT_NS_PREFIX; }
|
@Test public void testCopy() { final QName source = new QName(NAMESPACE_URI, LOCAL_PART, PREFIX); final QName target = source.copy(); assertNotNull(target); assertEquals(NAMESPACE_URI, target.getNamespaceURI()); assertEquals(LOCAL_PART, target.getLocalPart()); assertEquals(PREFIX, target.getPrefix()); }
|
public QName copy() { return new QName(namespaceURI, localPart, prefix); }
|
QName implements DMNProperty { public QName copy() { return new QName(namespaceURI, localPart, prefix); } }
|
QName implements DMNProperty { public QName copy() { return new QName(namespaceURI, localPart, prefix); } QName(); QName(final BuiltInType type); QName(final String namespaceURI,
final String localPart); QName(final String namespaceURI,
final String localPart,
final String prefix); }
|
QName implements DMNProperty { public QName copy() { return new QName(namespaceURI, localPart, prefix); } QName(); QName(final BuiltInType type); QName(final String namespaceURI,
final String localPart); QName(final String namespaceURI,
final String localPart,
final String prefix); QName copy(); String getNamespaceURI(); String getLocalPart(); String getPrefix(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
QName implements DMNProperty { public QName copy() { return new QName(namespaceURI, localPart, prefix); } QName(); QName(final BuiltInType type); QName(final String namespaceURI,
final String localPart); QName(final String namespaceURI,
final String localPart,
final String prefix); QName copy(); String getNamespaceURI(); String getLocalPart(); String getPrefix(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); static final String NULL_NS_URI; static final String DEFAULT_NS_PREFIX; }
|
@Test public void testCopy() { final Text source = new Text(TEXT_VALUE); final Text target = source.copy(); assertNotNull(target); assertEquals(TEXT_VALUE, target.getValue()); }
|
public Text copy() { return new Text(value); }
|
Text implements DMNProperty { public Text copy() { return new Text(value); } }
|
Text implements DMNProperty { public Text copy() { return new Text(value); } Text(); Text(final String value); }
|
Text implements DMNProperty { public Text copy() { return new Text(value); } Text(); Text(final String value); Text copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
Text implements DMNProperty { public Text copy() { return new Text(value); } Text(); Text(final String value); Text copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testOnResize() { gridPanel.onResize(); verify(gridPanel).updatePanelSize(); verify(gridPanel).refreshScrollPosition(); verify(viewport).setTransform(eq(newTransform)); verify(gridLayer, times(2)).batch(); }
|
@Override public void onResize() { doResize(() -> { updatePanelSize(); refreshScrollPosition(); final TransformMediator restriction = mousePanMediator.getTransformMediator(); final Transform transform = restriction.adjust(getDefaultGridLayer().getViewport().getTransform(), getDefaultGridLayer().getVisibleBounds()); getDefaultGridLayer().getViewport().setTransform(transform); getDefaultGridLayer().batch(); }); }
|
DMNGridPanel extends GridLienzoPanel { @Override public void onResize() { doResize(() -> { updatePanelSize(); refreshScrollPosition(); final TransformMediator restriction = mousePanMediator.getTransformMediator(); final Transform transform = restriction.adjust(getDefaultGridLayer().getViewport().getTransform(), getDefaultGridLayer().getVisibleBounds()); getDefaultGridLayer().getViewport().setTransform(transform); getDefaultGridLayer().batch(); }); } }
|
DMNGridPanel extends GridLienzoPanel { @Override public void onResize() { doResize(() -> { updatePanelSize(); refreshScrollPosition(); final TransformMediator restriction = mousePanMediator.getTransformMediator(); final Transform transform = restriction.adjust(getDefaultGridLayer().getViewport().getTransform(), getDefaultGridLayer().getVisibleBounds()); getDefaultGridLayer().getViewport().setTransform(transform); getDefaultGridLayer().batch(); }); } DMNGridPanel(final DMNGridLayer gridLayer,
final RestrictedMousePanMediator mousePanMediator,
final ContextMenuHandler contextMenuHandler); }
|
DMNGridPanel extends GridLienzoPanel { @Override public void onResize() { doResize(() -> { updatePanelSize(); refreshScrollPosition(); final TransformMediator restriction = mousePanMediator.getTransformMediator(); final Transform transform = restriction.adjust(getDefaultGridLayer().getViewport().getTransform(), getDefaultGridLayer().getVisibleBounds()); getDefaultGridLayer().getViewport().setTransform(transform); getDefaultGridLayer().batch(); }); } DMNGridPanel(final DMNGridLayer gridLayer,
final RestrictedMousePanMediator mousePanMediator,
final ContextMenuHandler contextMenuHandler); @Override void onResize(); }
|
DMNGridPanel extends GridLienzoPanel { @Override public void onResize() { doResize(() -> { updatePanelSize(); refreshScrollPosition(); final TransformMediator restriction = mousePanMediator.getTransformMediator(); final Transform transform = restriction.adjust(getDefaultGridLayer().getViewport().getTransform(), getDefaultGridLayer().getVisibleBounds()); getDefaultGridLayer().getViewport().setTransform(transform); getDefaultGridLayer().batch(); }); } DMNGridPanel(final DMNGridLayer gridLayer,
final RestrictedMousePanMediator mousePanMediator,
final ContextMenuHandler contextMenuHandler); @Override void onResize(); static final int LIENZO_PANEL_WIDTH; static final int LIENZO_PANEL_HEIGHT; }
|
@Test public void testName() { assertEquals(QNamePropertyType.NAME, new QNamePropertyType().getName()); }
|
@Override public String getName() { return NAME; }
|
QNamePropertyType implements PropertyType { @Override public String getName() { return NAME; } }
|
QNamePropertyType implements PropertyType { @Override public String getName() { return NAME; } }
|
QNamePropertyType implements PropertyType { @Override public String getName() { return NAME; } @Override String getName(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); }
|
QNamePropertyType implements PropertyType { @Override public String getName() { return NAME; } @Override String getName(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); static final String NAME; }
|
@Test public void testCopy() { final AllowedAnswers source = new AllowedAnswers(ALLOWED_ANSWER_VALUE); final AllowedAnswers target = source.copy(); assertNotNull(target); assertEquals(ALLOWED_ANSWER_VALUE, target.getValue()); }
|
public AllowedAnswers copy() { return new AllowedAnswers(value); }
|
AllowedAnswers implements DMNProperty { public AllowedAnswers copy() { return new AllowedAnswers(value); } }
|
AllowedAnswers implements DMNProperty { public AllowedAnswers copy() { return new AllowedAnswers(value); } AllowedAnswers(); AllowedAnswers(final String value); }
|
AllowedAnswers implements DMNProperty { public AllowedAnswers copy() { return new AllowedAnswers(value); } AllowedAnswers(); AllowedAnswers(final String value); AllowedAnswers copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
AllowedAnswers implements DMNProperty { public AllowedAnswers copy() { return new AllowedAnswers(value); } AllowedAnswers(); AllowedAnswers(final String value); AllowedAnswers copy(); String getValue(); void setValue(final String value); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testCategory() { assertTrue(resourceType.getCategory() instanceof Decision); }
|
@Override public Category getCategory() { return this.category; }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public Category getCategory() { return this.category; } }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public Category getCategory() { return this.category; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public Category getCategory() { return this.category; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); @Override Category getCategory(); @Override String getShortName(); @Override String getDescription(); @Override String getSuffix(); @Override int getPriority(); @Override Class<?> getDefinitionSetType(); }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public Category getCategory() { return this.category; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); @Override Category getCategory(); @Override String getShortName(); @Override String getDescription(); @Override String getSuffix(); @Override int getPriority(); @Override Class<?> getDefinitionSetType(); }
|
@Test public void testShortName() { assertEquals(DMNDefinitionSetResourceType.NAME, resourceType.getShortName()); }
|
@Override public String getShortName() { return NAME; }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public String getShortName() { return NAME; } }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public String getShortName() { return NAME; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public String getShortName() { return NAME; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); @Override Category getCategory(); @Override String getShortName(); @Override String getDescription(); @Override String getSuffix(); @Override int getPriority(); @Override Class<?> getDefinitionSetType(); }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public String getShortName() { return NAME; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); @Override Category getCategory(); @Override String getShortName(); @Override String getDescription(); @Override String getSuffix(); @Override int getPriority(); @Override Class<?> getDefinitionSetType(); }
|
@Test public void testDescription() { assertEquals(DMNDefinitionSetResourceType.DESCRIPTION, resourceType.getDescription()); }
|
@Override public String getDescription() { return DESCRIPTION; }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public String getDescription() { return DESCRIPTION; } }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public String getDescription() { return DESCRIPTION; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public String getDescription() { return DESCRIPTION; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); @Override Category getCategory(); @Override String getShortName(); @Override String getDescription(); @Override String getSuffix(); @Override int getPriority(); @Override Class<?> getDefinitionSetType(); }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public String getDescription() { return DESCRIPTION; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); @Override Category getCategory(); @Override String getShortName(); @Override String getDescription(); @Override String getSuffix(); @Override int getPriority(); @Override Class<?> getDefinitionSetType(); }
|
@Test public void testSuffix() { assertEquals(DMNDefinitionSetResourceType.DMN_EXTENSION, resourceType.getSuffix()); }
|
@Override public String getSuffix() { return DMN_EXTENSION; }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public String getSuffix() { return DMN_EXTENSION; } }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public String getSuffix() { return DMN_EXTENSION; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public String getSuffix() { return DMN_EXTENSION; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); @Override Category getCategory(); @Override String getShortName(); @Override String getDescription(); @Override String getSuffix(); @Override int getPriority(); @Override Class<?> getDefinitionSetType(); }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public String getSuffix() { return DMN_EXTENSION; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); @Override Category getCategory(); @Override String getShortName(); @Override String getDescription(); @Override String getSuffix(); @Override int getPriority(); @Override Class<?> getDefinitionSetType(); }
|
@Test public void testPriority() { assertEquals(0, resourceType.getPriority()); }
|
@Override public int getPriority() { return 0; }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public int getPriority() { return 0; } }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public int getPriority() { return 0; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public int getPriority() { return 0; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); @Override Category getCategory(); @Override String getShortName(); @Override String getDescription(); @Override String getSuffix(); @Override int getPriority(); @Override Class<?> getDefinitionSetType(); }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public int getPriority() { return 0; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); @Override Category getCategory(); @Override String getShortName(); @Override String getDescription(); @Override String getSuffix(); @Override int getPriority(); @Override Class<?> getDefinitionSetType(); }
|
@Test public void testDefinitionSetType() { assertEquals(DMNDefinitionSet.class, resourceType.getDefinitionSetType()); }
|
@Override public Class<?> getDefinitionSetType() { return DMNDefinitionSet.class; }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public Class<?> getDefinitionSetType() { return DMNDefinitionSet.class; } }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public Class<?> getDefinitionSetType() { return DMNDefinitionSet.class; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public Class<?> getDefinitionSetType() { return DMNDefinitionSet.class; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); @Override Category getCategory(); @Override String getShortName(); @Override String getDescription(); @Override String getSuffix(); @Override int getPriority(); @Override Class<?> getDefinitionSetType(); }
|
DMNDefinitionSetResourceType extends AbstractDefinitionSetResourceType { @Override public Class<?> getDefinitionSetType() { return DMNDefinitionSet.class; } DMNDefinitionSetResourceType(); @Inject DMNDefinitionSetResourceType(final Decision category); @Override Category getCategory(); @Override String getShortName(); @Override String getDescription(); @Override String getSuffix(); @Override int getPriority(); @Override Class<?> getDefinitionSetType(); }
|
@Test public void testUnknown() { assertNull(DMNImportTypes.determineImportType("cheese")); }
|
public static DMNImportTypes determineImportType(final String namespace) { return importTypes .stream() .filter(importType -> importType.matchesNamespace(namespace)) .findFirst() .orElse(null); }
|
DMNImportTypes { public static DMNImportTypes determineImportType(final String namespace) { return importTypes .stream() .filter(importType -> importType.matchesNamespace(namespace)) .findFirst() .orElse(null); } }
|
DMNImportTypes { public static DMNImportTypes determineImportType(final String namespace) { return importTypes .stream() .filter(importType -> importType.matchesNamespace(namespace)) .findFirst() .orElse(null); } private DMNImportTypes(final String fileExtension,
final String... namespaces); }
|
DMNImportTypes { public static DMNImportTypes determineImportType(final String namespace) { return importTypes .stream() .filter(importType -> importType.matchesNamespace(namespace)) .findFirst() .orElse(null); } private DMNImportTypes(final String fileExtension,
final String... namespaces); static DMNImportTypes determineImportType(final String namespace); String getFileExtension(); String getDefaultNamespace(); List<String> getNamespaces(); }
|
DMNImportTypes { public static DMNImportTypes determineImportType(final String namespace) { return importTypes .stream() .filter(importType -> importType.matchesNamespace(namespace)) .findFirst() .orElse(null); } private DMNImportTypes(final String fileExtension,
final String... namespaces); static DMNImportTypes determineImportType(final String namespace); String getFileExtension(); String getDefaultNamespace(); List<String> getNamespaces(); static final DMNImportTypes DMN; static final DMNImportTypes PMML; }
|
@Test public void testGetNamespacesDMN() { final List<String> namespaces = DMNImportTypes.DMN.getNamespaces(); assertEquals(1, namespaces.size()); assertEquals("http: }
|
public List<String> getNamespaces() { return namespaces; }
|
DMNImportTypes { public List<String> getNamespaces() { return namespaces; } }
|
DMNImportTypes { public List<String> getNamespaces() { return namespaces; } private DMNImportTypes(final String fileExtension,
final String... namespaces); }
|
DMNImportTypes { public List<String> getNamespaces() { return namespaces; } private DMNImportTypes(final String fileExtension,
final String... namespaces); static DMNImportTypes determineImportType(final String namespace); String getFileExtension(); String getDefaultNamespace(); List<String> getNamespaces(); }
|
DMNImportTypes { public List<String> getNamespaces() { return namespaces; } private DMNImportTypes(final String fileExtension,
final String... namespaces); static DMNImportTypes determineImportType(final String namespace); String getFileExtension(); String getDefaultNamespace(); List<String> getNamespaces(); static final DMNImportTypes DMN; static final DMNImportTypes PMML; }
|
@Test @SuppressWarnings("unchecked") public void testRenderCellWithValue() { this.cell = new BaseGridCell<>(new BaseGridCellValue<>(InformationItemCell.HasNameCell.wrap(TITLE))); assertThat(renderer.renderCell(cell, bodyContext)).isNotNull(); verify(text1).setText(eq(TITLE)); verify(text1).setX(BLOCK_WIDTH / 2); verify(text1).setY(ROW_HEIGHT / 2); }
|
@Override public Group renderCell(final GridCell<InformationItemCell.HasNameCell> cell, final GridBodyCellRenderContext context) { if (cell == null || cell.getValue() == null) { return null; } final InformationItemCell.HasNameCell hasNameCell = cell.getValue().getValue(); return hasNameCell.render(context); }
|
NameAndDataTypeColumnRenderer extends BaseGridColumnRenderer<InformationItemCell.HasNameCell> { @Override public Group renderCell(final GridCell<InformationItemCell.HasNameCell> cell, final GridBodyCellRenderContext context) { if (cell == null || cell.getValue() == null) { return null; } final InformationItemCell.HasNameCell hasNameCell = cell.getValue().getValue(); return hasNameCell.render(context); } }
|
NameAndDataTypeColumnRenderer extends BaseGridColumnRenderer<InformationItemCell.HasNameCell> { @Override public Group renderCell(final GridCell<InformationItemCell.HasNameCell> cell, final GridBodyCellRenderContext context) { if (cell == null || cell.getValue() == null) { return null; } final InformationItemCell.HasNameCell hasNameCell = cell.getValue().getValue(); return hasNameCell.render(context); } NameAndDataTypeColumnRenderer(); }
|
NameAndDataTypeColumnRenderer extends BaseGridColumnRenderer<InformationItemCell.HasNameCell> { @Override public Group renderCell(final GridCell<InformationItemCell.HasNameCell> cell, final GridBodyCellRenderContext context) { if (cell == null || cell.getValue() == null) { return null; } final InformationItemCell.HasNameCell hasNameCell = cell.getValue().getValue(); return hasNameCell.render(context); } NameAndDataTypeColumnRenderer(); @Override Group renderHeaderContent(final List<GridColumn.HeaderMetaData> headerMetaData,
final GridHeaderColumnRenderContext context,
final int headerRowIndex,
final double blockWidth,
final double rowHeight); @Override Group renderCell(final GridCell<InformationItemCell.HasNameCell> cell,
final GridBodyCellRenderContext context); }
|
NameAndDataTypeColumnRenderer extends BaseGridColumnRenderer<InformationItemCell.HasNameCell> { @Override public Group renderCell(final GridCell<InformationItemCell.HasNameCell> cell, final GridBodyCellRenderContext context) { if (cell == null || cell.getValue() == null) { return null; } final InformationItemCell.HasNameCell hasNameCell = cell.getValue().getValue(); return hasNameCell.render(context); } NameAndDataTypeColumnRenderer(); @Override Group renderHeaderContent(final List<GridColumn.HeaderMetaData> headerMetaData,
final GridHeaderColumnRenderContext context,
final int headerRowIndex,
final double blockWidth,
final double rowHeight); @Override Group renderCell(final GridCell<InformationItemCell.HasNameCell> cell,
final GridBodyCellRenderContext context); }
|
@Test public void testGetNamespacesPMML() { final List<String> namespaces = DMNImportTypes.PMML.getNamespaces(); assertEquals(7, namespaces.size()); assertEquals("http: assertEquals("http: assertEquals("http: assertEquals("http: assertEquals("http: assertEquals("http: assertEquals("http: }
|
public List<String> getNamespaces() { return namespaces; }
|
DMNImportTypes { public List<String> getNamespaces() { return namespaces; } }
|
DMNImportTypes { public List<String> getNamespaces() { return namespaces; } private DMNImportTypes(final String fileExtension,
final String... namespaces); }
|
DMNImportTypes { public List<String> getNamespaces() { return namespaces; } private DMNImportTypes(final String fileExtension,
final String... namespaces); static DMNImportTypes determineImportType(final String namespace); String getFileExtension(); String getDefaultNamespace(); List<String> getNamespaces(); }
|
DMNImportTypes { public List<String> getNamespaces() { return namespaces; } private DMNImportTypes(final String fileExtension,
final String... namespaces); static DMNImportTypes determineImportType(final String namespace); String getFileExtension(); String getDefaultNamespace(); List<String> getNamespaces(); static final DMNImportTypes DMN; static final DMNImportTypes PMML; }
|
@Test public void testGetDefaultNameSpaceDMN() { assertEquals("http: }
|
public String getDefaultNamespace() { return namespaces.get(namespaces.size() - 1); }
|
DMNImportTypes { public String getDefaultNamespace() { return namespaces.get(namespaces.size() - 1); } }
|
DMNImportTypes { public String getDefaultNamespace() { return namespaces.get(namespaces.size() - 1); } private DMNImportTypes(final String fileExtension,
final String... namespaces); }
|
DMNImportTypes { public String getDefaultNamespace() { return namespaces.get(namespaces.size() - 1); } private DMNImportTypes(final String fileExtension,
final String... namespaces); static DMNImportTypes determineImportType(final String namespace); String getFileExtension(); String getDefaultNamespace(); List<String> getNamespaces(); }
|
DMNImportTypes { public String getDefaultNamespace() { return namespaces.get(namespaces.size() - 1); } private DMNImportTypes(final String fileExtension,
final String... namespaces); static DMNImportTypes determineImportType(final String namespace); String getFileExtension(); String getDefaultNamespace(); List<String> getNamespaces(); static final DMNImportTypes DMN; static final DMNImportTypes PMML; }
|
@Test public void testGetDefaultNameSpacePMML() { assertEquals("http: }
|
public String getDefaultNamespace() { return namespaces.get(namespaces.size() - 1); }
|
DMNImportTypes { public String getDefaultNamespace() { return namespaces.get(namespaces.size() - 1); } }
|
DMNImportTypes { public String getDefaultNamespace() { return namespaces.get(namespaces.size() - 1); } private DMNImportTypes(final String fileExtension,
final String... namespaces); }
|
DMNImportTypes { public String getDefaultNamespace() { return namespaces.get(namespaces.size() - 1); } private DMNImportTypes(final String fileExtension,
final String... namespaces); static DMNImportTypes determineImportType(final String namespace); String getFileExtension(); String getDefaultNamespace(); List<String> getNamespaces(); }
|
DMNImportTypes { public String getDefaultNamespace() { return namespaces.get(namespaces.size() - 1); } private DMNImportTypes(final String fileExtension,
final String... namespaces); static DMNImportTypes determineImportType(final String namespace); String getFileExtension(); String getDefaultNamespace(); List<String> getNamespaces(); static final DMNImportTypes DMN; static final DMNImportTypes PMML; }
|
@Test public void testGetters() { final PMMLParameterMetadata metadata = new PMMLParameterMetadata(PARAMETER_NAME); assertEquals(PARAMETER_NAME, metadata.getName()); }
|
public String getName() { return name; }
|
PMMLParameterMetadata { public String getName() { return name; } }
|
PMMLParameterMetadata { public String getName() { return name; } PMMLParameterMetadata(final @MapsTo("name") String name); }
|
PMMLParameterMetadata { public String getName() { return name; } PMMLParameterMetadata(final @MapsTo("name") String name); String getName(); }
|
PMMLParameterMetadata { public String getName() { return name; } PMMLParameterMetadata(final @MapsTo("name") String name); String getName(); }
|
@Test public void testGetters() { final PMMLIncludedModel model = new PMMLIncludedModel(MODEL_NAME, MODEL_PACKAGE, PATH, IMPORT_TYPE, MODELS_COUNT); assertEquals(MODEL_NAME, model.getModelName()); assertEquals(MODEL_PACKAGE, model.getModelPackage()); assertEquals(PATH, model.getPath()); assertEquals(IMPORT_TYPE, model.getImportType()); assertEquals(MODELS_COUNT, model.getModelCount()); }
|
public Integer getModelCount() { return modelCount; }
|
PMMLIncludedModel extends BaseIncludedModel { public Integer getModelCount() { return modelCount; } }
|
PMMLIncludedModel extends BaseIncludedModel { public Integer getModelCount() { return modelCount; } PMMLIncludedModel(final @MapsTo("modelName") String modelName,
final @MapsTo("modelPackage") String modelPackage,
final @MapsTo("path") String path,
final @MapsTo("importType") String importType,
final @MapsTo("modelCount") Integer modelCount); }
|
PMMLIncludedModel extends BaseIncludedModel { public Integer getModelCount() { return modelCount; } PMMLIncludedModel(final @MapsTo("modelName") String modelName,
final @MapsTo("modelPackage") String modelPackage,
final @MapsTo("path") String path,
final @MapsTo("importType") String importType,
final @MapsTo("modelCount") Integer modelCount); Integer getModelCount(); }
|
PMMLIncludedModel extends BaseIncludedModel { public Integer getModelCount() { return modelCount; } PMMLIncludedModel(final @MapsTo("modelName") String modelName,
final @MapsTo("modelPackage") String modelPackage,
final @MapsTo("path") String path,
final @MapsTo("importType") String importType,
final @MapsTo("modelCount") Integer modelCount); Integer getModelCount(); }
|
@Test public void testExtractName() { final String name1 = "org.java.SomeClass"; final DataObject dataObject = new DataObject(name1); final String expected1 = "SomeClass"; final String actual1 = dataObject.getClassNameWithoutPackage(); assertEquals(expected1, actual1); final String name2 = "SomeOtherClass"; final String expected2 = "SomeOtherClass"; final DataObject dataObject2 = new DataObject(name2); final String actual2 = dataObject2.getClassNameWithoutPackage(); assertEquals(expected2, actual2); }
|
public String getClassNameWithoutPackage() { int lastIndex = 0; if (classType.contains(".")) { lastIndex = classType.lastIndexOf('.') + 1; } return classType.substring(lastIndex); }
|
DataObject { public String getClassNameWithoutPackage() { int lastIndex = 0; if (classType.contains(".")) { lastIndex = classType.lastIndexOf('.') + 1; } return classType.substring(lastIndex); } }
|
DataObject { public String getClassNameWithoutPackage() { int lastIndex = 0; if (classType.contains(".")) { lastIndex = classType.lastIndexOf('.') + 1; } return classType.substring(lastIndex); } DataObject(); DataObject(final String classType); }
|
DataObject { public String getClassNameWithoutPackage() { int lastIndex = 0; if (classType.contains(".")) { lastIndex = classType.lastIndexOf('.') + 1; } return classType.substring(lastIndex); } DataObject(); DataObject(final String classType); String getClassType(); void setClassType(final String classType); List<DataObjectProperty> getProperties(); void setProperties(final List<DataObjectProperty> properties); String getClassNameWithoutPackage(); }
|
DataObject { public String getClassNameWithoutPackage() { int lastIndex = 0; if (classType.contains(".")) { lastIndex = classType.lastIndexOf('.') + 1; } return classType.substring(lastIndex); } DataObject(); DataObject(final String classType); String getClassType(); void setClassType(final String classType); List<DataObjectProperty> getProperties(); void setProperties(final List<DataObjectProperty> properties); String getClassNameWithoutPackage(); }
|
@Test public void testIsDefaultWhenTypeIsDefault() { assertTrue(BuiltInTypeUtils.isBuiltInType("string")); }
|
public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } static boolean isBuiltInType(final String type); static Optional<BuiltInType> findBuiltInTypeByName(final String name); }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } static boolean isBuiltInType(final String type); static Optional<BuiltInType> findBuiltInTypeByName(final String name); }
|
@Test public void testIsDefaultWhenTypeIsDefaultWithAlternativeAlias() { assertTrue(BuiltInTypeUtils.isBuiltInType("dayTimeDuration")); }
|
public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } static boolean isBuiltInType(final String type); static Optional<BuiltInType> findBuiltInTypeByName(final String name); }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } static boolean isBuiltInType(final String type); static Optional<BuiltInType> findBuiltInTypeByName(final String name); }
|
@Test public void testIsNotDefaultWhenTypeIsDefaultWithAnUpperCaseCharacter() { assertFalse(BuiltInTypeUtils.isBuiltInType("String")); }
|
public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } static boolean isBuiltInType(final String type); static Optional<BuiltInType> findBuiltInTypeByName(final String name); }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } static boolean isBuiltInType(final String type); static Optional<BuiltInType> findBuiltInTypeByName(final String name); }
|
@Test public void testIsDefaultWhenTypeIsNull() { assertFalse(BuiltInTypeUtils.isBuiltInType(null)); }
|
public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } static boolean isBuiltInType(final String type); static Optional<BuiltInType> findBuiltInTypeByName(final String name); }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } static boolean isBuiltInType(final String type); static Optional<BuiltInType> findBuiltInTypeByName(final String name); }
|
@Test public void testSetValue() { final List<String> values = new Lists.Builder<String>().add("value1").add("value2").add(VALUE).build(); final String[] varArgs = new String[values.size() - 1]; values.subList(1, values.size()).toArray(varArgs); when(widget.getItemCount()).thenReturn(values.size()); when(widget.getItemText(anyInt())).thenReturn(values.get(0), varArgs); domElement.setValue(VALUE); verify(widget).setSelectedIndex(values.indexOf(VALUE)); }
|
@Override public void setValue(final String value) { this.originalValue = value; for (int i = 0; i < widget.getItemCount(); i++) { if (Objects.equals(widget.getItemText(i), value)) { widget.setSelectedIndex(i); break; } } }
|
ListBoxDOMElement extends BaseDOMElement<String, ListBox> implements TakesValue<String>,
Focusable { @Override public void setValue(final String value) { this.originalValue = value; for (int i = 0; i < widget.getItemCount(); i++) { if (Objects.equals(widget.getItemText(i), value)) { widget.setSelectedIndex(i); break; } } } }
|
ListBoxDOMElement extends BaseDOMElement<String, ListBox> implements TakesValue<String>,
Focusable { @Override public void setValue(final String value) { this.originalValue = value; for (int i = 0; i < widget.getItemCount(); i++) { if (Objects.equals(widget.getItemText(i), value)) { widget.setSelectedIndex(i); break; } } } ListBoxDOMElement(final ListBox widget,
final GridLayer gridLayer,
final GridWidget gridWidget,
final SessionManager sessionManager,
final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
final Function<GridCellTuple, Command> hasNoValueCommand,
final Function<GridCellValueTuple, Command> hasValueCommand); }
|
ListBoxDOMElement extends BaseDOMElement<String, ListBox> implements TakesValue<String>,
Focusable { @Override public void setValue(final String value) { this.originalValue = value; for (int i = 0; i < widget.getItemCount(); i++) { if (Objects.equals(widget.getItemText(i), value)) { widget.setSelectedIndex(i); break; } } } ListBoxDOMElement(final ListBox widget,
final GridLayer gridLayer,
final GridWidget gridWidget,
final SessionManager sessionManager,
final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
final Function<GridCellTuple, Command> hasNoValueCommand,
final Function<GridCellValueTuple, Command> hasValueCommand); @Override void setValue(final String value); @Override String getValue(); @Override int getTabIndex(); @Override void setAccessKey(final char key); @Override void setFocus(final boolean focused); @Override void setTabIndex(final int index); @Override void initialise(final GridBodyCellRenderContext context); @Override @SuppressWarnings("unchecked") void flush(final String value); }
|
ListBoxDOMElement extends BaseDOMElement<String, ListBox> implements TakesValue<String>,
Focusable { @Override public void setValue(final String value) { this.originalValue = value; for (int i = 0; i < widget.getItemCount(); i++) { if (Objects.equals(widget.getItemText(i), value)) { widget.setSelectedIndex(i); break; } } } ListBoxDOMElement(final ListBox widget,
final GridLayer gridLayer,
final GridWidget gridWidget,
final SessionManager sessionManager,
final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
final Function<GridCellTuple, Command> hasNoValueCommand,
final Function<GridCellValueTuple, Command> hasValueCommand); @Override void setValue(final String value); @Override String getValue(); @Override int getTabIndex(); @Override void setAccessKey(final char key); @Override void setFocus(final boolean focused); @Override void setTabIndex(final int index); @Override void initialise(final GridBodyCellRenderContext context); @Override @SuppressWarnings("unchecked") void flush(final String value); }
|
@Test public void testIsDefaultWhenTypeIsNotDefault() { assertFalse(BuiltInTypeUtils.isBuiltInType("tAddress")); }
|
public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } static boolean isBuiltInType(final String type); static Optional<BuiltInType> findBuiltInTypeByName(final String name); }
|
BuiltInTypeUtils { public static boolean isBuiltInType(final String type) { return builtInTypeNames() .anyMatch(builtInTypeName -> Objects.equals(builtInTypeName, type)); } static boolean isBuiltInType(final String type); static Optional<BuiltInType> findBuiltInTypeByName(final String name); }
|
@Test public void testFindBuiltInTypeByNameWhenItFinds() { assertTrue(BuiltInTypeUtils.findBuiltInTypeByName("boolean").isPresent()); assertEquals(BOOLEAN, BuiltInTypeUtils.findBuiltInTypeByName("boolean").get()); }
|
public static Optional<BuiltInType> findBuiltInTypeByName(final String name) { return getBuiltInTypeValuesStream() .filter(builtInType -> Arrays.asList(builtInType.getNames()).contains(name)) .findAny(); }
|
BuiltInTypeUtils { public static Optional<BuiltInType> findBuiltInTypeByName(final String name) { return getBuiltInTypeValuesStream() .filter(builtInType -> Arrays.asList(builtInType.getNames()).contains(name)) .findAny(); } }
|
BuiltInTypeUtils { public static Optional<BuiltInType> findBuiltInTypeByName(final String name) { return getBuiltInTypeValuesStream() .filter(builtInType -> Arrays.asList(builtInType.getNames()).contains(name)) .findAny(); } }
|
BuiltInTypeUtils { public static Optional<BuiltInType> findBuiltInTypeByName(final String name) { return getBuiltInTypeValuesStream() .filter(builtInType -> Arrays.asList(builtInType.getNames()).contains(name)) .findAny(); } static boolean isBuiltInType(final String type); static Optional<BuiltInType> findBuiltInTypeByName(final String name); }
|
BuiltInTypeUtils { public static Optional<BuiltInType> findBuiltInTypeByName(final String name) { return getBuiltInTypeValuesStream() .filter(builtInType -> Arrays.asList(builtInType.getNames()).contains(name)) .findAny(); } static boolean isBuiltInType(final String type); static Optional<BuiltInType> findBuiltInTypeByName(final String name); }
|
@Test public void testFindBuiltInTypeByNameWhenItDoesNotFind() { assertFalse(BuiltInTypeUtils.findBuiltInTypeByName("something").isPresent()); }
|
public static Optional<BuiltInType> findBuiltInTypeByName(final String name) { return getBuiltInTypeValuesStream() .filter(builtInType -> Arrays.asList(builtInType.getNames()).contains(name)) .findAny(); }
|
BuiltInTypeUtils { public static Optional<BuiltInType> findBuiltInTypeByName(final String name) { return getBuiltInTypeValuesStream() .filter(builtInType -> Arrays.asList(builtInType.getNames()).contains(name)) .findAny(); } }
|
BuiltInTypeUtils { public static Optional<BuiltInType> findBuiltInTypeByName(final String name) { return getBuiltInTypeValuesStream() .filter(builtInType -> Arrays.asList(builtInType.getNames()).contains(name)) .findAny(); } }
|
BuiltInTypeUtils { public static Optional<BuiltInType> findBuiltInTypeByName(final String name) { return getBuiltInTypeValuesStream() .filter(builtInType -> Arrays.asList(builtInType.getNames()).contains(name)) .findAny(); } static boolean isBuiltInType(final String type); static Optional<BuiltInType> findBuiltInTypeByName(final String name); }
|
BuiltInTypeUtils { public static Optional<BuiltInType> findBuiltInTypeByName(final String name) { return getBuiltInTypeValuesStream() .filter(builtInType -> Arrays.asList(builtInType.getNames()).contains(name)) .findAny(); } static boolean isBuiltInType(final String type); static Optional<BuiltInType> findBuiltInTypeByName(final String name); }
|
@Test public void testGetNodes() { final DRGElement drgElement = mock(DRGElement.class); when(definition.getDefinition()).thenReturn(drgElement); final List<DRGElement> actualNodes = utils.getDRGElements(diagram); final List<DRGElement> expectedNodes = singletonList(drgElement); assertEquals(expectedNodes, actualNodes); }
|
public List<DRGElement> getDRGElements(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DRGElement) .map(d -> (DRGElement) d) .collect(Collectors.toList()); }
|
DMNDiagramUtils { public List<DRGElement> getDRGElements(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DRGElement) .map(d -> (DRGElement) d) .collect(Collectors.toList()); } }
|
DMNDiagramUtils { public List<DRGElement> getDRGElements(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DRGElement) .map(d -> (DRGElement) d) .collect(Collectors.toList()); } DMNDiagramUtils(); }
|
DMNDiagramUtils { public List<DRGElement> getDRGElements(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DRGElement) .map(d -> (DRGElement) d) .collect(Collectors.toList()); } DMNDiagramUtils(); List<DRGElement> getDRGElements(final Diagram diagram); String getNamespace(final Diagram diagram); Definitions getDefinitions(final Diagram diagram); Stream<Object> getDefinitionStream(final Diagram diagram); @SuppressWarnings("unchecked") Stream<Node> getNodeStream(final Diagram diagram); }
|
DMNDiagramUtils { public List<DRGElement> getDRGElements(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DRGElement) .map(d -> (DRGElement) d) .collect(Collectors.toList()); } DMNDiagramUtils(); List<DRGElement> getDRGElements(final Diagram diagram); String getNamespace(final Diagram diagram); Definitions getDefinitions(final Diagram diagram); Stream<Object> getDefinitionStream(final Diagram diagram); @SuppressWarnings("unchecked") Stream<Node> getNodeStream(final Diagram diagram); }
|
@Test public void testGetDefinitionsWithRootNode() { final DMNDiagram definition = new DMNDiagram(); graph.addNode(newNode(definition)); final Definitions definitions = utils.getDefinitions(diagram); assertNotNull(definitions); assertEquals(definition.getDefinitions(), definitions); }
|
public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); }
|
DMNDiagramUtils { public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); } }
|
DMNDiagramUtils { public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); } DMNDiagramUtils(); }
|
DMNDiagramUtils { public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); } DMNDiagramUtils(); List<DRGElement> getDRGElements(final Diagram diagram); String getNamespace(final Diagram diagram); Definitions getDefinitions(final Diagram diagram); Stream<Object> getDefinitionStream(final Diagram diagram); @SuppressWarnings("unchecked") Stream<Node> getNodeStream(final Diagram diagram); }
|
DMNDiagramUtils { public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); } DMNDiagramUtils(); List<DRGElement> getDRGElements(final Diagram diagram); String getNamespace(final Diagram diagram); Definitions getDefinitions(final Diagram diagram); Stream<Object> getDefinitionStream(final Diagram diagram); @SuppressWarnings("unchecked") Stream<Node> getNodeStream(final Diagram diagram); }
|
@Test public void testGetDefinitionsWithMultipleRootNodes() { final Decision definition1 = new Decision(); final DMNDiagram definition2 = new DMNDiagram(); graph.addNode(newNode(definition1)); graph.addNode(newNode(definition2)); final Definitions definitions = utils.getDefinitions(diagram); assertNotNull(definitions); assertEquals(definition2.getDefinitions(), definitions); }
|
public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); }
|
DMNDiagramUtils { public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); } }
|
DMNDiagramUtils { public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); } DMNDiagramUtils(); }
|
DMNDiagramUtils { public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); } DMNDiagramUtils(); List<DRGElement> getDRGElements(final Diagram diagram); String getNamespace(final Diagram diagram); Definitions getDefinitions(final Diagram diagram); Stream<Object> getDefinitionStream(final Diagram diagram); @SuppressWarnings("unchecked") Stream<Node> getNodeStream(final Diagram diagram); }
|
DMNDiagramUtils { public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); } DMNDiagramUtils(); List<DRGElement> getDRGElements(final Diagram diagram); String getNamespace(final Diagram diagram); Definitions getDefinitions(final Diagram diagram); Stream<Object> getDefinitionStream(final Diagram diagram); @SuppressWarnings("unchecked") Stream<Node> getNodeStream(final Diagram diagram); }
|
@Test public void testGetDefinitionsWithConnectedNodes() { final Decision definition1 = new Decision(); final DMNDiagram definition2 = new DMNDiagram(); final Node<View, Edge> node1 = newNode(definition1); final Node<View, Edge> node2 = newNode(definition2); final Edge<View, Node> edge = new EdgeImpl<>(UUID.uuid()); node1.getInEdges().add(edge); node2.getOutEdges().add(edge); edge.setSourceNode(node2); edge.setTargetNode(node1); graph.addNode(node1); graph.addNode(node2); final Definitions definitions = utils.getDefinitions(diagram); assertNotNull(definitions); assertEquals(definition2.getDefinitions(), definitions); }
|
public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); }
|
DMNDiagramUtils { public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); } }
|
DMNDiagramUtils { public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); } DMNDiagramUtils(); }
|
DMNDiagramUtils { public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); } DMNDiagramUtils(); List<DRGElement> getDRGElements(final Diagram diagram); String getNamespace(final Diagram diagram); Definitions getDefinitions(final Diagram diagram); Stream<Object> getDefinitionStream(final Diagram diagram); @SuppressWarnings("unchecked") Stream<Node> getNodeStream(final Diagram diagram); }
|
DMNDiagramUtils { public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); } DMNDiagramUtils(); List<DRGElement> getDRGElements(final Diagram diagram); String getNamespace(final Diagram diagram); Definitions getDefinitions(final Diagram diagram); Stream<Object> getDefinitionStream(final Diagram diagram); @SuppressWarnings("unchecked") Stream<Node> getNodeStream(final Diagram diagram); }
|
@Test public void testGetDefinitionsWithNoNodes() { assertNull(utils.getDefinitions(diagram)); }
|
public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); }
|
DMNDiagramUtils { public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); } }
|
DMNDiagramUtils { public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); } DMNDiagramUtils(); }
|
DMNDiagramUtils { public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); } DMNDiagramUtils(); List<DRGElement> getDRGElements(final Diagram diagram); String getNamespace(final Diagram diagram); Definitions getDefinitions(final Diagram diagram); Stream<Object> getDefinitionStream(final Diagram diagram); @SuppressWarnings("unchecked") Stream<Node> getNodeStream(final Diagram diagram); }
|
DMNDiagramUtils { public Definitions getDefinitions(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DMNDiagram) .map(d -> (DMNDiagram) d) .findFirst() .map(DMNDiagram::getDefinitions) .orElse(NONE); } DMNDiagramUtils(); List<DRGElement> getDRGElements(final Diagram diagram); String getNamespace(final Diagram diagram); Definitions getDefinitions(final Diagram diagram); Stream<Object> getDefinitionStream(final Diagram diagram); @SuppressWarnings("unchecked") Stream<Node> getNodeStream(final Diagram diagram); }
|
@Test @SuppressWarnings("unchecked") public void checkCyclicalConnection() { final Node node1 = new NodeImpl<>("node1"); final Node node2 = new NodeImpl<>("node2"); final Edge c1 = new EdgeImpl<>("edge1"); node1.getOutEdges().add(c1); node2.getInEdges().add(c1); c1.setSourceNode(node1); c1.setTargetNode(node2); graph.addNode(node1); graph.addNode(node2); when(context.getSource()).thenReturn(Optional.of(node2)); when(context.getTarget()).thenReturn(Optional.of(node1)); when(context.getConnector()).thenReturn(connector); final RuleViolations result = check.evaluate(rule, context); assertNotNull(result); assertTrue(result.violations().iterator().hasNext()); final RuleViolation violation = result.violations().iterator().next(); assertNotNull(violation); assertTrue(violation.getArguments().isPresent()); assertEquals(1, violation.getArguments().get().length); assertEquals(AcyclicDirectedGraphRule.ERROR_MESSAGE, violation.getArguments().get()[0]); }
|
@Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final RuleExtension rule, final GraphConnectionContext context) { final GraphEvaluationState state = context.getState(); final Graph<?, Node> graph = (Graph<?, Node>) state.getGraph(); final Optional<Node<? extends View<?>, ? extends Edge>> oSource = context.getSource(); final Optional<Node<? extends View<?>, ? extends Edge>> oTarget = context.getTarget(); final Edge<? extends View<?>, ? extends Node> oConnector = context.getConnector(); final DefaultRuleViolations result = new DefaultRuleViolations(); if (!(oSource.isPresent() && oTarget.isPresent())) { return result; } final Node<?, Edge> source = (Node<?, Edge>) oSource.get(); final Node<?, Edge> target = (Node<?, Edge>) oTarget.get(); final Edge<?, Node> connector = (Edge<?, Node>) oConnector; try { final TreeWalkTraverseProcessor walker = getTreeWalker(source, target, connector); walker.traverse(graph, new TreeTraverseCallback<Graph, Node, Edge>() { final Set<Node> inProgress = new HashSet<>(); @Override public void startGraphTraversal(final Graph graph) { } @Override public boolean startNodeTraversal(final Node node) { if (inProgress.contains(node)) { throw new DirectedAcrylicGraphViolationException(); } inProgress.add(node); return true; } @Override public boolean startEdgeTraversal(final Edge edge) { return true; } @Override public void endNodeTraversal(final Node node) { inProgress.remove(node); } @Override public void endEdgeTraversal(final Edge edge) { } @Override public void endGraphTraversal() { } }); } catch (DirectedAcrylicGraphViolationException e) { result.addViolation(new RuleViolationImpl(ERROR_MESSAGE)); } return result; }
|
AcyclicDirectedGraphRule extends RuleExtensionHandler<AcyclicDirectedGraphRule, GraphConnectionContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final RuleExtension rule, final GraphConnectionContext context) { final GraphEvaluationState state = context.getState(); final Graph<?, Node> graph = (Graph<?, Node>) state.getGraph(); final Optional<Node<? extends View<?>, ? extends Edge>> oSource = context.getSource(); final Optional<Node<? extends View<?>, ? extends Edge>> oTarget = context.getTarget(); final Edge<? extends View<?>, ? extends Node> oConnector = context.getConnector(); final DefaultRuleViolations result = new DefaultRuleViolations(); if (!(oSource.isPresent() && oTarget.isPresent())) { return result; } final Node<?, Edge> source = (Node<?, Edge>) oSource.get(); final Node<?, Edge> target = (Node<?, Edge>) oTarget.get(); final Edge<?, Node> connector = (Edge<?, Node>) oConnector; try { final TreeWalkTraverseProcessor walker = getTreeWalker(source, target, connector); walker.traverse(graph, new TreeTraverseCallback<Graph, Node, Edge>() { final Set<Node> inProgress = new HashSet<>(); @Override public void startGraphTraversal(final Graph graph) { } @Override public boolean startNodeTraversal(final Node node) { if (inProgress.contains(node)) { throw new DirectedAcrylicGraphViolationException(); } inProgress.add(node); return true; } @Override public boolean startEdgeTraversal(final Edge edge) { return true; } @Override public void endNodeTraversal(final Node node) { inProgress.remove(node); } @Override public void endEdgeTraversal(final Edge edge) { } @Override public void endGraphTraversal() { } }); } catch (DirectedAcrylicGraphViolationException e) { result.addViolation(new RuleViolationImpl(ERROR_MESSAGE)); } return result; } }
|
AcyclicDirectedGraphRule extends RuleExtensionHandler<AcyclicDirectedGraphRule, GraphConnectionContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final RuleExtension rule, final GraphConnectionContext context) { final GraphEvaluationState state = context.getState(); final Graph<?, Node> graph = (Graph<?, Node>) state.getGraph(); final Optional<Node<? extends View<?>, ? extends Edge>> oSource = context.getSource(); final Optional<Node<? extends View<?>, ? extends Edge>> oTarget = context.getTarget(); final Edge<? extends View<?>, ? extends Node> oConnector = context.getConnector(); final DefaultRuleViolations result = new DefaultRuleViolations(); if (!(oSource.isPresent() && oTarget.isPresent())) { return result; } final Node<?, Edge> source = (Node<?, Edge>) oSource.get(); final Node<?, Edge> target = (Node<?, Edge>) oTarget.get(); final Edge<?, Node> connector = (Edge<?, Node>) oConnector; try { final TreeWalkTraverseProcessor walker = getTreeWalker(source, target, connector); walker.traverse(graph, new TreeTraverseCallback<Graph, Node, Edge>() { final Set<Node> inProgress = new HashSet<>(); @Override public void startGraphTraversal(final Graph graph) { } @Override public boolean startNodeTraversal(final Node node) { if (inProgress.contains(node)) { throw new DirectedAcrylicGraphViolationException(); } inProgress.add(node); return true; } @Override public boolean startEdgeTraversal(final Edge edge) { return true; } @Override public void endNodeTraversal(final Node node) { inProgress.remove(node); } @Override public void endEdgeTraversal(final Edge edge) { } @Override public void endGraphTraversal() { } }); } catch (DirectedAcrylicGraphViolationException e) { result.addViolation(new RuleViolationImpl(ERROR_MESSAGE)); } return result; } }
|
AcyclicDirectedGraphRule extends RuleExtensionHandler<AcyclicDirectedGraphRule, GraphConnectionContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final RuleExtension rule, final GraphConnectionContext context) { final GraphEvaluationState state = context.getState(); final Graph<?, Node> graph = (Graph<?, Node>) state.getGraph(); final Optional<Node<? extends View<?>, ? extends Edge>> oSource = context.getSource(); final Optional<Node<? extends View<?>, ? extends Edge>> oTarget = context.getTarget(); final Edge<? extends View<?>, ? extends Node> oConnector = context.getConnector(); final DefaultRuleViolations result = new DefaultRuleViolations(); if (!(oSource.isPresent() && oTarget.isPresent())) { return result; } final Node<?, Edge> source = (Node<?, Edge>) oSource.get(); final Node<?, Edge> target = (Node<?, Edge>) oTarget.get(); final Edge<?, Node> connector = (Edge<?, Node>) oConnector; try { final TreeWalkTraverseProcessor walker = getTreeWalker(source, target, connector); walker.traverse(graph, new TreeTraverseCallback<Graph, Node, Edge>() { final Set<Node> inProgress = new HashSet<>(); @Override public void startGraphTraversal(final Graph graph) { } @Override public boolean startNodeTraversal(final Node node) { if (inProgress.contains(node)) { throw new DirectedAcrylicGraphViolationException(); } inProgress.add(node); return true; } @Override public boolean startEdgeTraversal(final Edge edge) { return true; } @Override public void endNodeTraversal(final Node node) { inProgress.remove(node); } @Override public void endEdgeTraversal(final Edge edge) { } @Override public void endGraphTraversal() { } }); } catch (DirectedAcrylicGraphViolationException e) { result.addViolation(new RuleViolationImpl(ERROR_MESSAGE)); } return result; } @Override Class<AcyclicDirectedGraphRule> getExtensionType(); @Override Class<GraphConnectionContext> getContextType(); @Override boolean accepts(final RuleExtension rule,
final GraphConnectionContext context); @Override @SuppressWarnings("unchecked") RuleViolations evaluate(final RuleExtension rule,
final GraphConnectionContext context); }
|
AcyclicDirectedGraphRule extends RuleExtensionHandler<AcyclicDirectedGraphRule, GraphConnectionContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final RuleExtension rule, final GraphConnectionContext context) { final GraphEvaluationState state = context.getState(); final Graph<?, Node> graph = (Graph<?, Node>) state.getGraph(); final Optional<Node<? extends View<?>, ? extends Edge>> oSource = context.getSource(); final Optional<Node<? extends View<?>, ? extends Edge>> oTarget = context.getTarget(); final Edge<? extends View<?>, ? extends Node> oConnector = context.getConnector(); final DefaultRuleViolations result = new DefaultRuleViolations(); if (!(oSource.isPresent() && oTarget.isPresent())) { return result; } final Node<?, Edge> source = (Node<?, Edge>) oSource.get(); final Node<?, Edge> target = (Node<?, Edge>) oTarget.get(); final Edge<?, Node> connector = (Edge<?, Node>) oConnector; try { final TreeWalkTraverseProcessor walker = getTreeWalker(source, target, connector); walker.traverse(graph, new TreeTraverseCallback<Graph, Node, Edge>() { final Set<Node> inProgress = new HashSet<>(); @Override public void startGraphTraversal(final Graph graph) { } @Override public boolean startNodeTraversal(final Node node) { if (inProgress.contains(node)) { throw new DirectedAcrylicGraphViolationException(); } inProgress.add(node); return true; } @Override public boolean startEdgeTraversal(final Edge edge) { return true; } @Override public void endNodeTraversal(final Node node) { inProgress.remove(node); } @Override public void endEdgeTraversal(final Edge edge) { } @Override public void endGraphTraversal() { } }); } catch (DirectedAcrylicGraphViolationException e) { result.addViolation(new RuleViolationImpl(ERROR_MESSAGE)); } return result; } @Override Class<AcyclicDirectedGraphRule> getExtensionType(); @Override Class<GraphConnectionContext> getContextType(); @Override boolean accepts(final RuleExtension rule,
final GraphConnectionContext context); @Override @SuppressWarnings("unchecked") RuleViolations evaluate(final RuleExtension rule,
final GraphConnectionContext context); }
|
@Test @SuppressWarnings("unchecked") public void checkHasExistingConnection() { final Node node1 = new NodeImpl<>("node1"); final Node node2 = new NodeImpl<>("node2"); final Edge existingConnector = new EdgeImpl<>("edge1"); final ViewConnector existingConnectorView = mock(ViewConnector.class); existingConnector.setContent(existingConnectorView); when(existingConnectorView.getDefinition()).thenReturn(new Definition()); node1.getOutEdges().add(existingConnector); node2.getInEdges().add(existingConnector); existingConnector.setSourceNode(node1); existingConnector.setTargetNode(node2); graph.addNode(node1); graph.addNode(node2); when(context.getSource()).thenReturn(Optional.of(node1)); when(context.getTarget()).thenReturn(Optional.of(node2)); when(context.getConnector()).thenReturn(connector); final RuleViolations result = check.evaluate(rule, context); assertNotNull(result); assertTrue(result.violations().iterator().hasNext()); final RuleViolation violation = result.violations().iterator().next(); assertNotNull(violation); assertTrue(violation.getArguments().isPresent()); assertEquals(1, violation.getArguments().get().length); assertEquals(SingleConnectorPerTypeGraphRule.ERROR_MESSAGE, violation.getArguments().get()[0]); }
|
@Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final RuleExtension rule, final GraphConnectionContext context) { final Optional<Node<? extends View<?>, ? extends Edge>> oSource = context.getSource(); final Optional<Node<? extends View<?>, ? extends Edge>> oTarget = context.getTarget(); final DefaultRuleViolations result = new DefaultRuleViolations(); if (!(oSource.isPresent() && oTarget.isPresent())) { return result; } final Node<? extends View<?>, ? extends Edge> source = oSource.get(); final Node<? extends View<?>, ? extends Edge> target = oTarget.get(); final Edge<? extends View<?>, ? extends Node> connector = context.getConnector(); if (isConnectionAlreadyFormed(source, target, connector)) { result.addViolation(new RuleViolationImpl(ERROR_MESSAGE)); } return result; }
|
SingleConnectorPerTypeGraphRule extends RuleExtensionHandler<SingleConnectorPerTypeGraphRule, GraphConnectionContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final RuleExtension rule, final GraphConnectionContext context) { final Optional<Node<? extends View<?>, ? extends Edge>> oSource = context.getSource(); final Optional<Node<? extends View<?>, ? extends Edge>> oTarget = context.getTarget(); final DefaultRuleViolations result = new DefaultRuleViolations(); if (!(oSource.isPresent() && oTarget.isPresent())) { return result; } final Node<? extends View<?>, ? extends Edge> source = oSource.get(); final Node<? extends View<?>, ? extends Edge> target = oTarget.get(); final Edge<? extends View<?>, ? extends Node> connector = context.getConnector(); if (isConnectionAlreadyFormed(source, target, connector)) { result.addViolation(new RuleViolationImpl(ERROR_MESSAGE)); } return result; } }
|
SingleConnectorPerTypeGraphRule extends RuleExtensionHandler<SingleConnectorPerTypeGraphRule, GraphConnectionContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final RuleExtension rule, final GraphConnectionContext context) { final Optional<Node<? extends View<?>, ? extends Edge>> oSource = context.getSource(); final Optional<Node<? extends View<?>, ? extends Edge>> oTarget = context.getTarget(); final DefaultRuleViolations result = new DefaultRuleViolations(); if (!(oSource.isPresent() && oTarget.isPresent())) { return result; } final Node<? extends View<?>, ? extends Edge> source = oSource.get(); final Node<? extends View<?>, ? extends Edge> target = oTarget.get(); final Edge<? extends View<?>, ? extends Node> connector = context.getConnector(); if (isConnectionAlreadyFormed(source, target, connector)) { result.addViolation(new RuleViolationImpl(ERROR_MESSAGE)); } return result; } }
|
SingleConnectorPerTypeGraphRule extends RuleExtensionHandler<SingleConnectorPerTypeGraphRule, GraphConnectionContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final RuleExtension rule, final GraphConnectionContext context) { final Optional<Node<? extends View<?>, ? extends Edge>> oSource = context.getSource(); final Optional<Node<? extends View<?>, ? extends Edge>> oTarget = context.getTarget(); final DefaultRuleViolations result = new DefaultRuleViolations(); if (!(oSource.isPresent() && oTarget.isPresent())) { return result; } final Node<? extends View<?>, ? extends Edge> source = oSource.get(); final Node<? extends View<?>, ? extends Edge> target = oTarget.get(); final Edge<? extends View<?>, ? extends Node> connector = context.getConnector(); if (isConnectionAlreadyFormed(source, target, connector)) { result.addViolation(new RuleViolationImpl(ERROR_MESSAGE)); } return result; } @Override Class<SingleConnectorPerTypeGraphRule> getExtensionType(); @Override Class<GraphConnectionContext> getContextType(); @Override boolean accepts(final RuleExtension rule,
final GraphConnectionContext context); @Override @SuppressWarnings("unchecked") RuleViolations evaluate(final RuleExtension rule,
final GraphConnectionContext context); }
|
SingleConnectorPerTypeGraphRule extends RuleExtensionHandler<SingleConnectorPerTypeGraphRule, GraphConnectionContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final RuleExtension rule, final GraphConnectionContext context) { final Optional<Node<? extends View<?>, ? extends Edge>> oSource = context.getSource(); final Optional<Node<? extends View<?>, ? extends Edge>> oTarget = context.getTarget(); final DefaultRuleViolations result = new DefaultRuleViolations(); if (!(oSource.isPresent() && oTarget.isPresent())) { return result; } final Node<? extends View<?>, ? extends Edge> source = oSource.get(); final Node<? extends View<?>, ? extends Edge> target = oTarget.get(); final Edge<? extends View<?>, ? extends Node> connector = context.getConnector(); if (isConnectionAlreadyFormed(source, target, connector)) { result.addViolation(new RuleViolationImpl(ERROR_MESSAGE)); } return result; } @Override Class<SingleConnectorPerTypeGraphRule> getExtensionType(); @Override Class<GraphConnectionContext> getContextType(); @Override boolean accepts(final RuleExtension rule,
final GraphConnectionContext context); @Override @SuppressWarnings("unchecked") RuleViolations evaluate(final RuleExtension rule,
final GraphConnectionContext context); }
|
@Test public void testGetValue() { domElement.getValue(); verify(widget).getSelectedValue(); }
|
@Override public String getValue() { return widget.getSelectedValue(); }
|
ListBoxDOMElement extends BaseDOMElement<String, ListBox> implements TakesValue<String>,
Focusable { @Override public String getValue() { return widget.getSelectedValue(); } }
|
ListBoxDOMElement extends BaseDOMElement<String, ListBox> implements TakesValue<String>,
Focusable { @Override public String getValue() { return widget.getSelectedValue(); } ListBoxDOMElement(final ListBox widget,
final GridLayer gridLayer,
final GridWidget gridWidget,
final SessionManager sessionManager,
final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
final Function<GridCellTuple, Command> hasNoValueCommand,
final Function<GridCellValueTuple, Command> hasValueCommand); }
|
ListBoxDOMElement extends BaseDOMElement<String, ListBox> implements TakesValue<String>,
Focusable { @Override public String getValue() { return widget.getSelectedValue(); } ListBoxDOMElement(final ListBox widget,
final GridLayer gridLayer,
final GridWidget gridWidget,
final SessionManager sessionManager,
final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
final Function<GridCellTuple, Command> hasNoValueCommand,
final Function<GridCellValueTuple, Command> hasValueCommand); @Override void setValue(final String value); @Override String getValue(); @Override int getTabIndex(); @Override void setAccessKey(final char key); @Override void setFocus(final boolean focused); @Override void setTabIndex(final int index); @Override void initialise(final GridBodyCellRenderContext context); @Override @SuppressWarnings("unchecked") void flush(final String value); }
|
ListBoxDOMElement extends BaseDOMElement<String, ListBox> implements TakesValue<String>,
Focusable { @Override public String getValue() { return widget.getSelectedValue(); } ListBoxDOMElement(final ListBox widget,
final GridLayer gridLayer,
final GridWidget gridWidget,
final SessionManager sessionManager,
final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
final Function<GridCellTuple, Command> hasNoValueCommand,
final Function<GridCellValueTuple, Command> hasValueCommand); @Override void setValue(final String value); @Override String getValue(); @Override int getTabIndex(); @Override void setAccessKey(final char key); @Override void setFocus(final boolean focused); @Override void setTabIndex(final int index); @Override void initialise(final GridBodyCellRenderContext context); @Override @SuppressWarnings("unchecked") void flush(final String value); }
|
@Test @SuppressWarnings("unchecked") public void testEvaluate() { final Node source = mock(Node.class); final Node target = mock(Node.class); final View content = mock(View.class); final DynamicReadOnly dynamicReadonly = mock(DynamicReadOnly.class); when(dynamicReadonly.isAllowOnlyVisualChange()).thenReturn(true); when(content.getDefinition()).thenReturn(dynamicReadonly); when(target.getContent()).thenReturn(content); when(context.getSource()).thenReturn(Optional.of(source)); when(context.getTarget()).thenReturn(Optional.of(target)); final RuleViolations result = check.evaluate(rule, context); assertNotNull(result); final RuleViolation violation = result.violations().iterator().next(); assertNotNull(violation); assertTrue(violation.getArguments().isPresent()); assertEquals(1, violation.getArguments().get().length); assertEquals(NoInputNodesInImportedDecisionRule.ERROR_MESSAGE, violation.getArguments().get()[0]); }
|
@Override public RuleViolations evaluate(final RuleExtension rule, final GraphConnectionContext context) { final Optional<Node<? extends View<?>, ? extends Edge>> oSource = context.getSource(); final Optional<Node<? extends View<?>, ? extends Edge>> oTarget = context.getTarget(); final DefaultRuleViolations result = new DefaultRuleViolations(); if (!(oSource.isPresent() && oTarget.isPresent())) { return result; } if (isReadOnly(oTarget)) { result.addViolation(new RuleViolationImpl(ERROR_MESSAGE)); } return result; }
|
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { @Override public RuleViolations evaluate(final RuleExtension rule, final GraphConnectionContext context) { final Optional<Node<? extends View<?>, ? extends Edge>> oSource = context.getSource(); final Optional<Node<? extends View<?>, ? extends Edge>> oTarget = context.getTarget(); final DefaultRuleViolations result = new DefaultRuleViolations(); if (!(oSource.isPresent() && oTarget.isPresent())) { return result; } if (isReadOnly(oTarget)) { result.addViolation(new RuleViolationImpl(ERROR_MESSAGE)); } return result; } }
|
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { @Override public RuleViolations evaluate(final RuleExtension rule, final GraphConnectionContext context) { final Optional<Node<? extends View<?>, ? extends Edge>> oSource = context.getSource(); final Optional<Node<? extends View<?>, ? extends Edge>> oTarget = context.getTarget(); final DefaultRuleViolations result = new DefaultRuleViolations(); if (!(oSource.isPresent() && oTarget.isPresent())) { return result; } if (isReadOnly(oTarget)) { result.addViolation(new RuleViolationImpl(ERROR_MESSAGE)); } return result; } }
|
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { @Override public RuleViolations evaluate(final RuleExtension rule, final GraphConnectionContext context) { final Optional<Node<? extends View<?>, ? extends Edge>> oSource = context.getSource(); final Optional<Node<? extends View<?>, ? extends Edge>> oTarget = context.getTarget(); final DefaultRuleViolations result = new DefaultRuleViolations(); if (!(oSource.isPresent() && oTarget.isPresent())) { return result; } if (isReadOnly(oTarget)) { result.addViolation(new RuleViolationImpl(ERROR_MESSAGE)); } return result; } @Override Class<NoInputNodesInImportedDecisionRule> getExtensionType(); @Override Class<GraphConnectionContext> getContextType(); @Override boolean accepts(final RuleExtension rule,
final GraphConnectionContext context); @Override RuleViolations evaluate(final RuleExtension rule,
final GraphConnectionContext context); }
|
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { @Override public RuleViolations evaluate(final RuleExtension rule, final GraphConnectionContext context) { final Optional<Node<? extends View<?>, ? extends Edge>> oSource = context.getSource(); final Optional<Node<? extends View<?>, ? extends Edge>> oTarget = context.getTarget(); final DefaultRuleViolations result = new DefaultRuleViolations(); if (!(oSource.isPresent() && oTarget.isPresent())) { return result; } if (isReadOnly(oTarget)) { result.addViolation(new RuleViolationImpl(ERROR_MESSAGE)); } return result; } @Override Class<NoInputNodesInImportedDecisionRule> getExtensionType(); @Override Class<GraphConnectionContext> getContextType(); @Override boolean accepts(final RuleExtension rule,
final GraphConnectionContext context); @Override RuleViolations evaluate(final RuleExtension rule,
final GraphConnectionContext context); }
|
@Test @SuppressWarnings("unchecked") public void testIsReadOnly() { final Node target = mock(Node.class); final View content = mock(View.class); final DynamicReadOnly dynamicReadonly = mock(DynamicReadOnly.class); when(dynamicReadonly.isAllowOnlyVisualChange()).thenReturn(true); when(content.getDefinition()).thenReturn(dynamicReadonly); when(target.getContent()).thenReturn(content); when(context.getTarget()).thenReturn(Optional.of(target)); final boolean actual = check.isReadOnly(Optional.of(target)); assertTrue(actual); verify(check).isReadOnly(any(Optional.class)); }
|
boolean isReadOnly(final Optional<Node<? extends View<?>, ? extends Edge>> oTarget) { final Node<? extends View<?>, ? extends Edge> target = oTarget.get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); if (definition instanceof DynamicReadOnly) { if (((DynamicReadOnly) definition).isAllowOnlyVisualChange()) { return true; } } return false; }
|
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { boolean isReadOnly(final Optional<Node<? extends View<?>, ? extends Edge>> oTarget) { final Node<? extends View<?>, ? extends Edge> target = oTarget.get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); if (definition instanceof DynamicReadOnly) { if (((DynamicReadOnly) definition).isAllowOnlyVisualChange()) { return true; } } return false; } }
|
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { boolean isReadOnly(final Optional<Node<? extends View<?>, ? extends Edge>> oTarget) { final Node<? extends View<?>, ? extends Edge> target = oTarget.get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); if (definition instanceof DynamicReadOnly) { if (((DynamicReadOnly) definition).isAllowOnlyVisualChange()) { return true; } } return false; } }
|
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { boolean isReadOnly(final Optional<Node<? extends View<?>, ? extends Edge>> oTarget) { final Node<? extends View<?>, ? extends Edge> target = oTarget.get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); if (definition instanceof DynamicReadOnly) { if (((DynamicReadOnly) definition).isAllowOnlyVisualChange()) { return true; } } return false; } @Override Class<NoInputNodesInImportedDecisionRule> getExtensionType(); @Override Class<GraphConnectionContext> getContextType(); @Override boolean accepts(final RuleExtension rule,
final GraphConnectionContext context); @Override RuleViolations evaluate(final RuleExtension rule,
final GraphConnectionContext context); }
|
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { boolean isReadOnly(final Optional<Node<? extends View<?>, ? extends Edge>> oTarget) { final Node<? extends View<?>, ? extends Edge> target = oTarget.get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); if (definition instanceof DynamicReadOnly) { if (((DynamicReadOnly) definition).isAllowOnlyVisualChange()) { return true; } } return false; } @Override Class<NoInputNodesInImportedDecisionRule> getExtensionType(); @Override Class<GraphConnectionContext> getContextType(); @Override boolean accepts(final RuleExtension rule,
final GraphConnectionContext context); @Override RuleViolations evaluate(final RuleExtension rule,
final GraphConnectionContext context); }
|
@Test public void testAcceptWhenIsExpectedClass() { when(rule.getId()).thenReturn(definition.getClass().getName()); final boolean actual = check.accepts(rule, context); assertTrue(actual); }
|
@Override public boolean accepts(final RuleExtension rule, final GraphConnectionContext context) { if (context.getTarget().isPresent()) { final Node<? extends View<?>, ? extends Edge> target = context.getTarget().get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); return Objects.equals(definition.getClass().getName(), rule.getId()); } return false; }
|
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { @Override public boolean accepts(final RuleExtension rule, final GraphConnectionContext context) { if (context.getTarget().isPresent()) { final Node<? extends View<?>, ? extends Edge> target = context.getTarget().get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); return Objects.equals(definition.getClass().getName(), rule.getId()); } return false; } }
|
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { @Override public boolean accepts(final RuleExtension rule, final GraphConnectionContext context) { if (context.getTarget().isPresent()) { final Node<? extends View<?>, ? extends Edge> target = context.getTarget().get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); return Objects.equals(definition.getClass().getName(), rule.getId()); } return false; } }
|
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { @Override public boolean accepts(final RuleExtension rule, final GraphConnectionContext context) { if (context.getTarget().isPresent()) { final Node<? extends View<?>, ? extends Edge> target = context.getTarget().get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); return Objects.equals(definition.getClass().getName(), rule.getId()); } return false; } @Override Class<NoInputNodesInImportedDecisionRule> getExtensionType(); @Override Class<GraphConnectionContext> getContextType(); @Override boolean accepts(final RuleExtension rule,
final GraphConnectionContext context); @Override RuleViolations evaluate(final RuleExtension rule,
final GraphConnectionContext context); }
|
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { @Override public boolean accepts(final RuleExtension rule, final GraphConnectionContext context) { if (context.getTarget().isPresent()) { final Node<? extends View<?>, ? extends Edge> target = context.getTarget().get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); return Objects.equals(definition.getClass().getName(), rule.getId()); } return false; } @Override Class<NoInputNodesInImportedDecisionRule> getExtensionType(); @Override Class<GraphConnectionContext> getContextType(); @Override boolean accepts(final RuleExtension rule,
final GraphConnectionContext context); @Override RuleViolations evaluate(final RuleExtension rule,
final GraphConnectionContext context); }
|
@Test public void testAcceptWhenIsNotExpectedClass() { when(rule.getId()).thenReturn("SomeOtherClass"); final boolean actual = check.accepts(rule, context); assertFalse(actual); }
|
@Override public boolean accepts(final RuleExtension rule, final GraphConnectionContext context) { if (context.getTarget().isPresent()) { final Node<? extends View<?>, ? extends Edge> target = context.getTarget().get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); return Objects.equals(definition.getClass().getName(), rule.getId()); } return false; }
|
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { @Override public boolean accepts(final RuleExtension rule, final GraphConnectionContext context) { if (context.getTarget().isPresent()) { final Node<? extends View<?>, ? extends Edge> target = context.getTarget().get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); return Objects.equals(definition.getClass().getName(), rule.getId()); } return false; } }
|
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { @Override public boolean accepts(final RuleExtension rule, final GraphConnectionContext context) { if (context.getTarget().isPresent()) { final Node<? extends View<?>, ? extends Edge> target = context.getTarget().get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); return Objects.equals(definition.getClass().getName(), rule.getId()); } return false; } }
|
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { @Override public boolean accepts(final RuleExtension rule, final GraphConnectionContext context) { if (context.getTarget().isPresent()) { final Node<? extends View<?>, ? extends Edge> target = context.getTarget().get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); return Objects.equals(definition.getClass().getName(), rule.getId()); } return false; } @Override Class<NoInputNodesInImportedDecisionRule> getExtensionType(); @Override Class<GraphConnectionContext> getContextType(); @Override boolean accepts(final RuleExtension rule,
final GraphConnectionContext context); @Override RuleViolations evaluate(final RuleExtension rule,
final GraphConnectionContext context); }
|
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { @Override public boolean accepts(final RuleExtension rule, final GraphConnectionContext context) { if (context.getTarget().isPresent()) { final Node<? extends View<?>, ? extends Edge> target = context.getTarget().get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); return Objects.equals(definition.getClass().getName(), rule.getId()); } return false; } @Override Class<NoInputNodesInImportedDecisionRule> getExtensionType(); @Override Class<GraphConnectionContext> getContextType(); @Override boolean accepts(final RuleExtension rule,
final GraphConnectionContext context); @Override RuleViolations evaluate(final RuleExtension rule,
final GraphConnectionContext context); }
|
@Test public void testGetHasTypeRefs() { final OutputClauseLiteralExpression outputClauseLiteralExpression = mock(OutputClauseLiteralExpression.class); final HasTypeRef hasTypeRef1 = mock(HasTypeRef.class); final HasTypeRef hasTypeRef2 = mock(HasTypeRef.class); doReturn(outputClauseLiteralExpression).when(outputClause).getDefaultOutputEntry(); when(outputClauseLiteralExpression.getHasTypeRefs()).thenReturn(asList(hasTypeRef1, hasTypeRef2)); final List<HasTypeRef> actualHasTypeRefs = outputClause.getHasTypeRefs(); final List<HasTypeRef> expectedHasTypeRefs = asList(outputClause, hasTypeRef1, hasTypeRef2); assertEquals(expectedHasTypeRefs, actualHasTypeRefs); }
|
@Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = new ArrayList<>(singletonList(this)); hasTypeRefs.addAll(getNotNullHasTypeRefs(getDefaultOutputEntry())); return hasTypeRefs; }
|
OutputClause extends DMNElement implements HasTypeRef,
DomainObject { @Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = new ArrayList<>(singletonList(this)); hasTypeRefs.addAll(getNotNullHasTypeRefs(getDefaultOutputEntry())); return hasTypeRefs; } }
|
OutputClause extends DMNElement implements HasTypeRef,
DomainObject { @Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = new ArrayList<>(singletonList(this)); hasTypeRefs.addAll(getNotNullHasTypeRefs(getDefaultOutputEntry())); return hasTypeRefs; } OutputClause(); OutputClause(final Id id,
final Description description,
final OutputClauseUnaryTests outputValues,
final OutputClauseLiteralExpression defaultOutputEntry,
final String name,
final QName typeRef); }
|
OutputClause extends DMNElement implements HasTypeRef,
DomainObject { @Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = new ArrayList<>(singletonList(this)); hasTypeRefs.addAll(getNotNullHasTypeRefs(getDefaultOutputEntry())); return hasTypeRefs; } OutputClause(); OutputClause(final Id id,
final Description description,
final OutputClauseUnaryTests outputValues,
final OutputClauseLiteralExpression defaultOutputEntry,
final String name,
final QName typeRef); OutputClause copy(); @Override List<HasTypeRef> getHasTypeRefs(); String getStunnerCategory(); Set<String> getStunnerLabels(); OutputClauseUnaryTests getOutputValues(); void setOutputValues(final OutputClauseUnaryTests value); OutputClauseLiteralExpression getDefaultOutputEntry(); void setDefaultOutputEntry(final OutputClauseLiteralExpression value); String getName(); void setName(final String value); @Override QName getTypeRef(); @Override void setTypeRef(final QName value); @Override DMNModelInstrumentedBase asDMNModelInstrumentedBase(); @Override String getDomainObjectUUID(); @Override String getDomainObjectNameTranslationKey(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
OutputClause extends DMNElement implements HasTypeRef,
DomainObject { @Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = new ArrayList<>(singletonList(this)); hasTypeRefs.addAll(getNotNullHasTypeRefs(getDefaultOutputEntry())); return hasTypeRefs; } OutputClause(); OutputClause(final Id id,
final Description description,
final OutputClauseUnaryTests outputValues,
final OutputClauseLiteralExpression defaultOutputEntry,
final String name,
final QName typeRef); OutputClause copy(); @Override List<HasTypeRef> getHasTypeRefs(); String getStunnerCategory(); Set<String> getStunnerLabels(); OutputClauseUnaryTests getOutputValues(); void setOutputValues(final OutputClauseUnaryTests value); OutputClauseLiteralExpression getDefaultOutputEntry(); void setDefaultOutputEntry(final OutputClauseLiteralExpression value); String getName(); void setName(final String value); @Override QName getTypeRef(); @Override void setTypeRef(final QName value); @Override DMNModelInstrumentedBase asDMNModelInstrumentedBase(); @Override String getDomainObjectUUID(); @Override String getDomainObjectNameTranslationKey(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testCopy() { final OutputClause source = new OutputClause( new Id(OUTPUT_ID), new Description(DESCRIPTION), buildOutputClauseUnaryTests(), buildOutputClauseLiteralExpression(), NAME, BuiltInType.BOOLEAN.asQName() ); final OutputClause target = source.copy(); assertNotNull(target); assertNotEquals(OUTPUT_ID, target.getId().getValue()); assertEquals(DESCRIPTION, target.getDescription().getValue()); assertNotNull(target.getOutputValues()); assertNotEquals(CLAUSE_ID, target.getOutputValues().getId()); assertEquals(TEXT, target.getOutputValues().getText().getValue()); assertNotNull(target.getOutputValues()); assertNotEquals(UNARY_ID, target.getOutputValues().getId()); assertEquals(TEXT, target.getOutputValues().getText().getValue()); assertEquals(ConstraintType.ENUMERATION, target.getOutputValues().getConstraintType()); }
|
public OutputClause copy() { return new OutputClause( new Id(), Optional.ofNullable(description).map(Description::copy).orElse(null), Optional.ofNullable(outputValues).map(OutputClauseUnaryTests::copy).orElse(null), Optional.ofNullable(defaultOutputEntry).map(OutputClauseLiteralExpression::copy).orElse(null), name, Optional.ofNullable(typeRef).map(QName::copy).orElse(null) ); }
|
OutputClause extends DMNElement implements HasTypeRef,
DomainObject { public OutputClause copy() { return new OutputClause( new Id(), Optional.ofNullable(description).map(Description::copy).orElse(null), Optional.ofNullable(outputValues).map(OutputClauseUnaryTests::copy).orElse(null), Optional.ofNullable(defaultOutputEntry).map(OutputClauseLiteralExpression::copy).orElse(null), name, Optional.ofNullable(typeRef).map(QName::copy).orElse(null) ); } }
|
OutputClause extends DMNElement implements HasTypeRef,
DomainObject { public OutputClause copy() { return new OutputClause( new Id(), Optional.ofNullable(description).map(Description::copy).orElse(null), Optional.ofNullable(outputValues).map(OutputClauseUnaryTests::copy).orElse(null), Optional.ofNullable(defaultOutputEntry).map(OutputClauseLiteralExpression::copy).orElse(null), name, Optional.ofNullable(typeRef).map(QName::copy).orElse(null) ); } OutputClause(); OutputClause(final Id id,
final Description description,
final OutputClauseUnaryTests outputValues,
final OutputClauseLiteralExpression defaultOutputEntry,
final String name,
final QName typeRef); }
|
OutputClause extends DMNElement implements HasTypeRef,
DomainObject { public OutputClause copy() { return new OutputClause( new Id(), Optional.ofNullable(description).map(Description::copy).orElse(null), Optional.ofNullable(outputValues).map(OutputClauseUnaryTests::copy).orElse(null), Optional.ofNullable(defaultOutputEntry).map(OutputClauseLiteralExpression::copy).orElse(null), name, Optional.ofNullable(typeRef).map(QName::copy).orElse(null) ); } OutputClause(); OutputClause(final Id id,
final Description description,
final OutputClauseUnaryTests outputValues,
final OutputClauseLiteralExpression defaultOutputEntry,
final String name,
final QName typeRef); OutputClause copy(); @Override List<HasTypeRef> getHasTypeRefs(); String getStunnerCategory(); Set<String> getStunnerLabels(); OutputClauseUnaryTests getOutputValues(); void setOutputValues(final OutputClauseUnaryTests value); OutputClauseLiteralExpression getDefaultOutputEntry(); void setDefaultOutputEntry(final OutputClauseLiteralExpression value); String getName(); void setName(final String value); @Override QName getTypeRef(); @Override void setTypeRef(final QName value); @Override DMNModelInstrumentedBase asDMNModelInstrumentedBase(); @Override String getDomainObjectUUID(); @Override String getDomainObjectNameTranslationKey(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
OutputClause extends DMNElement implements HasTypeRef,
DomainObject { public OutputClause copy() { return new OutputClause( new Id(), Optional.ofNullable(description).map(Description::copy).orElse(null), Optional.ofNullable(outputValues).map(OutputClauseUnaryTests::copy).orElse(null), Optional.ofNullable(defaultOutputEntry).map(OutputClauseLiteralExpression::copy).orElse(null), name, Optional.ofNullable(typeRef).map(QName::copy).orElse(null) ); } OutputClause(); OutputClause(final Id id,
final Description description,
final OutputClauseUnaryTests outputValues,
final OutputClauseLiteralExpression defaultOutputEntry,
final String name,
final QName typeRef); OutputClause copy(); @Override List<HasTypeRef> getHasTypeRefs(); String getStunnerCategory(); Set<String> getStunnerLabels(); OutputClauseUnaryTests getOutputValues(); void setOutputValues(final OutputClauseUnaryTests value); OutputClauseLiteralExpression getDefaultOutputEntry(); void setDefaultOutputEntry(final OutputClauseLiteralExpression value); String getName(); void setName(final String value); @Override QName getTypeRef(); @Override void setTypeRef(final QName value); @Override DMNModelInstrumentedBase asDMNModelInstrumentedBase(); @Override String getDomainObjectUUID(); @Override String getDomainObjectNameTranslationKey(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testDefaultHitPolicy() { assertEquals(HitPolicy.UNIQUE, decisionTable.getHitPolicy()); }
|
public HitPolicy getHitPolicy() { if (hitPolicy == null) { return HitPolicy.UNIQUE; } else { return hitPolicy; } }
|
DecisionTable extends Expression { public HitPolicy getHitPolicy() { if (hitPolicy == null) { return HitPolicy.UNIQUE; } else { return hitPolicy; } } }
|
DecisionTable extends Expression { public HitPolicy getHitPolicy() { if (hitPolicy == null) { return HitPolicy.UNIQUE; } else { return hitPolicy; } } DecisionTable(); DecisionTable(final Id id,
final Description description,
final QName typeRef,
final List<InputClause> input,
final List<OutputClause> output,
final List<DecisionRule> rule,
final HitPolicy hitPolicy,
final BuiltinAggregator aggregation,
final DecisionTableOrientation preferredOrientation,
final String outputLabel); }
|
DecisionTable extends Expression { public HitPolicy getHitPolicy() { if (hitPolicy == null) { return HitPolicy.UNIQUE; } else { return hitPolicy; } } DecisionTable(); DecisionTable(final Id id,
final Description description,
final QName typeRef,
final List<InputClause> input,
final List<OutputClause> output,
final List<DecisionRule> rule,
final HitPolicy hitPolicy,
final BuiltinAggregator aggregation,
final DecisionTableOrientation preferredOrientation,
final String outputLabel); @Override DecisionTable copy(); List<RuleAnnotationClause> getAnnotations(); List<InputClause> getInput(); List<OutputClause> getOutput(); List<DecisionRule> getRule(); HitPolicy getHitPolicy(); void setHitPolicy(final HitPolicy value); BuiltinAggregator getAggregation(); void setAggregation(final BuiltinAggregator value); DecisionTableOrientation getPreferredOrientation(); void setPreferredOrientation(final DecisionTableOrientation value); String getOutputLabel(); void setOutputLabel(final String value); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
DecisionTable extends Expression { public HitPolicy getHitPolicy() { if (hitPolicy == null) { return HitPolicy.UNIQUE; } else { return hitPolicy; } } DecisionTable(); DecisionTable(final Id id,
final Description description,
final QName typeRef,
final List<InputClause> input,
final List<OutputClause> output,
final List<DecisionRule> rule,
final HitPolicy hitPolicy,
final BuiltinAggregator aggregation,
final DecisionTableOrientation preferredOrientation,
final String outputLabel); @Override DecisionTable copy(); List<RuleAnnotationClause> getAnnotations(); List<InputClause> getInput(); List<OutputClause> getOutput(); List<DecisionRule> getRule(); HitPolicy getHitPolicy(); void setHitPolicy(final HitPolicy value); BuiltinAggregator getAggregation(); void setAggregation(final BuiltinAggregator value); DecisionTableOrientation getPreferredOrientation(); void setPreferredOrientation(final DecisionTableOrientation value); String getOutputLabel(); void setOutputLabel(final String value); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testGetHasTypeRefs() { final InputClause inputClauses1 = mock(InputClause.class); final InputClause inputClauses2 = mock(InputClause.class); final List<InputClause> inputClauses = asList(inputClauses1, inputClauses2); final OutputClause outputClauses1 = mock(OutputClause.class); final OutputClause outputClauses2 = mock(OutputClause.class); final List<OutputClause> outputClauses = asList(outputClauses1, outputClauses2); final DecisionRule decisionRules1 = mock(DecisionRule.class); final DecisionRule decisionRules2 = mock(DecisionRule.class); final List<DecisionRule> decisionRules = asList(decisionRules1, decisionRules2); final HasTypeRef hasTypeRef1 = mock(HasTypeRef.class); final HasTypeRef hasTypeRef2 = mock(HasTypeRef.class); final HasTypeRef hasTypeRef3 = mock(HasTypeRef.class); final HasTypeRef hasTypeRef4 = mock(HasTypeRef.class); final HasTypeRef hasTypeRef5 = mock(HasTypeRef.class); final HasTypeRef hasTypeRef6 = mock(HasTypeRef.class); doReturn(inputClauses).when(decisionTable).getInput(); doReturn(outputClauses).when(decisionTable).getOutput(); doReturn(decisionRules).when(decisionTable).getRule(); when(inputClauses1.getHasTypeRefs()).thenReturn(asList(hasTypeRef1)); when(inputClauses2.getHasTypeRefs()).thenReturn(asList(hasTypeRef2)); when(outputClauses1.getHasTypeRefs()).thenReturn(asList(hasTypeRef3)); when(outputClauses2.getHasTypeRefs()).thenReturn(asList(hasTypeRef4)); when(decisionRules1.getHasTypeRefs()).thenReturn(asList(hasTypeRef5)); when(decisionRules2.getHasTypeRefs()).thenReturn(asList(hasTypeRef6)); final List<HasTypeRef> actualHasTypeRefs = decisionTable.getHasTypeRefs(); final List<HasTypeRef> expectedHasTypeRefs = asList(decisionTable, hasTypeRef1, hasTypeRef2, hasTypeRef3, hasTypeRef4, hasTypeRef5, hasTypeRef6); assertEquals(expectedHasTypeRefs, actualHasTypeRefs); }
|
@Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = super.getHasTypeRefs(); hasTypeRefs.addAll(getFlatHasTypeRefs(getInput())); hasTypeRefs.addAll(getFlatHasTypeRefs(getOutput())); hasTypeRefs.addAll(getFlatHasTypeRefs(getRule())); return hasTypeRefs; }
|
DecisionTable extends Expression { @Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = super.getHasTypeRefs(); hasTypeRefs.addAll(getFlatHasTypeRefs(getInput())); hasTypeRefs.addAll(getFlatHasTypeRefs(getOutput())); hasTypeRefs.addAll(getFlatHasTypeRefs(getRule())); return hasTypeRefs; } }
|
DecisionTable extends Expression { @Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = super.getHasTypeRefs(); hasTypeRefs.addAll(getFlatHasTypeRefs(getInput())); hasTypeRefs.addAll(getFlatHasTypeRefs(getOutput())); hasTypeRefs.addAll(getFlatHasTypeRefs(getRule())); return hasTypeRefs; } DecisionTable(); DecisionTable(final Id id,
final Description description,
final QName typeRef,
final List<InputClause> input,
final List<OutputClause> output,
final List<DecisionRule> rule,
final HitPolicy hitPolicy,
final BuiltinAggregator aggregation,
final DecisionTableOrientation preferredOrientation,
final String outputLabel); }
|
DecisionTable extends Expression { @Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = super.getHasTypeRefs(); hasTypeRefs.addAll(getFlatHasTypeRefs(getInput())); hasTypeRefs.addAll(getFlatHasTypeRefs(getOutput())); hasTypeRefs.addAll(getFlatHasTypeRefs(getRule())); return hasTypeRefs; } DecisionTable(); DecisionTable(final Id id,
final Description description,
final QName typeRef,
final List<InputClause> input,
final List<OutputClause> output,
final List<DecisionRule> rule,
final HitPolicy hitPolicy,
final BuiltinAggregator aggregation,
final DecisionTableOrientation preferredOrientation,
final String outputLabel); @Override DecisionTable copy(); List<RuleAnnotationClause> getAnnotations(); List<InputClause> getInput(); List<OutputClause> getOutput(); List<DecisionRule> getRule(); HitPolicy getHitPolicy(); void setHitPolicy(final HitPolicy value); BuiltinAggregator getAggregation(); void setAggregation(final BuiltinAggregator value); DecisionTableOrientation getPreferredOrientation(); void setPreferredOrientation(final DecisionTableOrientation value); String getOutputLabel(); void setOutputLabel(final String value); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
DecisionTable extends Expression { @Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = super.getHasTypeRefs(); hasTypeRefs.addAll(getFlatHasTypeRefs(getInput())); hasTypeRefs.addAll(getFlatHasTypeRefs(getOutput())); hasTypeRefs.addAll(getFlatHasTypeRefs(getRule())); return hasTypeRefs; } DecisionTable(); DecisionTable(final Id id,
final Description description,
final QName typeRef,
final List<InputClause> input,
final List<OutputClause> output,
final List<DecisionRule> rule,
final HitPolicy hitPolicy,
final BuiltinAggregator aggregation,
final DecisionTableOrientation preferredOrientation,
final String outputLabel); @Override DecisionTable copy(); List<RuleAnnotationClause> getAnnotations(); List<InputClause> getInput(); List<OutputClause> getOutput(); List<DecisionRule> getRule(); HitPolicy getHitPolicy(); void setHitPolicy(final HitPolicy value); BuiltinAggregator getAggregation(); void setAggregation(final BuiltinAggregator value); DecisionTableOrientation getPreferredOrientation(); void setPreferredOrientation(final DecisionTableOrientation value); String getOutputLabel(); void setOutputLabel(final String value); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testComponentWidths() { assertEquals(decisionTable.getRequiredComponentWidthCount(), decisionTable.getComponentWidths().size()); decisionTable.getComponentWidths().forEach(Assert::assertNull); }
|
@Override public int getRequiredComponentWidthCount() { return getInput().size() + getOutput().size() + getAnnotations().size() + STATIC_COLUMNS; }
|
DecisionTable extends Expression { @Override public int getRequiredComponentWidthCount() { return getInput().size() + getOutput().size() + getAnnotations().size() + STATIC_COLUMNS; } }
|
DecisionTable extends Expression { @Override public int getRequiredComponentWidthCount() { return getInput().size() + getOutput().size() + getAnnotations().size() + STATIC_COLUMNS; } DecisionTable(); DecisionTable(final Id id,
final Description description,
final QName typeRef,
final List<InputClause> input,
final List<OutputClause> output,
final List<DecisionRule> rule,
final HitPolicy hitPolicy,
final BuiltinAggregator aggregation,
final DecisionTableOrientation preferredOrientation,
final String outputLabel); }
|
DecisionTable extends Expression { @Override public int getRequiredComponentWidthCount() { return getInput().size() + getOutput().size() + getAnnotations().size() + STATIC_COLUMNS; } DecisionTable(); DecisionTable(final Id id,
final Description description,
final QName typeRef,
final List<InputClause> input,
final List<OutputClause> output,
final List<DecisionRule> rule,
final HitPolicy hitPolicy,
final BuiltinAggregator aggregation,
final DecisionTableOrientation preferredOrientation,
final String outputLabel); @Override DecisionTable copy(); List<RuleAnnotationClause> getAnnotations(); List<InputClause> getInput(); List<OutputClause> getOutput(); List<DecisionRule> getRule(); HitPolicy getHitPolicy(); void setHitPolicy(final HitPolicy value); BuiltinAggregator getAggregation(); void setAggregation(final BuiltinAggregator value); DecisionTableOrientation getPreferredOrientation(); void setPreferredOrientation(final DecisionTableOrientation value); String getOutputLabel(); void setOutputLabel(final String value); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
DecisionTable extends Expression { @Override public int getRequiredComponentWidthCount() { return getInput().size() + getOutput().size() + getAnnotations().size() + STATIC_COLUMNS; } DecisionTable(); DecisionTable(final Id id,
final Description description,
final QName typeRef,
final List<InputClause> input,
final List<OutputClause> output,
final List<DecisionRule> rule,
final HitPolicy hitPolicy,
final BuiltinAggregator aggregation,
final DecisionTableOrientation preferredOrientation,
final String outputLabel); @Override DecisionTable copy(); List<RuleAnnotationClause> getAnnotations(); List<InputClause> getInput(); List<OutputClause> getOutput(); List<DecisionRule> getRule(); HitPolicy getHitPolicy(); void setHitPolicy(final HitPolicy value); BuiltinAggregator getAggregation(); void setAggregation(final BuiltinAggregator value); DecisionTableOrientation getPreferredOrientation(); void setPreferredOrientation(final DecisionTableOrientation value); String getOutputLabel(); void setOutputLabel(final String value); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testCopy() { final DecisionTable source = new DecisionTable(new Id(TABLE_ID), new Description(DESCRIPTION), BuiltInType.BOOLEAN.asQName(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), HitPolicy.UNIQUE, SUM, DecisionTableOrientation.RULE_AS_ROW, OUTPUT_LABEL); final DecisionTable target = source.copy(); assertNotNull(target); assertNotEquals(TABLE_ID, target.getId().getValue()); assertEquals(DESCRIPTION, target.getDescription().getValue()); assertEquals(BuiltInType.BOOLEAN.asQName(), target.getTypeRef()); assertTrue(target.getInput().isEmpty()); assertTrue(target.getOutput().isEmpty()); assertTrue(target.getRule().isEmpty()); assertEquals(HitPolicy.UNIQUE, target.getHitPolicy()); assertEquals(SUM, target.getAggregation()); assertEquals(DecisionTableOrientation.RULE_AS_ROW, target.getPreferredOrientation()); assertEquals(OUTPUT_LABEL, target.getOutputLabel()); }
|
@Override public DecisionTable copy() { final DecisionTable clonedDecisionTable = new DecisionTable(); clonedDecisionTable.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedDecisionTable.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedDecisionTable.componentWidths = new ArrayList<>(componentWidths); clonedDecisionTable.input = input.stream().map(InputClause::copy).collect(Collectors.toList()); clonedDecisionTable.output = output.stream().map(OutputClause::copy).collect(Collectors.toList()); clonedDecisionTable.rule = rule.stream().map(DecisionRule::copy).collect(Collectors.toList()); clonedDecisionTable.annotations = Optional.ofNullable(annotations) .map(annotationEntryList -> annotationEntryList.stream().map(RuleAnnotationClause::copy).collect(Collectors.toList())) .orElse(null); clonedDecisionTable.hitPolicy = hitPolicy; clonedDecisionTable.aggregation = aggregation; clonedDecisionTable.preferredOrientation = preferredOrientation; clonedDecisionTable.outputLabel = outputLabel; return clonedDecisionTable; }
|
DecisionTable extends Expression { @Override public DecisionTable copy() { final DecisionTable clonedDecisionTable = new DecisionTable(); clonedDecisionTable.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedDecisionTable.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedDecisionTable.componentWidths = new ArrayList<>(componentWidths); clonedDecisionTable.input = input.stream().map(InputClause::copy).collect(Collectors.toList()); clonedDecisionTable.output = output.stream().map(OutputClause::copy).collect(Collectors.toList()); clonedDecisionTable.rule = rule.stream().map(DecisionRule::copy).collect(Collectors.toList()); clonedDecisionTable.annotations = Optional.ofNullable(annotations) .map(annotationEntryList -> annotationEntryList.stream().map(RuleAnnotationClause::copy).collect(Collectors.toList())) .orElse(null); clonedDecisionTable.hitPolicy = hitPolicy; clonedDecisionTable.aggregation = aggregation; clonedDecisionTable.preferredOrientation = preferredOrientation; clonedDecisionTable.outputLabel = outputLabel; return clonedDecisionTable; } }
|
DecisionTable extends Expression { @Override public DecisionTable copy() { final DecisionTable clonedDecisionTable = new DecisionTable(); clonedDecisionTable.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedDecisionTable.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedDecisionTable.componentWidths = new ArrayList<>(componentWidths); clonedDecisionTable.input = input.stream().map(InputClause::copy).collect(Collectors.toList()); clonedDecisionTable.output = output.stream().map(OutputClause::copy).collect(Collectors.toList()); clonedDecisionTable.rule = rule.stream().map(DecisionRule::copy).collect(Collectors.toList()); clonedDecisionTable.annotations = Optional.ofNullable(annotations) .map(annotationEntryList -> annotationEntryList.stream().map(RuleAnnotationClause::copy).collect(Collectors.toList())) .orElse(null); clonedDecisionTable.hitPolicy = hitPolicy; clonedDecisionTable.aggregation = aggregation; clonedDecisionTable.preferredOrientation = preferredOrientation; clonedDecisionTable.outputLabel = outputLabel; return clonedDecisionTable; } DecisionTable(); DecisionTable(final Id id,
final Description description,
final QName typeRef,
final List<InputClause> input,
final List<OutputClause> output,
final List<DecisionRule> rule,
final HitPolicy hitPolicy,
final BuiltinAggregator aggregation,
final DecisionTableOrientation preferredOrientation,
final String outputLabel); }
|
DecisionTable extends Expression { @Override public DecisionTable copy() { final DecisionTable clonedDecisionTable = new DecisionTable(); clonedDecisionTable.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedDecisionTable.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedDecisionTable.componentWidths = new ArrayList<>(componentWidths); clonedDecisionTable.input = input.stream().map(InputClause::copy).collect(Collectors.toList()); clonedDecisionTable.output = output.stream().map(OutputClause::copy).collect(Collectors.toList()); clonedDecisionTable.rule = rule.stream().map(DecisionRule::copy).collect(Collectors.toList()); clonedDecisionTable.annotations = Optional.ofNullable(annotations) .map(annotationEntryList -> annotationEntryList.stream().map(RuleAnnotationClause::copy).collect(Collectors.toList())) .orElse(null); clonedDecisionTable.hitPolicy = hitPolicy; clonedDecisionTable.aggregation = aggregation; clonedDecisionTable.preferredOrientation = preferredOrientation; clonedDecisionTable.outputLabel = outputLabel; return clonedDecisionTable; } DecisionTable(); DecisionTable(final Id id,
final Description description,
final QName typeRef,
final List<InputClause> input,
final List<OutputClause> output,
final List<DecisionRule> rule,
final HitPolicy hitPolicy,
final BuiltinAggregator aggregation,
final DecisionTableOrientation preferredOrientation,
final String outputLabel); @Override DecisionTable copy(); List<RuleAnnotationClause> getAnnotations(); List<InputClause> getInput(); List<OutputClause> getOutput(); List<DecisionRule> getRule(); HitPolicy getHitPolicy(); void setHitPolicy(final HitPolicy value); BuiltinAggregator getAggregation(); void setAggregation(final BuiltinAggregator value); DecisionTableOrientation getPreferredOrientation(); void setPreferredOrientation(final DecisionTableOrientation value); String getOutputLabel(); void setOutputLabel(final String value); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
DecisionTable extends Expression { @Override public DecisionTable copy() { final DecisionTable clonedDecisionTable = new DecisionTable(); clonedDecisionTable.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedDecisionTable.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedDecisionTable.componentWidths = new ArrayList<>(componentWidths); clonedDecisionTable.input = input.stream().map(InputClause::copy).collect(Collectors.toList()); clonedDecisionTable.output = output.stream().map(OutputClause::copy).collect(Collectors.toList()); clonedDecisionTable.rule = rule.stream().map(DecisionRule::copy).collect(Collectors.toList()); clonedDecisionTable.annotations = Optional.ofNullable(annotations) .map(annotationEntryList -> annotationEntryList.stream().map(RuleAnnotationClause::copy).collect(Collectors.toList())) .orElse(null); clonedDecisionTable.hitPolicy = hitPolicy; clonedDecisionTable.aggregation = aggregation; clonedDecisionTable.preferredOrientation = preferredOrientation; clonedDecisionTable.outputLabel = outputLabel; return clonedDecisionTable; } DecisionTable(); DecisionTable(final Id id,
final Description description,
final QName typeRef,
final List<InputClause> input,
final List<OutputClause> output,
final List<DecisionRule> rule,
final HitPolicy hitPolicy,
final BuiltinAggregator aggregation,
final DecisionTableOrientation preferredOrientation,
final String outputLabel); @Override DecisionTable copy(); List<RuleAnnotationClause> getAnnotations(); List<InputClause> getInput(); List<OutputClause> getOutput(); List<DecisionRule> getRule(); HitPolicy getHitPolicy(); void setHitPolicy(final HitPolicy value); BuiltinAggregator getAggregation(); void setAggregation(final BuiltinAggregator value); DecisionTableOrientation getPreferredOrientation(); void setPreferredOrientation(final DecisionTableOrientation value); String getOutputLabel(); void setOutputLabel(final String value); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testSetValue() { domElement.setValue(VALUE); verify(widget).setValue(VALUE); }
|
@Override public void setValue(final String value) { getWidget().setValue(value); this.originalValue = value; }
|
TextBoxDOMElement extends BaseDOMElement<String, TextBox> implements TakesValue<String>,
Focusable { @Override public void setValue(final String value) { getWidget().setValue(value); this.originalValue = value; } }
|
TextBoxDOMElement extends BaseDOMElement<String, TextBox> implements TakesValue<String>,
Focusable { @Override public void setValue(final String value) { getWidget().setValue(value); this.originalValue = value; } TextBoxDOMElement(final TextBox widget,
final GridLayer gridLayer,
final GridWidget gridWidget,
final SessionManager sessionManager,
final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
final Function<GridCellTuple, Command> hasNoValueCommand,
final Function<GridCellValueTuple, Command> hasValueCommand); }
|
TextBoxDOMElement extends BaseDOMElement<String, TextBox> implements TakesValue<String>,
Focusable { @Override public void setValue(final String value) { getWidget().setValue(value); this.originalValue = value; } TextBoxDOMElement(final TextBox widget,
final GridLayer gridLayer,
final GridWidget gridWidget,
final SessionManager sessionManager,
final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
final Function<GridCellTuple, Command> hasNoValueCommand,
final Function<GridCellValueTuple, Command> hasValueCommand); @Override void setValue(final String value); @Override String getValue(); @Override int getTabIndex(); @Override void setAccessKey(final char key); @Override void setFocus(final boolean focused); @Override void setTabIndex(final int index); @Override void initialise(final GridBodyCellRenderContext context); @Override @SuppressWarnings("unchecked") void flush(final String value); }
|
TextBoxDOMElement extends BaseDOMElement<String, TextBox> implements TakesValue<String>,
Focusable { @Override public void setValue(final String value) { getWidget().setValue(value); this.originalValue = value; } TextBoxDOMElement(final TextBox widget,
final GridLayer gridLayer,
final GridWidget gridWidget,
final SessionManager sessionManager,
final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
final Function<GridCellTuple, Command> hasNoValueCommand,
final Function<GridCellValueTuple, Command> hasValueCommand); @Override void setValue(final String value); @Override String getValue(); @Override int getTabIndex(); @Override void setAccessKey(final char key); @Override void setFocus(final boolean focused); @Override void setTabIndex(final int index); @Override void initialise(final GridBodyCellRenderContext context); @Override @SuppressWarnings("unchecked") void flush(final String value); }
|
@Test public void testGetHasTypeRefs() { final List<HasTypeRef> actualHasTypeRefs = inputClauseLiteralExpression.getHasTypeRefs(); final List<HasTypeRef> expectedHasTypeRefs = singletonList(inputClauseLiteralExpression); assertEquals(expectedHasTypeRefs, actualHasTypeRefs); }
|
@Override public List<HasTypeRef> getHasTypeRefs() { return new ArrayList<>(singletonList(this)); }
|
InputClauseLiteralExpression extends DMNModelInstrumentedBase implements IsLiteralExpression,
HasText,
HasTypeRef,
DMNPropertySet,
DomainObject { @Override public List<HasTypeRef> getHasTypeRefs() { return new ArrayList<>(singletonList(this)); } }
|
InputClauseLiteralExpression extends DMNModelInstrumentedBase implements IsLiteralExpression,
HasText,
HasTypeRef,
DMNPropertySet,
DomainObject { @Override public List<HasTypeRef> getHasTypeRefs() { return new ArrayList<>(singletonList(this)); } InputClauseLiteralExpression(); InputClauseLiteralExpression(final Id id,
final Description description,
final QName typeRef,
final Text text,
final ImportedValues importedValues); }
|
InputClauseLiteralExpression extends DMNModelInstrumentedBase implements IsLiteralExpression,
HasText,
HasTypeRef,
DMNPropertySet,
DomainObject { @Override public List<HasTypeRef> getHasTypeRefs() { return new ArrayList<>(singletonList(this)); } InputClauseLiteralExpression(); InputClauseLiteralExpression(final Id id,
final Description description,
final QName typeRef,
final Text text,
final ImportedValues importedValues); InputClauseLiteralExpression copy(); @Override List<HasTypeRef> getHasTypeRefs(); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override Id getId(); @Override Description getDescription(); void setDescription(final Description description); @Override QName getTypeRef(); @Override void setTypeRef(final QName typeRef); @Override Text getText(); @Override void setText(final Text text); @Override ImportedValues getImportedValues(); void setImportedValues(final ImportedValues importedValues); @Override DMNModelInstrumentedBase asDMNModelInstrumentedBase(); QNameHolder getTypeRefHolder(); void setTypeRefHolder(final QNameHolder typeRefHolder); @Override String getDomainObjectUUID(); @Override String getDomainObjectNameTranslationKey(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
InputClauseLiteralExpression extends DMNModelInstrumentedBase implements IsLiteralExpression,
HasText,
HasTypeRef,
DMNPropertySet,
DomainObject { @Override public List<HasTypeRef> getHasTypeRefs() { return new ArrayList<>(singletonList(this)); } InputClauseLiteralExpression(); InputClauseLiteralExpression(final Id id,
final Description description,
final QName typeRef,
final Text text,
final ImportedValues importedValues); InputClauseLiteralExpression copy(); @Override List<HasTypeRef> getHasTypeRefs(); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override Id getId(); @Override Description getDescription(); void setDescription(final Description description); @Override QName getTypeRef(); @Override void setTypeRef(final QName typeRef); @Override Text getText(); @Override void setText(final Text text); @Override ImportedValues getImportedValues(); void setImportedValues(final ImportedValues importedValues); @Override DMNModelInstrumentedBase asDMNModelInstrumentedBase(); QNameHolder getTypeRefHolder(); void setTypeRefHolder(final QNameHolder typeRefHolder); @Override String getDomainObjectUUID(); @Override String getDomainObjectNameTranslationKey(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testCopy() { final InputClauseLiteralExpression source = new InputClauseLiteralExpression( new Id(CLAUSE_ID), new Description(DESCRIPTION), BuiltInType.BOOLEAN.asQName(), new Text(TEXT), new ImportedValues() ); final InputClauseLiteralExpression target = source.copy(); assertNotNull(target); assertNotEquals(CLAUSE_ID, target.getId()); assertEquals(TEXT, target.getText().getValue()); assertEquals(DESCRIPTION, target.getDescription().getValue()); assertEquals(BuiltInType.BOOLEAN.asQName(), target.getTypeRef()); }
|
public InputClauseLiteralExpression copy() { final InputClauseLiteralExpression clonedInputClauseLiteralExpression = new InputClauseLiteralExpression(); clonedInputClauseLiteralExpression.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedInputClauseLiteralExpression.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedInputClauseLiteralExpression.typeRefHolder = Optional.ofNullable(typeRefHolder).map(QNameHolder::copy).orElse(null); clonedInputClauseLiteralExpression.text = Optional.ofNullable(text).map(Text::copy).orElse(null); clonedInputClauseLiteralExpression.importedValues = Optional.ofNullable(importedValues).map(ImportedValues::copy).orElse(null); return clonedInputClauseLiteralExpression; }
|
InputClauseLiteralExpression extends DMNModelInstrumentedBase implements IsLiteralExpression,
HasText,
HasTypeRef,
DMNPropertySet,
DomainObject { public InputClauseLiteralExpression copy() { final InputClauseLiteralExpression clonedInputClauseLiteralExpression = new InputClauseLiteralExpression(); clonedInputClauseLiteralExpression.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedInputClauseLiteralExpression.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedInputClauseLiteralExpression.typeRefHolder = Optional.ofNullable(typeRefHolder).map(QNameHolder::copy).orElse(null); clonedInputClauseLiteralExpression.text = Optional.ofNullable(text).map(Text::copy).orElse(null); clonedInputClauseLiteralExpression.importedValues = Optional.ofNullable(importedValues).map(ImportedValues::copy).orElse(null); return clonedInputClauseLiteralExpression; } }
|
InputClauseLiteralExpression extends DMNModelInstrumentedBase implements IsLiteralExpression,
HasText,
HasTypeRef,
DMNPropertySet,
DomainObject { public InputClauseLiteralExpression copy() { final InputClauseLiteralExpression clonedInputClauseLiteralExpression = new InputClauseLiteralExpression(); clonedInputClauseLiteralExpression.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedInputClauseLiteralExpression.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedInputClauseLiteralExpression.typeRefHolder = Optional.ofNullable(typeRefHolder).map(QNameHolder::copy).orElse(null); clonedInputClauseLiteralExpression.text = Optional.ofNullable(text).map(Text::copy).orElse(null); clonedInputClauseLiteralExpression.importedValues = Optional.ofNullable(importedValues).map(ImportedValues::copy).orElse(null); return clonedInputClauseLiteralExpression; } InputClauseLiteralExpression(); InputClauseLiteralExpression(final Id id,
final Description description,
final QName typeRef,
final Text text,
final ImportedValues importedValues); }
|
InputClauseLiteralExpression extends DMNModelInstrumentedBase implements IsLiteralExpression,
HasText,
HasTypeRef,
DMNPropertySet,
DomainObject { public InputClauseLiteralExpression copy() { final InputClauseLiteralExpression clonedInputClauseLiteralExpression = new InputClauseLiteralExpression(); clonedInputClauseLiteralExpression.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedInputClauseLiteralExpression.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedInputClauseLiteralExpression.typeRefHolder = Optional.ofNullable(typeRefHolder).map(QNameHolder::copy).orElse(null); clonedInputClauseLiteralExpression.text = Optional.ofNullable(text).map(Text::copy).orElse(null); clonedInputClauseLiteralExpression.importedValues = Optional.ofNullable(importedValues).map(ImportedValues::copy).orElse(null); return clonedInputClauseLiteralExpression; } InputClauseLiteralExpression(); InputClauseLiteralExpression(final Id id,
final Description description,
final QName typeRef,
final Text text,
final ImportedValues importedValues); InputClauseLiteralExpression copy(); @Override List<HasTypeRef> getHasTypeRefs(); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override Id getId(); @Override Description getDescription(); void setDescription(final Description description); @Override QName getTypeRef(); @Override void setTypeRef(final QName typeRef); @Override Text getText(); @Override void setText(final Text text); @Override ImportedValues getImportedValues(); void setImportedValues(final ImportedValues importedValues); @Override DMNModelInstrumentedBase asDMNModelInstrumentedBase(); QNameHolder getTypeRefHolder(); void setTypeRefHolder(final QNameHolder typeRefHolder); @Override String getDomainObjectUUID(); @Override String getDomainObjectNameTranslationKey(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
InputClauseLiteralExpression extends DMNModelInstrumentedBase implements IsLiteralExpression,
HasText,
HasTypeRef,
DMNPropertySet,
DomainObject { public InputClauseLiteralExpression copy() { final InputClauseLiteralExpression clonedInputClauseLiteralExpression = new InputClauseLiteralExpression(); clonedInputClauseLiteralExpression.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedInputClauseLiteralExpression.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedInputClauseLiteralExpression.typeRefHolder = Optional.ofNullable(typeRefHolder).map(QNameHolder::copy).orElse(null); clonedInputClauseLiteralExpression.text = Optional.ofNullable(text).map(Text::copy).orElse(null); clonedInputClauseLiteralExpression.importedValues = Optional.ofNullable(importedValues).map(ImportedValues::copy).orElse(null); return clonedInputClauseLiteralExpression; } InputClauseLiteralExpression(); InputClauseLiteralExpression(final Id id,
final Description description,
final QName typeRef,
final Text text,
final ImportedValues importedValues); InputClauseLiteralExpression copy(); @Override List<HasTypeRef> getHasTypeRefs(); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override Id getId(); @Override Description getDescription(); void setDescription(final Description description); @Override QName getTypeRef(); @Override void setTypeRef(final QName typeRef); @Override Text getText(); @Override void setText(final Text text); @Override ImportedValues getImportedValues(); void setImportedValues(final ImportedValues importedValues); @Override DMNModelInstrumentedBase asDMNModelInstrumentedBase(); QNameHolder getTypeRefHolder(); void setTypeRefHolder(final QNameHolder typeRefHolder); @Override String getDomainObjectUUID(); @Override String getDomainObjectNameTranslationKey(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testCopy() { final RuleAnnotationClause source = new RuleAnnotationClause(); source.setName(new Name(RULE_NAME)); final RuleAnnotationClause target = source.copy(); assertNotNull(target); assertEquals(RULE_NAME, target.getName().getValue()); }
|
public RuleAnnotationClause copy() { final RuleAnnotationClause clonedRuleAnnotationClause = new RuleAnnotationClause(); clonedRuleAnnotationClause.name = Optional.ofNullable(name).map(Name::copy).orElse(null); return clonedRuleAnnotationClause; }
|
RuleAnnotationClause extends DMNElement implements HasName { public RuleAnnotationClause copy() { final RuleAnnotationClause clonedRuleAnnotationClause = new RuleAnnotationClause(); clonedRuleAnnotationClause.name = Optional.ofNullable(name).map(Name::copy).orElse(null); return clonedRuleAnnotationClause; } }
|
RuleAnnotationClause extends DMNElement implements HasName { public RuleAnnotationClause copy() { final RuleAnnotationClause clonedRuleAnnotationClause = new RuleAnnotationClause(); clonedRuleAnnotationClause.name = Optional.ofNullable(name).map(Name::copy).orElse(null); return clonedRuleAnnotationClause; } RuleAnnotationClause(); }
|
RuleAnnotationClause extends DMNElement implements HasName { public RuleAnnotationClause copy() { final RuleAnnotationClause clonedRuleAnnotationClause = new RuleAnnotationClause(); clonedRuleAnnotationClause.name = Optional.ofNullable(name).map(Name::copy).orElse(null); return clonedRuleAnnotationClause; } RuleAnnotationClause(); RuleAnnotationClause copy(); @Override Name getName(); @Override void setName(final Name name); @Override boolean equals(final Object o); @Override int hashCode(); }
|
RuleAnnotationClause extends DMNElement implements HasName { public RuleAnnotationClause copy() { final RuleAnnotationClause clonedRuleAnnotationClause = new RuleAnnotationClause(); clonedRuleAnnotationClause.name = Optional.ofNullable(name).map(Name::copy).orElse(null); return clonedRuleAnnotationClause; } RuleAnnotationClause(); RuleAnnotationClause copy(); @Override Name getName(); @Override void setName(final Name name); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testGetReadOnlyNotSet() { textAnnotation.setAllowOnlyVisualChange(false); checkIfItIsNotSet("something"); }
|
@Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; } }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; } TextAnnotation(); TextAnnotation(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final Text text,
final TextFormat textFormat,
final BackgroundSet backgroundSet,
final FontSet fontSet,
final GeneralRectangleDimensionsSet dimensionsSet); }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; } TextAnnotation(); TextAnnotation(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final Text text,
final TextFormat textFormat,
final BackgroundSet backgroundSet,
final FontSet fontSet,
final GeneralRectangleDimensionsSet dimensionsSet); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override BackgroundSet getBackgroundSet(); void setBackgroundSet(final BackgroundSet backgroundSet); @Override FontSet getFontSet(); void setFontSet(final FontSet fontSet); @Override GeneralRectangleDimensionsSet getDimensionsSet(); void setDimensionsSet(final GeneralRectangleDimensionsSet dimensionsSet); @Override Text getText(); @Override void setText(final Text text); TextFormat getTextFormat(); void setTextFormat(final TextFormat textFormat); @Override String getContentDefinitionId(); @Override String getDiagramId(); @Override void setContentDefinitionId(final String contentDefinitionId); @Override void setDiagramId(final String dmnDiagramId); @Override boolean equals(final Object o); @Override int hashCode(); @Override void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange); @Override boolean isAllowOnlyVisualChange(); @Override ReadOnly getReadOnly(final String fieldName); }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; } TextAnnotation(); TextAnnotation(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final Text text,
final TextFormat textFormat,
final BackgroundSet backgroundSet,
final FontSet fontSet,
final GeneralRectangleDimensionsSet dimensionsSet); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override BackgroundSet getBackgroundSet(); void setBackgroundSet(final BackgroundSet backgroundSet); @Override FontSet getFontSet(); void setFontSet(final FontSet fontSet); @Override GeneralRectangleDimensionsSet getDimensionsSet(); void setDimensionsSet(final GeneralRectangleDimensionsSet dimensionsSet); @Override Text getText(); @Override void setText(final Text text); TextFormat getTextFormat(); void setTextFormat(final TextFormat textFormat); @Override String getContentDefinitionId(); @Override String getDiagramId(); @Override void setContentDefinitionId(final String contentDefinitionId); @Override void setDiagramId(final String dmnDiagramId); @Override boolean equals(final Object o); @Override int hashCode(); @Override void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange); @Override boolean isAllowOnlyVisualChange(); @Override ReadOnly getReadOnly(final String fieldName); }
|
@Test public void testGetReadOnlyWithReadOnlyValuesAndAllowOnlyVisualChangesNotSet() { textAnnotation.setAllowOnlyVisualChange(false); for (final String readonlyField : READONLY_FIELDS) { checkIfItIsNotSet(readonlyField); } }
|
@Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; } }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; } TextAnnotation(); TextAnnotation(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final Text text,
final TextFormat textFormat,
final BackgroundSet backgroundSet,
final FontSet fontSet,
final GeneralRectangleDimensionsSet dimensionsSet); }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; } TextAnnotation(); TextAnnotation(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final Text text,
final TextFormat textFormat,
final BackgroundSet backgroundSet,
final FontSet fontSet,
final GeneralRectangleDimensionsSet dimensionsSet); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override BackgroundSet getBackgroundSet(); void setBackgroundSet(final BackgroundSet backgroundSet); @Override FontSet getFontSet(); void setFontSet(final FontSet fontSet); @Override GeneralRectangleDimensionsSet getDimensionsSet(); void setDimensionsSet(final GeneralRectangleDimensionsSet dimensionsSet); @Override Text getText(); @Override void setText(final Text text); TextFormat getTextFormat(); void setTextFormat(final TextFormat textFormat); @Override String getContentDefinitionId(); @Override String getDiagramId(); @Override void setContentDefinitionId(final String contentDefinitionId); @Override void setDiagramId(final String dmnDiagramId); @Override boolean equals(final Object o); @Override int hashCode(); @Override void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange); @Override boolean isAllowOnlyVisualChange(); @Override ReadOnly getReadOnly(final String fieldName); }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; } TextAnnotation(); TextAnnotation(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final Text text,
final TextFormat textFormat,
final BackgroundSet backgroundSet,
final FontSet fontSet,
final GeneralRectangleDimensionsSet dimensionsSet); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override BackgroundSet getBackgroundSet(); void setBackgroundSet(final BackgroundSet backgroundSet); @Override FontSet getFontSet(); void setFontSet(final FontSet fontSet); @Override GeneralRectangleDimensionsSet getDimensionsSet(); void setDimensionsSet(final GeneralRectangleDimensionsSet dimensionsSet); @Override Text getText(); @Override void setText(final Text text); TextFormat getTextFormat(); void setTextFormat(final TextFormat textFormat); @Override String getContentDefinitionId(); @Override String getDiagramId(); @Override void setContentDefinitionId(final String contentDefinitionId); @Override void setDiagramId(final String dmnDiagramId); @Override boolean equals(final Object o); @Override int hashCode(); @Override void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange); @Override boolean isAllowOnlyVisualChange(); @Override ReadOnly getReadOnly(final String fieldName); }
|
@Test public void testGetReadOnlyWithReadOnlyValues() { textAnnotation.setAllowOnlyVisualChange(true); for (final String readonlyField : READONLY_FIELDS) { checkIfIsReadOnly(readonlyField); } }
|
@Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; } }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; } TextAnnotation(); TextAnnotation(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final Text text,
final TextFormat textFormat,
final BackgroundSet backgroundSet,
final FontSet fontSet,
final GeneralRectangleDimensionsSet dimensionsSet); }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; } TextAnnotation(); TextAnnotation(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final Text text,
final TextFormat textFormat,
final BackgroundSet backgroundSet,
final FontSet fontSet,
final GeneralRectangleDimensionsSet dimensionsSet); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override BackgroundSet getBackgroundSet(); void setBackgroundSet(final BackgroundSet backgroundSet); @Override FontSet getFontSet(); void setFontSet(final FontSet fontSet); @Override GeneralRectangleDimensionsSet getDimensionsSet(); void setDimensionsSet(final GeneralRectangleDimensionsSet dimensionsSet); @Override Text getText(); @Override void setText(final Text text); TextFormat getTextFormat(); void setTextFormat(final TextFormat textFormat); @Override String getContentDefinitionId(); @Override String getDiagramId(); @Override void setContentDefinitionId(final String contentDefinitionId); @Override void setDiagramId(final String dmnDiagramId); @Override boolean equals(final Object o); @Override int hashCode(); @Override void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange); @Override boolean isAllowOnlyVisualChange(); @Override ReadOnly getReadOnly(final String fieldName); }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; } TextAnnotation(); TextAnnotation(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final Text text,
final TextFormat textFormat,
final BackgroundSet backgroundSet,
final FontSet fontSet,
final GeneralRectangleDimensionsSet dimensionsSet); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override BackgroundSet getBackgroundSet(); void setBackgroundSet(final BackgroundSet backgroundSet); @Override FontSet getFontSet(); void setFontSet(final FontSet fontSet); @Override GeneralRectangleDimensionsSet getDimensionsSet(); void setDimensionsSet(final GeneralRectangleDimensionsSet dimensionsSet); @Override Text getText(); @Override void setText(final Text text); TextFormat getTextFormat(); void setTextFormat(final TextFormat textFormat); @Override String getContentDefinitionId(); @Override String getDiagramId(); @Override void setContentDefinitionId(final String contentDefinitionId); @Override void setDiagramId(final String dmnDiagramId); @Override boolean equals(final Object o); @Override int hashCode(); @Override void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange); @Override boolean isAllowOnlyVisualChange(); @Override ReadOnly getReadOnly(final String fieldName); }
|
@Test public void testGetReadOnlyWithNotReadOnlyValues() { textAnnotation.setAllowOnlyVisualChange(true); checkIfItIsNotReadOnly("Font"); checkIfItIsNotReadOnly("Something"); }
|
@Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; } }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; } TextAnnotation(); TextAnnotation(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final Text text,
final TextFormat textFormat,
final BackgroundSet backgroundSet,
final FontSet fontSet,
final GeneralRectangleDimensionsSet dimensionsSet); }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; } TextAnnotation(); TextAnnotation(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final Text text,
final TextFormat textFormat,
final BackgroundSet backgroundSet,
final FontSet fontSet,
final GeneralRectangleDimensionsSet dimensionsSet); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override BackgroundSet getBackgroundSet(); void setBackgroundSet(final BackgroundSet backgroundSet); @Override FontSet getFontSet(); void setFontSet(final FontSet fontSet); @Override GeneralRectangleDimensionsSet getDimensionsSet(); void setDimensionsSet(final GeneralRectangleDimensionsSet dimensionsSet); @Override Text getText(); @Override void setText(final Text text); TextFormat getTextFormat(); void setTextFormat(final TextFormat textFormat); @Override String getContentDefinitionId(); @Override String getDiagramId(); @Override void setContentDefinitionId(final String contentDefinitionId); @Override void setDiagramId(final String dmnDiagramId); @Override boolean equals(final Object o); @Override int hashCode(); @Override void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange); @Override boolean isAllowOnlyVisualChange(); @Override ReadOnly getReadOnly(final String fieldName); }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange) { this.allowOnlyVisualChange = allowOnlyVisualChange; } TextAnnotation(); TextAnnotation(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final Text text,
final TextFormat textFormat,
final BackgroundSet backgroundSet,
final FontSet fontSet,
final GeneralRectangleDimensionsSet dimensionsSet); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override BackgroundSet getBackgroundSet(); void setBackgroundSet(final BackgroundSet backgroundSet); @Override FontSet getFontSet(); void setFontSet(final FontSet fontSet); @Override GeneralRectangleDimensionsSet getDimensionsSet(); void setDimensionsSet(final GeneralRectangleDimensionsSet dimensionsSet); @Override Text getText(); @Override void setText(final Text text); TextFormat getTextFormat(); void setTextFormat(final TextFormat textFormat); @Override String getContentDefinitionId(); @Override String getDiagramId(); @Override void setContentDefinitionId(final String contentDefinitionId); @Override void setDiagramId(final String dmnDiagramId); @Override boolean equals(final Object o); @Override int hashCode(); @Override void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange); @Override boolean isAllowOnlyVisualChange(); @Override ReadOnly getReadOnly(final String fieldName); }
|
@Test public void testGetContentDefinitionId() { final String contentDefinitionId = "the id"; final Id id = mock(Id.class); doReturn(id).when(textAnnotation).getId(); when(id.getValue()).thenReturn(contentDefinitionId); final String currentId = textAnnotation.getContentDefinitionId(); assertEquals(contentDefinitionId, currentId); }
|
@Override public String getContentDefinitionId() { return getId().getValue(); }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public String getContentDefinitionId() { return getId().getValue(); } }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public String getContentDefinitionId() { return getId().getValue(); } TextAnnotation(); TextAnnotation(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final Text text,
final TextFormat textFormat,
final BackgroundSet backgroundSet,
final FontSet fontSet,
final GeneralRectangleDimensionsSet dimensionsSet); }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public String getContentDefinitionId() { return getId().getValue(); } TextAnnotation(); TextAnnotation(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final Text text,
final TextFormat textFormat,
final BackgroundSet backgroundSet,
final FontSet fontSet,
final GeneralRectangleDimensionsSet dimensionsSet); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override BackgroundSet getBackgroundSet(); void setBackgroundSet(final BackgroundSet backgroundSet); @Override FontSet getFontSet(); void setFontSet(final FontSet fontSet); @Override GeneralRectangleDimensionsSet getDimensionsSet(); void setDimensionsSet(final GeneralRectangleDimensionsSet dimensionsSet); @Override Text getText(); @Override void setText(final Text text); TextFormat getTextFormat(); void setTextFormat(final TextFormat textFormat); @Override String getContentDefinitionId(); @Override String getDiagramId(); @Override void setContentDefinitionId(final String contentDefinitionId); @Override void setDiagramId(final String dmnDiagramId); @Override boolean equals(final Object o); @Override int hashCode(); @Override void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange); @Override boolean isAllowOnlyVisualChange(); @Override ReadOnly getReadOnly(final String fieldName); }
|
TextAnnotation extends Artifact implements DMNViewDefinition<GeneralRectangleDimensionsSet>,
HasText,
HasContentDefinitionId,
DynamicReadOnly { @Override public String getContentDefinitionId() { return getId().getValue(); } TextAnnotation(); TextAnnotation(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final Text text,
final TextFormat textFormat,
final BackgroundSet backgroundSet,
final FontSet fontSet,
final GeneralRectangleDimensionsSet dimensionsSet); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override BackgroundSet getBackgroundSet(); void setBackgroundSet(final BackgroundSet backgroundSet); @Override FontSet getFontSet(); void setFontSet(final FontSet fontSet); @Override GeneralRectangleDimensionsSet getDimensionsSet(); void setDimensionsSet(final GeneralRectangleDimensionsSet dimensionsSet); @Override Text getText(); @Override void setText(final Text text); TextFormat getTextFormat(); void setTextFormat(final TextFormat textFormat); @Override String getContentDefinitionId(); @Override String getDiagramId(); @Override void setContentDefinitionId(final String contentDefinitionId); @Override void setDiagramId(final String dmnDiagramId); @Override boolean equals(final Object o); @Override int hashCode(); @Override void setAllowOnlyVisualChange(final boolean allowOnlyVisualChange); @Override boolean isAllowOnlyVisualChange(); @Override ReadOnly getReadOnly(final String fieldName); }
|
@Test public void testComponentWidths() { assertEquals(literalExpression.getRequiredComponentWidthCount(), literalExpression.getComponentWidths().size()); literalExpression.getComponentWidths().forEach(Assert::assertNull); }
|
@Override public int getRequiredComponentWidthCount() { return STATIC_COLUMNS; }
|
LiteralExpression extends Expression implements IsLiteralExpression,
HasText,
DomainObject { @Override public int getRequiredComponentWidthCount() { return STATIC_COLUMNS; } }
|
LiteralExpression extends Expression implements IsLiteralExpression,
HasText,
DomainObject { @Override public int getRequiredComponentWidthCount() { return STATIC_COLUMNS; } LiteralExpression(); LiteralExpression(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final QName typeRef,
final Text text,
final ImportedValues importedValues,
final ExpressionLanguage expressionLanguage); }
|
LiteralExpression extends Expression implements IsLiteralExpression,
HasText,
DomainObject { @Override public int getRequiredComponentWidthCount() { return STATIC_COLUMNS; } LiteralExpression(); LiteralExpression(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final QName typeRef,
final Text text,
final ImportedValues importedValues,
final ExpressionLanguage expressionLanguage); @Override LiteralExpression copy(); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override Text getText(); @Override void setText(final Text text); @Override ImportedValues getImportedValues(); void setImportedValues(final ImportedValues importedValues); ExpressionLanguage getExpressionLanguage(); void setExpressionLanguage(final ExpressionLanguage expressionLanguage); @Override String getDomainObjectUUID(); @Override String getDomainObjectNameTranslationKey(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
LiteralExpression extends Expression implements IsLiteralExpression,
HasText,
DomainObject { @Override public int getRequiredComponentWidthCount() { return STATIC_COLUMNS; } LiteralExpression(); LiteralExpression(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final QName typeRef,
final Text text,
final ImportedValues importedValues,
final ExpressionLanguage expressionLanguage); @Override LiteralExpression copy(); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override Text getText(); @Override void setText(final Text text); @Override ImportedValues getImportedValues(); void setImportedValues(final ImportedValues importedValues); ExpressionLanguage getExpressionLanguage(); void setExpressionLanguage(final ExpressionLanguage expressionLanguage); @Override String getDomainObjectUUID(); @Override String getDomainObjectNameTranslationKey(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testCopy() { final LiteralExpression source = new LiteralExpression( new Id(LITERAL_ID), new Description(DESCRIPTION), BuiltInType.BOOLEAN.asQName(), new Text(TEXT), null, new ExpressionLanguage(EXPRESSION_LANGUAGE) ); final LiteralExpression target = source.copy(); assertNotNull(target); assertNotEquals(LITERAL_ID, target.getId()); assertEquals(DESCRIPTION, target.getDescription().getValue()); assertEquals(BuiltInType.BOOLEAN.asQName(), target.getTypeRef()); assertEquals(TEXT, target.getText().getValue()); assertNull(target.getImportedValues()); assertEquals(EXPRESSION_LANGUAGE, target.getExpressionLanguage().getValue()); }
|
@Override public LiteralExpression copy() { final LiteralExpression clonedLiteralExpression = new LiteralExpression(); clonedLiteralExpression.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedLiteralExpression.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedLiteralExpression.componentWidths = new ArrayList<>(componentWidths); clonedLiteralExpression.text = Optional.ofNullable(text).map(Text::copy).orElse(null); clonedLiteralExpression.importedValues = Optional.ofNullable(importedValues).map(ImportedValues::copy).orElse(null); clonedLiteralExpression.expressionLanguage = Optional.ofNullable(expressionLanguage).map(ExpressionLanguage::copy).orElse(null); return clonedLiteralExpression; }
|
LiteralExpression extends Expression implements IsLiteralExpression,
HasText,
DomainObject { @Override public LiteralExpression copy() { final LiteralExpression clonedLiteralExpression = new LiteralExpression(); clonedLiteralExpression.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedLiteralExpression.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedLiteralExpression.componentWidths = new ArrayList<>(componentWidths); clonedLiteralExpression.text = Optional.ofNullable(text).map(Text::copy).orElse(null); clonedLiteralExpression.importedValues = Optional.ofNullable(importedValues).map(ImportedValues::copy).orElse(null); clonedLiteralExpression.expressionLanguage = Optional.ofNullable(expressionLanguage).map(ExpressionLanguage::copy).orElse(null); return clonedLiteralExpression; } }
|
LiteralExpression extends Expression implements IsLiteralExpression,
HasText,
DomainObject { @Override public LiteralExpression copy() { final LiteralExpression clonedLiteralExpression = new LiteralExpression(); clonedLiteralExpression.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedLiteralExpression.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedLiteralExpression.componentWidths = new ArrayList<>(componentWidths); clonedLiteralExpression.text = Optional.ofNullable(text).map(Text::copy).orElse(null); clonedLiteralExpression.importedValues = Optional.ofNullable(importedValues).map(ImportedValues::copy).orElse(null); clonedLiteralExpression.expressionLanguage = Optional.ofNullable(expressionLanguage).map(ExpressionLanguage::copy).orElse(null); return clonedLiteralExpression; } LiteralExpression(); LiteralExpression(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final QName typeRef,
final Text text,
final ImportedValues importedValues,
final ExpressionLanguage expressionLanguage); }
|
LiteralExpression extends Expression implements IsLiteralExpression,
HasText,
DomainObject { @Override public LiteralExpression copy() { final LiteralExpression clonedLiteralExpression = new LiteralExpression(); clonedLiteralExpression.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedLiteralExpression.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedLiteralExpression.componentWidths = new ArrayList<>(componentWidths); clonedLiteralExpression.text = Optional.ofNullable(text).map(Text::copy).orElse(null); clonedLiteralExpression.importedValues = Optional.ofNullable(importedValues).map(ImportedValues::copy).orElse(null); clonedLiteralExpression.expressionLanguage = Optional.ofNullable(expressionLanguage).map(ExpressionLanguage::copy).orElse(null); return clonedLiteralExpression; } LiteralExpression(); LiteralExpression(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final QName typeRef,
final Text text,
final ImportedValues importedValues,
final ExpressionLanguage expressionLanguage); @Override LiteralExpression copy(); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override Text getText(); @Override void setText(final Text text); @Override ImportedValues getImportedValues(); void setImportedValues(final ImportedValues importedValues); ExpressionLanguage getExpressionLanguage(); void setExpressionLanguage(final ExpressionLanguage expressionLanguage); @Override String getDomainObjectUUID(); @Override String getDomainObjectNameTranslationKey(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
LiteralExpression extends Expression implements IsLiteralExpression,
HasText,
DomainObject { @Override public LiteralExpression copy() { final LiteralExpression clonedLiteralExpression = new LiteralExpression(); clonedLiteralExpression.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedLiteralExpression.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedLiteralExpression.componentWidths = new ArrayList<>(componentWidths); clonedLiteralExpression.text = Optional.ofNullable(text).map(Text::copy).orElse(null); clonedLiteralExpression.importedValues = Optional.ofNullable(importedValues).map(ImportedValues::copy).orElse(null); clonedLiteralExpression.expressionLanguage = Optional.ofNullable(expressionLanguage).map(ExpressionLanguage::copy).orElse(null); return clonedLiteralExpression; } LiteralExpression(); LiteralExpression(final Id id,
final org.kie.workbench.common.dmn.api.property.dmn.Description description,
final QName typeRef,
final Text text,
final ImportedValues importedValues,
final ExpressionLanguage expressionLanguage); @Override LiteralExpression copy(); String getStunnerCategory(); Set<String> getStunnerLabels(); @Override Text getText(); @Override void setText(final Text text); @Override ImportedValues getImportedValues(); void setImportedValues(final ImportedValues importedValues); ExpressionLanguage getExpressionLanguage(); void setExpressionLanguage(final ExpressionLanguage expressionLanguage); @Override String getDomainObjectUUID(); @Override String getDomainObjectNameTranslationKey(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testGetValue() { domElement.getValue(); verify(widget).getValue(); }
|
@Override public String getValue() { return getWidget().getValue(); }
|
TextBoxDOMElement extends BaseDOMElement<String, TextBox> implements TakesValue<String>,
Focusable { @Override public String getValue() { return getWidget().getValue(); } }
|
TextBoxDOMElement extends BaseDOMElement<String, TextBox> implements TakesValue<String>,
Focusable { @Override public String getValue() { return getWidget().getValue(); } TextBoxDOMElement(final TextBox widget,
final GridLayer gridLayer,
final GridWidget gridWidget,
final SessionManager sessionManager,
final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
final Function<GridCellTuple, Command> hasNoValueCommand,
final Function<GridCellValueTuple, Command> hasValueCommand); }
|
TextBoxDOMElement extends BaseDOMElement<String, TextBox> implements TakesValue<String>,
Focusable { @Override public String getValue() { return getWidget().getValue(); } TextBoxDOMElement(final TextBox widget,
final GridLayer gridLayer,
final GridWidget gridWidget,
final SessionManager sessionManager,
final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
final Function<GridCellTuple, Command> hasNoValueCommand,
final Function<GridCellValueTuple, Command> hasValueCommand); @Override void setValue(final String value); @Override String getValue(); @Override int getTabIndex(); @Override void setAccessKey(final char key); @Override void setFocus(final boolean focused); @Override void setTabIndex(final int index); @Override void initialise(final GridBodyCellRenderContext context); @Override @SuppressWarnings("unchecked") void flush(final String value); }
|
TextBoxDOMElement extends BaseDOMElement<String, TextBox> implements TakesValue<String>,
Focusable { @Override public String getValue() { return getWidget().getValue(); } TextBoxDOMElement(final TextBox widget,
final GridLayer gridLayer,
final GridWidget gridWidget,
final SessionManager sessionManager,
final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
final Function<GridCellTuple, Command> hasNoValueCommand,
final Function<GridCellValueTuple, Command> hasValueCommand); @Override void setValue(final String value); @Override String getValue(); @Override int getTabIndex(); @Override void setAccessKey(final char key); @Override void setFocus(final boolean focused); @Override void setTabIndex(final int index); @Override void initialise(final GridBodyCellRenderContext context); @Override @SuppressWarnings("unchecked") void flush(final String value); }
|
@Test public void testGetHasTypeRefs() { final ContextEntry contextEntry1 = mock(ContextEntry.class); final ContextEntry contextEntry2 = mock(ContextEntry.class); final List<ContextEntry> contextEntry = asList(contextEntry1, contextEntry2); final HasTypeRef hasTypeRef1 = mock(HasTypeRef.class); final HasTypeRef hasTypeRef2 = mock(HasTypeRef.class); doReturn(contextEntry).when(context).getContextEntry(); when(contextEntry1.getHasTypeRefs()).thenReturn(asList(hasTypeRef1)); when(contextEntry2.getHasTypeRefs()).thenReturn(asList(hasTypeRef2)); final List<HasTypeRef> actualHasTypeRefs = context.getHasTypeRefs(); final List<HasTypeRef> expectedHasTypeRefs = asList(context, hasTypeRef1, hasTypeRef2); assertEquals(expectedHasTypeRefs, actualHasTypeRefs); }
|
@Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = super.getHasTypeRefs(); hasTypeRefs.addAll(getFlatHasTypeRefs(getContextEntry())); return hasTypeRefs; }
|
Context extends Expression { @Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = super.getHasTypeRefs(); hasTypeRefs.addAll(getFlatHasTypeRefs(getContextEntry())); return hasTypeRefs; } }
|
Context extends Expression { @Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = super.getHasTypeRefs(); hasTypeRefs.addAll(getFlatHasTypeRefs(getContextEntry())); return hasTypeRefs; } Context(); Context(final Id id,
final Description description,
final QName typeRef); }
|
Context extends Expression { @Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = super.getHasTypeRefs(); hasTypeRefs.addAll(getFlatHasTypeRefs(getContextEntry())); return hasTypeRefs; } Context(); Context(final Id id,
final Description description,
final QName typeRef); @Override Context copy(); List<ContextEntry> getContextEntry(); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
Context extends Expression { @Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = super.getHasTypeRefs(); hasTypeRefs.addAll(getFlatHasTypeRefs(getContextEntry())); return hasTypeRefs; } Context(); Context(final Id id,
final Description description,
final QName typeRef); @Override Context copy(); List<ContextEntry> getContextEntry(); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.