use of com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec in project mdw-designer by CenturyLinkCloud.
the class TransitionInstanceSection method createColumnSpecs.
private List<ColumnSpec> createColumnSpecs() {
List<ColumnSpec> columnSpecs = new ArrayList<ColumnSpec>();
ColumnSpec instanceIdColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Instance ID", "instanceId");
instanceIdColSpec.width = 100;
columnSpecs.add(instanceIdColSpec);
ColumnSpec statusColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Status", "status");
statusColSpec.width = 100;
columnSpecs.add(statusColSpec);
ColumnSpec startDateColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Start", "startDate");
startDateColSpec.width = 150;
columnSpecs.add(startDateColSpec);
ColumnSpec endDateColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "End", "endDate");
endDateColSpec.width = 150;
columnSpecs.add(endDateColSpec);
return columnSpecs;
}
use of com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec in project mdw-designer by CenturyLinkCloud.
the class PreferencesSection method createNoticesTable.
private void createNoticesTable() {
noticesEditor = new TableEditor(null, TableEditor.TYPE_TABLE);
noticesEditor.setLabel("Desktop Notices");
// colspecs
List<ColumnSpec> colSpecs = new ArrayList<ColumnSpec>();
ColumnSpec selectionColSpec = new ColumnSpec(PropertyEditor.TYPE_CHECKBOX, "", "selected");
selectionColSpec.width = 50;
colSpecs.add(selectionColSpec);
ColumnSpec extensionColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Task Outcome", "outcome");
extensionColSpec.width = 150;
extensionColSpec.readOnly = true;
colSpecs.add(extensionColSpec);
noticesEditor.setColumnSpecs(colSpecs);
noticesEditor.setHorizontalSpan(3);
noticesEditor.setWidth(300);
noticesEditor.setModelUpdater(new TableModelUpdater() {
public Object create() {
return null;
}
@SuppressWarnings("rawtypes")
public void updateModelValue(List tableValue) {
List<String> selectedNotices = new ArrayList<String>();
for (Action outcome : UserActionVO.NOTIFIABLE_TASK_ACTIONS) {
for (Object rowObj : tableValue) {
DefaultRowImpl row = (DefaultRowImpl) rowObj;
if (outcome.toString().equals(row.getColumnValue(1))) {
if (((Boolean) row.getColumnValue(0)).booleanValue())
selectedNotices.add(outcome.toString());
else
selectedNotices.remove(outcome.toString());
}
}
}
project.setNoticeChecks(selectedNotices);
}
});
}
use of com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec in project mdw-designer by CenturyLinkCloud.
the class VariableValuesTableContainer method createColumnSpecs.
private void createColumnSpecs() {
columnSpecs = new ArrayList<>();
ColumnSpec inputVarColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Variable", "variable");
inputVarColSpec.width = 150;
inputVarColSpec.readOnly = true;
columnSpecs.add(inputVarColSpec);
ColumnSpec varTypeColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Type", "type");
varTypeColSpec.width = 150;
varTypeColSpec.readOnly = true;
columnSpecs.add(varTypeColSpec);
ColumnSpec valueColSpec = new ColumnSpec(PropertyEditor.TYPE_DIALOG, "Value", "value");
valueColSpec.width = 200;
columnSpecs.add(valueColSpec);
columnProps = new String[columnSpecs.size()];
for (int i = 0; i < columnSpecs.size(); i++) {
columnProps[i] = columnSpecs.get(i).property;
}
}
use of com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec in project mdw-designer by CenturyLinkCloud.
the class VariableValuesTableContainer method createTable.
private void createTable(Composite parent) {
int style = SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION;
table = new Table(parent, style);
GridData gridData = new GridData(GridData.FILL_BOTH);
gridData.horizontalSpan = 2;
gridData.verticalIndent = 3;
gridData.verticalAlignment = SWT.FILL;
gridData.heightHint = 150;
table.setLayoutData(gridData);
table.setLinesVisible(true);
table.setHeaderVisible(true);
for (int i = 0; i < columnSpecs.size(); i++) {
ColumnSpec colSpec = columnSpecs.get(i);
int styles = SWT.LEFT;
if (colSpec.readOnly)
style = style | SWT.READ_ONLY;
TableColumn column = new TableColumn(table, styles, i);
column.setText(colSpec.label);
column.setWidth(colSpec.width);
column.setResizable(colSpec.resizable);
}
table.addControlListener(new ControlAdapter() {
@Override
public void controlResized(ControlEvent e) {
int tableWidth = table.getBounds().width;
int cumulative = 0;
TableColumn[] tableColumns = table.getColumns();
for (int i = 0; i < tableColumns.length; i++) {
if (i == tableColumns.length - 1)
tableColumns[i].setWidth(tableWidth - cumulative - 5);
cumulative += tableColumns[i].getWidth();
}
}
});
table.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
VariableValue varVal = (VariableValue) e.item.getData();
String originalValue = varVal.getValue();
VariableValueDialog varValDlg = new VariableValueDialog(getShell(), varVal);
varValDlg.setHelpAvailable(false);
if (varValDlg.open() == Dialog.OK && !originalValue.equals(varVal.getValue())) {
varVal.setValue(varValDlg.getVariableValue().getValue());
tableViewer.update(varVal, null);
fireDirtyStateChange(true);
} else {
varVal.setValue(originalValue);
}
}
});
}
use of com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec in project mdw-designer by CenturyLinkCloud.
the class VariableValuesTableContainer method createTableViewer.
private void createTableViewer() {
tableViewer = new TableViewer(table);
tableViewer.setUseHashlookup(true);
tableViewer.setColumnProperties(columnProps);
CellEditor[] editors = new CellEditor[columnSpecs.size()];
for (int i = 0; i < columnSpecs.size(); i++) {
ColumnSpec colSpec = columnSpecs.get(i);
CellEditor cellEditor = null;
if (colSpec.type.equals(PropertyEditor.TYPE_TEXT)) {
cellEditor = new TextCellEditor(table);
} else if (colSpec.type.equals(PropertyEditor.TYPE_DIALOG)) {
cellEditor = new VariableCellEditor(table);
}
editors[i] = cellEditor;
}
tableViewer.setCellEditors(editors);
tableViewer.setCellModifier(new VariableCellModifier());
tableViewer.setLabelProvider(new VariablesLabelProvider());
tableViewer.setContentProvider(new VariablesContentProvider());
}
Aggregations