@Test public void testInitReverseOrder() throws Exception { when(reverseOrderCheckBox.getValue()).thenReturn(true); columnConfigRow.init(attributeColumn, presenter); verify(view).addReverseOrderCheckBox(eq(attributeColumn), eq(true), clickCaptor.capture()); clickCaptor.getValue().onClick(null); verify(editedAttributeColumn).setReverseOrder(true); verify(decisionTable).updateColumn(attributeColumn, editedAttributeColumn); }
public void init(final AttributeCol52 attributeColumn, final GuidedDecisionTableModellerView.Presenter presenter) { view.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); view.addColumnLabel(attributeColumn); final AttributeCol52 originalColumn = attributeColumn; if (Objects.equals(attributeColumn.getAttribute(), Attribute.SALIENCE.getAttributeName())) { useRowNumberCheckBox = view.addUseRowNumberCheckBox(attributeColumn, presenter.isActiveDecisionTableEditable(), (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setUseRowNumber(useRowNumberCheckBox.getValue()); reverseOrderCheckBox.setEnabled(useRowNumberCheckBox.getValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); view.add(new Span("(")); reverseOrderCheckBox = view.addReverseOrderCheckBox(attributeColumn, presenter.isActiveDecisionTableEditable(), (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setReverseOrder(reverseOrderCheckBox.getValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); view.add(new Span(")")); } view.addDefaultValue(attributeColumn, presenter.isActiveDecisionTableEditable(), (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setDefaultValue(event.getEditedDefaultValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); hideColumnCheckBox = view.addHideColumnCheckBox(attributeColumn, (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setHideColumn(hideColumnCheckBox.getValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); addRemoveAttributeButton(attributeColumn, presenter); }
AttributeColumnConfigRow { public void init(final AttributeCol52 attributeColumn, final GuidedDecisionTableModellerView.Presenter presenter) { view.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); view.addColumnLabel(attributeColumn); final AttributeCol52 originalColumn = attributeColumn; if (Objects.equals(attributeColumn.getAttribute(), Attribute.SALIENCE.getAttributeName())) { useRowNumberCheckBox = view.addUseRowNumberCheckBox(attributeColumn, presenter.isActiveDecisionTableEditable(), (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setUseRowNumber(useRowNumberCheckBox.getValue()); reverseOrderCheckBox.setEnabled(useRowNumberCheckBox.getValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); view.add(new Span("(")); reverseOrderCheckBox = view.addReverseOrderCheckBox(attributeColumn, presenter.isActiveDecisionTableEditable(), (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setReverseOrder(reverseOrderCheckBox.getValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); view.add(new Span(")")); } view.addDefaultValue(attributeColumn, presenter.isActiveDecisionTableEditable(), (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setDefaultValue(event.getEditedDefaultValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); hideColumnCheckBox = view.addHideColumnCheckBox(attributeColumn, (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setHideColumn(hideColumnCheckBox.getValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); addRemoveAttributeButton(attributeColumn, presenter); } }
AttributeColumnConfigRow { public void init(final AttributeCol52 attributeColumn, final GuidedDecisionTableModellerView.Presenter presenter) { view.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); view.addColumnLabel(attributeColumn); final AttributeCol52 originalColumn = attributeColumn; if (Objects.equals(attributeColumn.getAttribute(), Attribute.SALIENCE.getAttributeName())) { useRowNumberCheckBox = view.addUseRowNumberCheckBox(attributeColumn, presenter.isActiveDecisionTableEditable(), (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setUseRowNumber(useRowNumberCheckBox.getValue()); reverseOrderCheckBox.setEnabled(useRowNumberCheckBox.getValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); view.add(new Span("(")); reverseOrderCheckBox = view.addReverseOrderCheckBox(attributeColumn, presenter.isActiveDecisionTableEditable(), (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setReverseOrder(reverseOrderCheckBox.getValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); view.add(new Span(")")); } view.addDefaultValue(attributeColumn, presenter.isActiveDecisionTableEditable(), (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setDefaultValue(event.getEditedDefaultValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); hideColumnCheckBox = view.addHideColumnCheckBox(attributeColumn, (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setHideColumn(hideColumnCheckBox.getValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); addRemoveAttributeButton(attributeColumn, presenter); } AttributeColumnConfigRow(); }
AttributeColumnConfigRow { public void init(final AttributeCol52 attributeColumn, final GuidedDecisionTableModellerView.Presenter presenter) { view.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); view.addColumnLabel(attributeColumn); final AttributeCol52 originalColumn = attributeColumn; if (Objects.equals(attributeColumn.getAttribute(), Attribute.SALIENCE.getAttributeName())) { useRowNumberCheckBox = view.addUseRowNumberCheckBox(attributeColumn, presenter.isActiveDecisionTableEditable(), (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setUseRowNumber(useRowNumberCheckBox.getValue()); reverseOrderCheckBox.setEnabled(useRowNumberCheckBox.getValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); view.add(new Span("(")); reverseOrderCheckBox = view.addReverseOrderCheckBox(attributeColumn, presenter.isActiveDecisionTableEditable(), (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setReverseOrder(reverseOrderCheckBox.getValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); view.add(new Span(")")); } view.addDefaultValue(attributeColumn, presenter.isActiveDecisionTableEditable(), (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setDefaultValue(event.getEditedDefaultValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); hideColumnCheckBox = view.addHideColumnCheckBox(attributeColumn, (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setHideColumn(hideColumnCheckBox.getValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); addRemoveAttributeButton(attributeColumn, presenter); } AttributeColumnConfigRow(); void init(final AttributeCol52 attributeColumn,
                     final GuidedDecisionTableModellerView.Presenter presenter); Widget getView(); }
AttributeColumnConfigRow { public void init(final AttributeCol52 attributeColumn, final GuidedDecisionTableModellerView.Presenter presenter) { view.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); view.addColumnLabel(attributeColumn); final AttributeCol52 originalColumn = attributeColumn; if (Objects.equals(attributeColumn.getAttribute(), Attribute.SALIENCE.getAttributeName())) { useRowNumberCheckBox = view.addUseRowNumberCheckBox(attributeColumn, presenter.isActiveDecisionTableEditable(), (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setUseRowNumber(useRowNumberCheckBox.getValue()); reverseOrderCheckBox.setEnabled(useRowNumberCheckBox.getValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); view.add(new Span("(")); reverseOrderCheckBox = view.addReverseOrderCheckBox(attributeColumn, presenter.isActiveDecisionTableEditable(), (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setReverseOrder(reverseOrderCheckBox.getValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); view.add(new Span(")")); } view.addDefaultValue(attributeColumn, presenter.isActiveDecisionTableEditable(), (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setDefaultValue(event.getEditedDefaultValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); hideColumnCheckBox = view.addHideColumnCheckBox(attributeColumn, (event) -> { final AttributeCol52 editedColumn = originalColumn.cloneColumn(); editedColumn.setHideColumn(hideColumnCheckBox.getValue()); try { final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable(); if (dtPresenter.isPresent()) { dtPresenter.get().updateColumn(originalColumn, editedColumn); } } catch (VetoException veto) { presenter.getView().showGenericVetoMessage(); } }); addRemoveAttributeButton(attributeColumn, presenter); } AttributeColumnConfigRow(); void init(final AttributeCol52 attributeColumn,
                     final GuidedDecisionTableModellerView.Presenter presenter); Widget getView();  }