Search in sources :

Example 1 with LimitedEntryBRLConditionColumn

use of org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryBRLConditionColumn in project drools-wb by kiegroup.

the class BRLConditionColumnPlugin method clone.

BRLConditionColumn clone(final DTColumnConfig52 column) {
    final BRLConditionColumn brlConditionColumn = (BRLConditionColumn) column;
    final BRLConditionColumn clone;
    if (tableFormat() == LIMITED_ENTRY) {
        clone = new LimitedEntryBRLConditionColumn();
    } else {
        clone = new BRLConditionColumn();
        clone.setChildColumns(cloneVariables(brlConditionColumn.getChildColumns()));
    }
    clone.setHeader(column.getHeader());
    clone.setHideColumn(column.isHideColumn());
    clone.setDefinition(cloneDefinition(brlConditionColumn.getDefinition()));
    clone.setOperator(brlConditionColumn.getOperator());
    return clone;
}
Also used : BRLConditionColumn(org.drools.workbench.models.guided.dtable.shared.model.BRLConditionColumn) LimitedEntryBRLConditionColumn(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryBRLConditionColumn) LimitedEntryBRLConditionColumn(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryBRLConditionColumn)

Example 2 with LimitedEntryBRLConditionColumn

use of org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryBRLConditionColumn in project drools-wb by kiegroup.

the class LimitedEntryBRLConditionColumnSynchronizerTest method testDelete.

@Test
public void testDelete() throws VetoException {
    final LimitedEntryBRLConditionColumn column = new LimitedEntryBRLConditionColumn();
    column.setHeader("col1");
    modelSynchronizer.appendColumn(column);
    assertEquals(1, model.getConditions().size());
    assertEquals(4, uiModel.getColumns().size());
    modelSynchronizer.deleteColumn(column);
    assertEquals(0, model.getConditions().size());
    assertEquals(3, uiModel.getColumns().size());
}
Also used : LimitedEntryBRLConditionColumn(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryBRLConditionColumn) Test(org.junit.Test)

Example 3 with LimitedEntryBRLConditionColumn

use of org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryBRLConditionColumn in project drools-wb by kiegroup.

the class LimitedEntryBRLConditionColumnSynchronizerTest method testAppend.

@Test
public void testAppend() throws VetoException {
    final LimitedEntryBRLConditionColumn column = new LimitedEntryBRLConditionColumn();
    column.setHeader("col1");
    modelSynchronizer.appendColumn(column);
    assertEquals(1, model.getConditions().size());
    assertEquals(4, uiModel.getColumns().size());
    assertTrue(uiModel.getColumns().get(3) instanceof BooleanUiColumn);
    assertEquals(true, ((BaseMultipleDOMElementUiColumn) uiModel.getColumns().get(3)).isEditable());
}
Also used : LimitedEntryBRLConditionColumn(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryBRLConditionColumn) BooleanUiColumn(org.drools.workbench.screens.guided.dtable.client.widget.table.columns.BooleanUiColumn) Test(org.junit.Test)

Example 4 with LimitedEntryBRLConditionColumn

use of org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryBRLConditionColumn in project drools-wb by kiegroup.

the class LimitedEntryBRLConditionColumnSynchronizer method delete.

@Override
public void delete(final ColumnMetaData metaData) throws VetoException {
    // Check operation is supported
    if (!handlesDelete(metaData)) {
        return;
    }
    final LimitedEntryBRLConditionColumn column = (LimitedEntryBRLConditionColumn) metaData.getColumn();
    final int columnIndex = model.getExpandedColumns().indexOf(column);
    model.getConditions().remove(column);
    synchroniseDeleteColumn(columnIndex);
}
Also used : LimitedEntryBRLConditionColumn(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryBRLConditionColumn)

Example 5 with LimitedEntryBRLConditionColumn

use of org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryBRLConditionColumn in project drools-wb by kiegroup.

the class PluginHandlerTest method testEditWhenColumnIsALimitedEntryBRLConditionColumn.

@Test
public void testEditWhenColumnIsALimitedEntryBRLConditionColumn() {
    final LimitedEntryBRLConditionColumn originalColumn = mock(LimitedEntryBRLConditionColumn.class);
    testEditBrlConditionColumn(originalColumn);
}
Also used : LimitedEntryBRLConditionColumn(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryBRLConditionColumn) Test(org.junit.Test)

Aggregations

LimitedEntryBRLConditionColumn (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryBRLConditionColumn)11 Test (org.junit.Test)5 BRLConditionColumn (org.drools.workbench.models.guided.dtable.shared.model.BRLConditionColumn)2 BooleanUiColumn (org.drools.workbench.screens.guided.dtable.client.widget.table.columns.BooleanUiColumn)2 ArrayList (java.util.ArrayList)1 IPattern (org.drools.workbench.models.datamodel.rule.IPattern)1 BaseColumn (org.drools.workbench.models.guided.dtable.shared.model.BaseColumn)1 BaseColumnFieldDiff (org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)1 CompositeColumn (org.drools.workbench.models.guided.dtable.shared.model.CompositeColumn)1