use of org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52 in project drools-wb by kiegroup.
the class ActionRetractFactColumnSynchronizer method update.
@Override
public List<BaseColumnFieldDiff> update(final ColumnMetaData originalMetaData, final ColumnMetaData editedMetaData) throws VetoException {
// Check operation is supported
if (!(handlesUpdate(originalMetaData) && handlesUpdate(editedMetaData))) {
return Collections.emptyList();
}
// Get differences between original and edited column
final ActionRetractFactCol52 originalColumn = (ActionRetractFactCol52) originalMetaData.getColumn();
final ActionRetractFactCol52 editedColumn = (ActionRetractFactCol52) editedMetaData.getColumn();
final List<BaseColumnFieldDiff> diffs = originalColumn.diff(editedColumn);
update(originalColumn, editedColumn);
final boolean isHideUpdated = BaseColumnFieldDiffImpl.hasChanged(ActionRetractFactCol52.FIELD_HIDE_COLUMN, diffs);
final boolean isHeaderUpdated = BaseColumnFieldDiffImpl.hasChanged(ActionRetractFactCol52.FIELD_HEADER, diffs);
synchroniseUpdateColumn(originalColumn);
if (isHideUpdated) {
setColumnVisibility(originalColumn, originalColumn.isHideColumn());
}
if (isHeaderUpdated) {
setColumnHeader(originalColumn, originalColumn.getHeader());
}
return diffs;
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52 in project drools-wb by kiegroup.
the class DecisionTableColumnViewUtilsTest method testColumnManagementGroupTitleRetractAction.
@Test
public void testColumnManagementGroupTitleRetractAction() throws Exception {
final ActionRetractFactCol52 column = mock(ActionRetractFactCol52.class);
assertEquals(GuidedDecisionTableConstants.INSTANCE.RetractActions(), DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column));
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52 in project drools-wb by kiegroup.
the class ActionRetractFactPluginTest method testSetupDefaultValuesColumnIsNotNew.
@Test
public void testSetupDefaultValuesColumnIsNotNew() throws Exception {
final ActionRetractFactCol52 originalCol = mock(ActionRetractFactCol52.class);
doReturn(false).when(plugin).isNewColumn();
doReturn(originalCol).when(plugin).originalCol();
doReturn(originalCol).when(plugin).clone(originalCol);
plugin.setupDefaultValues();
assertEquals(plugin.editingCol(), originalCol);
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52 in project drools-wb by kiegroup.
the class ActionRetractFactPluginTest method testGenerateColumnWhenColumnIsNew.
@Test
public void testGenerateColumnWhenColumnIsNew() throws Exception {
final ActionRetractFactCol52 expectedColumn = mock(ActionRetractFactCol52.class);
doReturn(true).when(plugin).isNewColumn();
doReturn(expectedColumn).when(plugin).editingCol();
assertTrue(plugin.generateColumn());
verify(presenter).appendColumn(expectedColumn);
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52 in project drools-wb by kiegroup.
the class ActionRetractFactPluginTest method testGenerateColumnWhenColumnIsNotNew.
@Test
public void testGenerateColumnWhenColumnIsNotNew() throws Exception {
final ActionRetractFactCol52 editingCol = mock(ActionRetractFactCol52.class);
final ActionRetractFactCol52 originalCol = mock(ActionRetractFactCol52.class);
doReturn(false).when(plugin).isNewColumn();
doReturn(editingCol).when(plugin).editingCol();
doReturn(originalCol).when(plugin).originalCol();
assertTrue(plugin.generateColumn());
verify(presenter).updateColumn(originalCol, editingCol);
}
Aggregations