@Test public void testInitialiseUiColumns() { final String columnHeader = "first column"; relation.getColumn().add(new InformationItem() {{ getName().setValue(columnHeader); }}); expression = Optional.of(relation); setupGrid(0); assertEquals(2, grid.getModel().getColumns().size()); assertTrue(grid.getModel().getColumns().get(0) instanceof RowNumberColumn); assertEquals(columnHeader, grid.getModel().getColumns().get(1).getHeaderMetaData().get(0).getTitle()); }
@Override public void initialiseUiColumns() { int uiColumnIndex = 0; final RowNumberColumn rowNumberColumn = new RowNumberColumn(); rowNumberColumn.setWidth(getAndSetInitialWidth(uiColumnIndex++, rowNumberColumn.getWidth())); if (getExpression().get().isPresent()) { model.appendColumn(rowNumberColumn); final Relation e = getExpression().get().get(); for (int index = 0; index < e.getColumn().size(); index++) { final GridColumn relationColumn = makeRelationColumn(uiColumnIndex++, e.getColumn().get(index)); model.appendColumn(relationColumn); } } getRenderer().setColumnRenderConstraint((isSelectionLayer, gridColumn) -> true); }
RelationGrid extends BaseExpressionGrid<Relation, RelationGridData, RelationUIModelMapper> implements HasListSelectorControl { @Override public void initialiseUiColumns() { int uiColumnIndex = 0; final RowNumberColumn rowNumberColumn = new RowNumberColumn(); rowNumberColumn.setWidth(getAndSetInitialWidth(uiColumnIndex++, rowNumberColumn.getWidth())); if (getExpression().get().isPresent()) { model.appendColumn(rowNumberColumn); final Relation e = getExpression().get().get(); for (int index = 0; index < e.getColumn().size(); index++) { final GridColumn relationColumn = makeRelationColumn(uiColumnIndex++, e.getColumn().get(index)); model.appendColumn(relationColumn); } } getRenderer().setColumnRenderConstraint((isSelectionLayer, gridColumn) -> true); } }
RelationGrid extends BaseExpressionGrid<Relation, RelationGridData, RelationUIModelMapper> implements HasListSelectorControl { @Override public void initialiseUiColumns() { int uiColumnIndex = 0; final RowNumberColumn rowNumberColumn = new RowNumberColumn(); rowNumberColumn.setWidth(getAndSetInitialWidth(uiColumnIndex++, rowNumberColumn.getWidth())); if (getExpression().get().isPresent()) { model.appendColumn(rowNumberColumn); final Relation e = getExpression().get().get(); for (int index = 0; index < e.getColumn().size(); index++) { final GridColumn relationColumn = makeRelationColumn(uiColumnIndex++, e.getColumn().get(index)); model.appendColumn(relationColumn); } } getRenderer().setColumnRenderConstraint((isSelectionLayer, gridColumn) -> true); } 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 { @Override public void initialiseUiColumns() { int uiColumnIndex = 0; final RowNumberColumn rowNumberColumn = new RowNumberColumn(); rowNumberColumn.setWidth(getAndSetInitialWidth(uiColumnIndex++, rowNumberColumn.getWidth())); if (getExpression().get().isPresent()) { model.appendColumn(rowNumberColumn); final Relation e = getExpression().get().get(); for (int index = 0; index < e.getColumn().size(); index++) { final GridColumn relationColumn = makeRelationColumn(uiColumnIndex++, e.getColumn().get(index)); model.appendColumn(relationColumn); } } getRenderer().setColumnRenderConstraint((isSelectionLayer, gridColumn) -> true); } 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 { @Override public void initialiseUiColumns() { int uiColumnIndex = 0; final RowNumberColumn rowNumberColumn = new RowNumberColumn(); rowNumberColumn.setWidth(getAndSetInitialWidth(uiColumnIndex++, rowNumberColumn.getWidth())); if (getExpression().get().isPresent()) { model.appendColumn(rowNumberColumn); final Relation e = getExpression().get().get(); for (int index = 0; index < e.getColumn().size(); index++) { final GridColumn relationColumn = makeRelationColumn(uiColumnIndex++, e.getColumn().get(index)); model.appendColumn(relationColumn); } } getRenderer().setColumnRenderConstraint((isSelectionLayer, gridColumn) -> true); } 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);  }