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;
}
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());
}
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());
}
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);
}
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);
}
Aggregations