@Test public void testColumn0MetaData() { setupGrid(makeHasNameForDecision(), 0); final GridColumn<?> column = grid.getModel().getColumns().get(0); final List<GridColumn.HeaderMetaData> header = column.getHeaderMetaData(); assertEquals(1, header.size()); assertTrue(header.get(0) instanceof RowNumberColumnHeaderMetaData); final RowNumberColumnHeaderMetaData md = (RowNumberColumnHeaderMetaData) header.get(0); expression.get().setHitPolicy(HitPolicy.FIRST); assertEquals("F", md.getTitle()); expression.get().setHitPolicy(HitPolicy.ANY); assertEquals("A", md.getTitle()); }
@Override public void setHitPolicy(final HitPolicy hitPolicy, final Command onSuccess) { getExpression().get().ifPresent(dtable -> { final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> commandBuilder = new CompositeCommand.Builder<>(); commandBuilder.addCommand(new SetBuiltinAggregatorCommand(dtable, null, gridLayer::batch)); commandBuilder.addCommand(new SetHitPolicyCommand(dtable, hitPolicy, () -> { gridLayer.batch(); onSuccess.execute(); })); sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), commandBuilder.build()); }); }
DecisionTableGrid extends BaseExpressionGrid<DecisionTable, DecisionTableGridData, DecisionTableUIModelMapper> implements HasListSelectorControl,
                                                                                                                                       HasHitPolicyControl { @Override public void setHitPolicy(final HitPolicy hitPolicy, final Command onSuccess) { getExpression().get().ifPresent(dtable -> { final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> commandBuilder = new CompositeCommand.Builder<>(); commandBuilder.addCommand(new SetBuiltinAggregatorCommand(dtable, null, gridLayer::batch)); commandBuilder.addCommand(new SetHitPolicyCommand(dtable, hitPolicy, () -> { gridLayer.batch(); onSuccess.execute(); })); sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), commandBuilder.build()); }); } }
DecisionTableGrid extends BaseExpressionGrid<DecisionTable, DecisionTableGridData, DecisionTableUIModelMapper> implements HasListSelectorControl,
                                                                                                                                       HasHitPolicyControl { @Override public void setHitPolicy(final HitPolicy hitPolicy, final Command onSuccess) { getExpression().get().ifPresent(dtable -> { final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> commandBuilder = new CompositeCommand.Builder<>(); commandBuilder.addCommand(new SetBuiltinAggregatorCommand(dtable, null, gridLayer::batch)); commandBuilder.addCommand(new SetHitPolicyCommand(dtable, hitPolicy, () -> { gridLayer.batch(); onSuccess.execute(); })); sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), commandBuilder.build()); }); } DecisionTableGrid(final GridCellTuple parent,
                             final Optional<String> nodeUUID,
                             final HasExpression hasExpression,
                             final Optional<HasName> hasName,
                             final DMNGridPanel gridPanel,
                             final DMNGridLayer gridLayer,
                             final DecisionTableGridData 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 HitPolicyPopoverView.Presenter hitPolicyEditor,
                             final ManagedInstance<ValueAndDataTypePopoverView.Presenter> headerEditors,
                             final ReadOnlyProvider readOnlyProvider); }
DecisionTableGrid extends BaseExpressionGrid<DecisionTable, DecisionTableGridData, DecisionTableUIModelMapper> implements HasListSelectorControl,
                                                                                                                                       HasHitPolicyControl { @Override public void setHitPolicy(final HitPolicy hitPolicy, final Command onSuccess) { getExpression().get().ifPresent(dtable -> { final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> commandBuilder = new CompositeCommand.Builder<>(); commandBuilder.addCommand(new SetBuiltinAggregatorCommand(dtable, null, gridLayer::batch)); commandBuilder.addCommand(new SetHitPolicyCommand(dtable, hitPolicy, () -> { gridLayer.batch(); onSuccess.execute(); })); sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), commandBuilder.build()); }); } DecisionTableGrid(final GridCellTuple parent,
                             final Optional<String> nodeUUID,
                             final HasExpression hasExpression,
                             final Optional<HasName> hasName,
                             final DMNGridPanel gridPanel,
                             final DMNGridLayer gridLayer,
                             final DecisionTableGridData 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 HitPolicyPopoverView.Presenter hitPolicyEditor,
                             final ManagedInstance<ValueAndDataTypePopoverView.Presenter> headerEditors,
                             final ReadOnlyProvider readOnlyProvider); @Override DecisionTableUIModelMapper makeUiModelMapper(); @Override void initialiseUiColumns(); @Override void initialiseUiRows(); @Override void initialiseUiCells(); @Override @SuppressWarnings("unused") List<ListSelectorItem> getItems(final int uiRowIndex,
                                           final int uiColumnIndex); @Override void onItemSelected(final ListSelectorItem item); @Override HitPolicy getHitPolicy(); @Override BuiltinAggregator getBuiltinAggregator(); @Override void setHitPolicy(final HitPolicy hitPolicy,
                             final Command onSuccess); @Override void setBuiltinAggregator(final BuiltinAggregator aggregator); @Override void doAfterSelectionChange(final int uiRowIndex,
                                       final int uiColumnIndex); @Override void doAfterHeaderSelectionChange(final int uiHeaderRowIndex,
                                             final int uiHeaderColumnIndex); }
DecisionTableGrid extends BaseExpressionGrid<DecisionTable, DecisionTableGridData, DecisionTableUIModelMapper> implements HasListSelectorControl,
                                                                                                                                       HasHitPolicyControl { @Override public void setHitPolicy(final HitPolicy hitPolicy, final Command onSuccess) { getExpression().get().ifPresent(dtable -> { final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> commandBuilder = new CompositeCommand.Builder<>(); commandBuilder.addCommand(new SetBuiltinAggregatorCommand(dtable, null, gridLayer::batch)); commandBuilder.addCommand(new SetHitPolicyCommand(dtable, hitPolicy, () -> { gridLayer.batch(); onSuccess.execute(); })); sessionCommandManager.execute((AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(), commandBuilder.build()); }); } DecisionTableGrid(final GridCellTuple parent,
                             final Optional<String> nodeUUID,
                             final HasExpression hasExpression,
                             final Optional<HasName> hasName,
                             final DMNGridPanel gridPanel,
                             final DMNGridLayer gridLayer,
                             final DecisionTableGridData 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 HitPolicyPopoverView.Presenter hitPolicyEditor,
                             final ManagedInstance<ValueAndDataTypePopoverView.Presenter> headerEditors,
                             final ReadOnlyProvider readOnlyProvider); @Override DecisionTableUIModelMapper makeUiModelMapper(); @Override void initialiseUiColumns(); @Override void initialiseUiRows(); @Override void initialiseUiCells(); @Override @SuppressWarnings("unused") List<ListSelectorItem> getItems(final int uiRowIndex,
                                           final int uiColumnIndex); @Override void onItemSelected(final ListSelectorItem item); @Override HitPolicy getHitPolicy(); @Override BuiltinAggregator getBuiltinAggregator(); @Override void setHitPolicy(final HitPolicy hitPolicy,
                             final Command onSuccess); @Override void setBuiltinAggregator(final BuiltinAggregator aggregator); @Override void doAfterSelectionChange(final int uiRowIndex,
                                       final int uiColumnIndex); @Override void doAfterHeaderSelectionChange(final int uiHeaderRowIndex,
                                             final int uiHeaderColumnIndex);  }