Search in sources :

Example 26 with ActionRetractFactCol52

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;
}
Also used : ActionRetractFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52) BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)

Example 27 with ActionRetractFactCol52

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));
}
Also used : ActionRetractFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52) Test(org.junit.Test)

Example 28 with ActionRetractFactCol52

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);
}
Also used : LimitedEntryActionRetractFactCol52(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryActionRetractFactCol52) ActionRetractFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52) Test(org.junit.Test)

Example 29 with ActionRetractFactCol52

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);
}
Also used : LimitedEntryActionRetractFactCol52(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryActionRetractFactCol52) ActionRetractFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52) Test(org.junit.Test)

Example 30 with ActionRetractFactCol52

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);
}
Also used : LimitedEntryActionRetractFactCol52(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryActionRetractFactCol52) ActionRetractFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52) Test(org.junit.Test)

Aggregations

ActionRetractFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52)31 Test (org.junit.Test)24 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)11 ActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52)10 ActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52)8 LimitedEntryActionRetractFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryActionRetractFactCol52)7 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)6 BRLActionColumn (org.drools.workbench.models.guided.dtable.shared.model.BRLActionColumn)4 BaseColumn (org.drools.workbench.models.guided.dtable.shared.model.BaseColumn)4 ConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52)4 LimitedEntryActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryActionInsertFactCol52)4 LimitedEntryActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryActionSetFieldCol52)4 LimitedEntryConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryConditionCol52)4 Pattern52 (org.drools.workbench.models.guided.dtable.shared.model.Pattern52)4 BoundFactUiColumn (org.drools.workbench.screens.guided.dtable.client.widget.table.columns.BoundFactUiColumn)4 AttributeCol52 (org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52)3 BaseColumnFieldDiff (org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2