@Test public void testAddColumn() throws Exception { setupGrid(0); addColumn(1); verifyCommandExecuteOperation(BaseExpressionGrid.RESIZE_EXISTING); verify(grid).selectHeaderCell(eq(0), eq(1), eq(false), eq(false)); verify(headerEditor).bind(any(RelationColumnHeaderMetaData.class), eq(0), eq(1)); verify(cellEditorControls).show(eq(headerEditor), anyInt(), anyInt()); reset(gridPanel, gridLayer, grid, parentGridColumn); verify(sessionCommandManager).execute(eq(canvasHandler), addColumnCommand.capture()); addColumnCommand.getValue().undo(canvasHandler); verifyCommandUndoOperation(BaseExpressionGrid.RESIZE_EXISTING_MINIMUM); }
void addColumn(final int index) { getExpression().get().ifPresent(relation -> { final InformationItem informationItem = new InformationItem(); informationItem.setName(new Name()); final CommandResult<CanvasViolation> result = sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddRelationColumnCommand(relation, informationItem, model, () -> makeRelationColumn(index, informationItem), index, uiModelMapper, () -> resize(BaseExpressionGrid.RESIZE_EXISTING), () -> resize(BaseExpressionGrid.RESIZE_EXISTING_MINIMUM))); if (!CommandUtils.isError(result)) { selectHeaderCell(0, index, false, false); CellContextUtilities.editSelectedCell(this); } }); }
RelationGrid extends BaseExpressionGrid<Relation, RelationGridData, RelationUIModelMapper> implements HasListSelectorControl { void addColumn(final int index) { getExpression().get().ifPresent(relation -> { final InformationItem informationItem = new InformationItem(); informationItem.setName(new Name()); final CommandResult<CanvasViolation> result = sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddRelationColumnCommand(relation, informationItem, model, () -> makeRelationColumn(index, informationItem), index, uiModelMapper, () -> resize(BaseExpressionGrid.RESIZE_EXISTING), () -> resize(BaseExpressionGrid.RESIZE_EXISTING_MINIMUM))); if (!CommandUtils.isError(result)) { selectHeaderCell(0, index, false, false); CellContextUtilities.editSelectedCell(this); } }); } }
RelationGrid extends BaseExpressionGrid<Relation, RelationGridData, RelationUIModelMapper> implements HasListSelectorControl { void addColumn(final int index) { getExpression().get().ifPresent(relation -> { final InformationItem informationItem = new InformationItem(); informationItem.setName(new Name()); final CommandResult<CanvasViolation> result = sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddRelationColumnCommand(relation, informationItem, model, () -> makeRelationColumn(index, informationItem), index, uiModelMapper, () -> resize(BaseExpressionGrid.RESIZE_EXISTING), () -> resize(BaseExpressionGrid.RESIZE_EXISTING_MINIMUM))); if (!CommandUtils.isError(result)) { selectHeaderCell(0, index, false, false); CellContextUtilities.editSelectedCell(this); } }); } RelationGrid(final GridCellTuple parent,
                        final Optional<String> nodeUUID,
                        final HasExpression hasExpression,
                        final Optional<HasName> hasName,
                        final DMNGridPanel gridPanel,
                        final DMNGridLayer gridLayer,
                        final RelationGridData gridData,
                        final DefinitionUtils definitionUtils,
                        final SessionManager sessionManager,
                        final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                        final DefaultCanvasCommandFactory canvasCommandFactory,
                        final Event<ExpressionEditorChanged> editorSelectedEvent,
                        final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
                        final Event<DomainObjectSelectionEvent> domainObjectSelectionEvent,
                        final CellEditorControlsView.Presenter cellEditorControls,
                        final ListSelectorView.Presenter listSelector,
                        final TranslationService translationService,
                        final boolean isOnlyVisualChangeAllowed,
                        final int nesting,
                        final ManagedInstance<ValueAndDataTypePopoverView.Presenter> headerEditors,
                        final ReadOnlyProvider readOnlyProvider); }
RelationGrid extends BaseExpressionGrid<Relation, RelationGridData, RelationUIModelMapper> implements HasListSelectorControl { void addColumn(final int index) { getExpression().get().ifPresent(relation -> { final InformationItem informationItem = new InformationItem(); informationItem.setName(new Name()); final CommandResult<CanvasViolation> result = sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddRelationColumnCommand(relation, informationItem, model, () -> makeRelationColumn(index, informationItem), index, uiModelMapper, () -> resize(BaseExpressionGrid.RESIZE_EXISTING), () -> resize(BaseExpressionGrid.RESIZE_EXISTING_MINIMUM))); if (!CommandUtils.isError(result)) { selectHeaderCell(0, index, false, false); CellContextUtilities.editSelectedCell(this); } }); } RelationGrid(final GridCellTuple parent,
                        final Optional<String> nodeUUID,
                        final HasExpression hasExpression,
                        final Optional<HasName> hasName,
                        final DMNGridPanel gridPanel,
                        final DMNGridLayer gridLayer,
                        final RelationGridData gridData,
                        final DefinitionUtils definitionUtils,
                        final SessionManager sessionManager,
                        final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                        final DefaultCanvasCommandFactory canvasCommandFactory,
                        final Event<ExpressionEditorChanged> editorSelectedEvent,
                        final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
                        final Event<DomainObjectSelectionEvent> domainObjectSelectionEvent,
                        final CellEditorControlsView.Presenter cellEditorControls,
                        final ListSelectorView.Presenter listSelector,
                        final TranslationService translationService,
                        final boolean isOnlyVisualChangeAllowed,
                        final int nesting,
                        final ManagedInstance<ValueAndDataTypePopoverView.Presenter> headerEditors,
                        final ReadOnlyProvider readOnlyProvider); @Override RelationUIModelMapper makeUiModelMapper(); @Override void initialiseUiColumns(); @Override void initialiseUiRows(); @Override void initialiseUiCells(); @Override @SuppressWarnings("unused") java.util.List<ListSelectorItem> getItems(final int uiRowIndex,
                                                     final int uiColumnIndex); @Override void onItemSelected(final ListSelectorItem item); @Override void doAfterSelectionChange(final int uiRowIndex,
                                       final int uiColumnIndex); @Override void doAfterHeaderSelectionChange(final int uiHeaderRowIndex,
                                             final int uiHeaderColumnIndex); }
RelationGrid extends BaseExpressionGrid<Relation, RelationGridData, RelationUIModelMapper> implements HasListSelectorControl { void addColumn(final int index) { getExpression().get().ifPresent(relation -> { final InformationItem informationItem = new InformationItem(); informationItem.setName(new Name()); final CommandResult<CanvasViolation> result = sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), new AddRelationColumnCommand(relation, informationItem, model, () -> makeRelationColumn(index, informationItem), index, uiModelMapper, () -> resize(BaseExpressionGrid.RESIZE_EXISTING), () -> resize(BaseExpressionGrid.RESIZE_EXISTING_MINIMUM))); if (!CommandUtils.isError(result)) { selectHeaderCell(0, index, false, false); CellContextUtilities.editSelectedCell(this); } }); } RelationGrid(final GridCellTuple parent,
                        final Optional<String> nodeUUID,
                        final HasExpression hasExpression,
                        final Optional<HasName> hasName,
                        final DMNGridPanel gridPanel,
                        final DMNGridLayer gridLayer,
                        final RelationGridData gridData,
                        final DefinitionUtils definitionUtils,
                        final SessionManager sessionManager,
                        final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                        final DefaultCanvasCommandFactory canvasCommandFactory,
                        final Event<ExpressionEditorChanged> editorSelectedEvent,
                        final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
                        final Event<DomainObjectSelectionEvent> domainObjectSelectionEvent,
                        final CellEditorControlsView.Presenter cellEditorControls,
                        final ListSelectorView.Presenter listSelector,
                        final TranslationService translationService,
                        final boolean isOnlyVisualChangeAllowed,
                        final int nesting,
                        final ManagedInstance<ValueAndDataTypePopoverView.Presenter> headerEditors,
                        final ReadOnlyProvider readOnlyProvider); @Override RelationUIModelMapper makeUiModelMapper(); @Override void initialiseUiColumns(); @Override void initialiseUiRows(); @Override void initialiseUiCells(); @Override @SuppressWarnings("unused") java.util.List<ListSelectorItem> getItems(final int uiRowIndex,
                                                     final int uiColumnIndex); @Override void onItemSelected(final ListSelectorItem item); @Override void doAfterSelectionChange(final int uiRowIndex,
                                       final int uiColumnIndex); @Override void doAfterHeaderSelectionChange(final int uiHeaderRowIndex,
                                             final int uiHeaderColumnIndex);  }