@Test public void testSetDefinedExpression() { when(hasExpression.getExpression()).thenReturn(literalExpression); grid.setExpression(NODE_UUID, hasExpression, Optional.of(hasName), false); final GridCellValue<?> gridCellValue = grid.getModel().getCell(0, 0).getValue(); assertThat(gridCellValue).isInstanceOf(ExpressionCellValue.class); final ExpressionCellValue expressionCellValue = (ExpressionCellValue) gridCellValue; assertThat(expressionCellValue.getValue().isPresent()).isTrue(); assertThat(expressionCellValue.getValue().get()).isSameAs(literalExpressionEditor); assertThat(grid.isOnlyVisualChangeAllowed()).isFalse(); verify(literalExpressionEditor).selectFirstCell(); verify(gridLayer).batch(); }
public void setExpression(final String nodeUUID, final HasExpression hasExpression, final Optional<HasName> hasName, final boolean isOnlyVisualChangeAllowed) { this.nodeUUID = Optional.of(nodeUUID); this.hasExpression = spyHasExpression(hasExpression); this.hasName = spyHasName(hasName); this.isOnlyVisualChangeAllowed = isOnlyVisualChangeAllowed; uiModelMapper.fromDMNModel(0, 0); expressionColumn.setWidthInternal(getExistingEditorWidth()); selectExpressionEditorFirstCell(); }
ExpressionContainerGrid extends BaseGrid<Expression> { public void setExpression(final String nodeUUID, final HasExpression hasExpression, final Optional<HasName> hasName, final boolean isOnlyVisualChangeAllowed) { this.nodeUUID = Optional.of(nodeUUID); this.hasExpression = spyHasExpression(hasExpression); this.hasName = spyHasName(hasName); this.isOnlyVisualChangeAllowed = isOnlyVisualChangeAllowed; uiModelMapper.fromDMNModel(0, 0); expressionColumn.setWidthInternal(getExistingEditorWidth()); selectExpressionEditorFirstCell(); } }
ExpressionContainerGrid extends BaseGrid<Expression> { public void setExpression(final String nodeUUID, final HasExpression hasExpression, final Optional<HasName> hasName, final boolean isOnlyVisualChangeAllowed) { this.nodeUUID = Optional.of(nodeUUID); this.hasExpression = spyHasExpression(hasExpression); this.hasName = spyHasName(hasName); this.isOnlyVisualChangeAllowed = isOnlyVisualChangeAllowed; uiModelMapper.fromDMNModel(0, 0); expressionColumn.setWidthInternal(getExistingEditorWidth()); selectExpressionEditorFirstCell(); } ExpressionContainerGrid(final DMNGridLayer gridLayer,
                                   final CellEditorControlsView.Presenter cellEditorControls,
                                   final TranslationService translationService,
                                   final ListSelectorView.Presenter listSelector,
                                   final SessionManager sessionManager,
                                   final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                                   final DefaultCanvasCommandFactory canvasCommandFactory,
                                   final Supplier<ExpressionEditorDefinitions> expressionEditorDefinitions,
                                   final Supplier<ExpressionGridCache> expressionGridCache,
                                   final ParameterizedCommand<Optional<Expression>> onHasExpressionChanged,
                                   final ParameterizedCommand<Optional<HasName>> onHasNameChanged,
                                   final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
                                   final Event<DomainObjectSelectionEvent> domainObjectSelectionEvent); }
ExpressionContainerGrid extends BaseGrid<Expression> { public void setExpression(final String nodeUUID, final HasExpression hasExpression, final Optional<HasName> hasName, final boolean isOnlyVisualChangeAllowed) { this.nodeUUID = Optional.of(nodeUUID); this.hasExpression = spyHasExpression(hasExpression); this.hasName = spyHasName(hasName); this.isOnlyVisualChangeAllowed = isOnlyVisualChangeAllowed; uiModelMapper.fromDMNModel(0, 0); expressionColumn.setWidthInternal(getExistingEditorWidth()); selectExpressionEditorFirstCell(); } ExpressionContainerGrid(final DMNGridLayer gridLayer,
                                   final CellEditorControlsView.Presenter cellEditorControls,
                                   final TranslationService translationService,
                                   final ListSelectorView.Presenter listSelector,
                                   final SessionManager sessionManager,
                                   final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                                   final DefaultCanvasCommandFactory canvasCommandFactory,
                                   final Supplier<ExpressionEditorDefinitions> expressionEditorDefinitions,
                                   final Supplier<ExpressionGridCache> expressionGridCache,
                                   final ParameterizedCommand<Optional<Expression>> onHasExpressionChanged,
                                   final ParameterizedCommand<Optional<HasName>> onHasNameChanged,
                                   final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
                                   final Event<DomainObjectSelectionEvent> domainObjectSelectionEvent); @Override boolean onDragHandle(final INodeXYEvent event); @Override void deselect(); void setExpression(final String nodeUUID,
                              final HasExpression hasExpression,
                              final Optional<HasName> hasName,
                              final boolean isOnlyVisualChangeAllowed); @Override List<ListSelectorItem> getItems(final int uiRowIndex,
                                           final int uiColumnIndex); @Override void onItemSelected(final ListSelectorItem item); Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>> getBaseExpressionGrid(); @Override boolean selectCell(final Point2D ap,
                              final boolean isShiftKeyDown,
                              final boolean isControlKeyDown); @Override boolean selectCell(final int uiRowIndex,
                              final int uiColumnIndex,
                              final boolean isShiftKeyDown,
                              final boolean isControlKeyDown); }
ExpressionContainerGrid extends BaseGrid<Expression> { public void setExpression(final String nodeUUID, final HasExpression hasExpression, final Optional<HasName> hasName, final boolean isOnlyVisualChangeAllowed) { this.nodeUUID = Optional.of(nodeUUID); this.hasExpression = spyHasExpression(hasExpression); this.hasName = spyHasName(hasName); this.isOnlyVisualChangeAllowed = isOnlyVisualChangeAllowed; uiModelMapper.fromDMNModel(0, 0); expressionColumn.setWidthInternal(getExistingEditorWidth()); selectExpressionEditorFirstCell(); } ExpressionContainerGrid(final DMNGridLayer gridLayer,
                                   final CellEditorControlsView.Presenter cellEditorControls,
                                   final TranslationService translationService,
                                   final ListSelectorView.Presenter listSelector,
                                   final SessionManager sessionManager,
                                   final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                                   final DefaultCanvasCommandFactory canvasCommandFactory,
                                   final Supplier<ExpressionEditorDefinitions> expressionEditorDefinitions,
                                   final Supplier<ExpressionGridCache> expressionGridCache,
                                   final ParameterizedCommand<Optional<Expression>> onHasExpressionChanged,
                                   final ParameterizedCommand<Optional<HasName>> onHasNameChanged,
                                   final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
                                   final Event<DomainObjectSelectionEvent> domainObjectSelectionEvent); @Override boolean onDragHandle(final INodeXYEvent event); @Override void deselect(); void setExpression(final String nodeUUID,
                              final HasExpression hasExpression,
                              final Optional<HasName> hasName,
                              final boolean isOnlyVisualChangeAllowed); @Override List<ListSelectorItem> getItems(final int uiRowIndex,
                                           final int uiColumnIndex); @Override void onItemSelected(final ListSelectorItem item); Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>> getBaseExpressionGrid(); @Override boolean selectCell(final Point2D ap,
                              final boolean isShiftKeyDown,
                              final boolean isControlKeyDown); @Override boolean selectCell(final int uiRowIndex,
                              final int uiColumnIndex,
                              final boolean isShiftKeyDown,
                              final boolean isControlKeyDown);  }