use of org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52 in project drools-wb by kiegroup.
the class ColumnsPagePresenter method refreshAttributeWidget.
void refreshAttributeWidget(final List<AttributeCol52> attributeColumns) {
final Optional<GuidedDecisionTableModellerView.Presenter> optionalModeller = Optional.ofNullable(getModeller());
final VerticalPanel attributeWidget = getAttributeWidget();
if (!optionalModeller.isPresent()) {
return;
}
final GuidedDecisionTableModellerView.Presenter modeller = optionalModeller.get();
attributeWidget.clear();
if (attributeColumns.isEmpty()) {
attributeWidget.add(blankSlate());
return;
}
for (final AttributeCol52 attributeColumn : attributeColumns) {
final AttributeColumnConfigRow columnConfigRow = attributeColumnConfigRow.get();
columnConfigRow.init(attributeColumn, modeller);
attributeWidget.add(columnConfigRow.getView());
}
}
use of org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52 in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenter method onDeleteSelectedColumns.
@Override
public void onDeleteSelectedColumns() {
if (isReadOnly()) {
return;
}
final Set<Integer> selectedColumnIndexes = getSelectedColumnIndexes();
final Set<BaseColumn> columnsToDelete = new HashSet<>();
for (int selectedColumnIndex : selectedColumnIndexes) {
final int columnIndex = findUiColumnIndex(selectedColumnIndex);
final BaseColumn column = model.getExpandedColumns().get(columnIndex);
if (!(column instanceof RowNumberCol52 || column instanceof DescriptionCol52)) {
columnsToDelete.add(column);
}
}
for (BaseColumn columnToDelete : columnsToDelete) {
if (columnToDelete instanceof AttributeCol52) {
try {
deleteColumn((AttributeCol52) columnToDelete);
} catch (VetoException veto) {
getModellerPresenter().getView().showGenericVetoMessage();
}
} else if (columnToDelete instanceof MetadataCol52) {
try {
deleteColumn((MetadataCol52) columnToDelete);
} catch (VetoException veto) {
getModellerPresenter().getView().showGenericVetoMessage();
}
} else if (columnToDelete instanceof ConditionCol52) {
try {
deleteColumn((ConditionCol52) columnToDelete);
} catch (VetoException veto) {
getModellerPresenter().getView().showUnableToDeleteColumnMessage((ConditionCol52) columnsToDelete);
}
} else if (columnToDelete instanceof ActionCol52) {
try {
deleteColumn((ActionCol52) columnToDelete);
} catch (VetoException veto) {
getModellerPresenter().getView().showUnableToDeleteColumnMessage((ActionCol52) columnsToDelete);
}
}
}
}
use of org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52 in project drools-wb by kiegroup.
the class GuidedDecisionTableFactory method makeTableWithAttributeCol.
public static GuidedDecisionTable52 makeTableWithAttributeCol(final String packageName, final Collection<Import> imports, final String tableName) {
final GuidedDecisionTable52 dt = new GuidedDecisionTable52();
dt.setPackageName(packageName);
dt.getImports().getImports().addAll(imports);
dt.setTableName(tableName);
AttributeCol52 attr = new AttributeCol52();
attr.setAttribute("ruleflow-group");
dt.getAttributeCols().add(attr);
dt.setData(DataUtilities.makeDataLists(new String[][] { new String[] { "1", "desc", "myRuleFlowGroup" } }));
return dt;
}
use of org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52 in project drools-wb by kiegroup.
the class GuidedDecisionTableTheme method getModelColumnType.
ModelColumnType getModelColumnType(final GridColumn<?> uiColumn) {
final int uiColumnIndex = uiModel.getColumns().indexOf(uiColumn);
final BaseColumn modelColumn = model.getExpandedColumns().get(uiColumnIndex);
if (modelColumn instanceof RowNumberCol52) {
return ModelColumnType.ROW_NUMBER;
} else if (modelColumn instanceof DescriptionCol52) {
return ModelColumnType.DESCRIPTION;
} else if (modelColumn instanceof MetadataCol52) {
return ModelColumnType.METADATA;
} else if (modelColumn instanceof AttributeCol52) {
return ModelColumnType.ATTRIBUTE;
} else if (modelColumn instanceof ConditionCol52) {
return ModelColumnType.CONDITION;
} else if (modelColumn instanceof ActionCol52) {
return ModelColumnType.ACTION;
}
// proof rendering than throw an exception.
return ModelColumnType.UNKNOWN;
}
use of org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52 in project drools-wb by kiegroup.
the class AttributeColumnPlugin method getAttributeCol52.
private AttributeCol52 getAttributeCol52() {
final AttributeCol52 column = new AttributeCol52();
column.setAttribute(attribute);
return column;
}
Aggregations