use of com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec in project mdw-designer by CenturyLinkCloud.
the class SearchResultsPage method createTableEditor.
private TableEditor createTableEditor() {
TableEditor editor = new TableEditor(null, TableEditor.TYPE_TABLE);
List<ColumnSpec> columnSpecs = new ArrayList<ColumnSpec>();
ColumnSpec nameColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Name", "name");
nameColSpec.width = 225;
columnSpecs.add(nameColSpec);
ColumnSpec versionColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Version", "version");
versionColSpec.width = 60;
columnSpecs.add(versionColSpec);
ColumnSpec idColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "ID", "id");
idColSpec.width = 80;
columnSpecs.add(idColSpec);
ColumnSpec projectColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Project", "workflowProject");
projectColSpec.width = 175;
columnSpecs.add(projectColSpec);
ColumnSpec packageColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Package", "package");
packageColSpec.width = 175;
columnSpecs.add(packageColSpec);
if (searchQuery != null && searchQuery.isInstanceQuery()) {
ColumnSpec instanceColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Instance ID", "instanceId");
instanceColSpec.width = 85;
columnSpecs.add(instanceColSpec);
ColumnSpec statusColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Status", "status");
instanceColSpec.width = 75;
columnSpecs.add(statusColSpec);
ColumnSpec startDateColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Start", "instanceStartDate");
startDateColSpec.width = 100;
columnSpecs.add(startDateColSpec);
ColumnSpec endDateColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "End", "instanceEndDate");
endDateColSpec.width = 100;
columnSpecs.add(endDateColSpec);
}
if (searchQuery instanceof AssetSearchQuery) {
ColumnSpec lastModColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Last Modified", "modifyDate");
lastModColSpec.width = 100;
columnSpecs.add(lastModColSpec);
}
editor.setColumnSpecs(columnSpecs);
editor.setReadOnly(true);
editor.setContentProvider(new ResultElementContentProvider());
editor.setLabelProvider(new ResultElementLabelProvider());
return editor;
}
use of com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec in project mdw-designer by CenturyLinkCloud.
the class PackageConfigurationSection method createTable.
private Table createTable(Composite parent) {
int style = SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.HIDE_SELECTION;
table = new Table(parent, style);
GridData gridData = new GridData(GridData.FILL_BOTH);
table.setLayoutData(gridData);
table.setLinesVisible(true);
table.setHeaderVisible(true);
for (int i = 0; i < columnSpecs.size(); i++) {
ColumnSpec colSpec = columnSpecs.get(i);
int colStyle = SWT.LEFT | colSpec.style;
if (colSpec.readOnly)
colStyle = colStyle | SWT.READ_ONLY;
TableColumn column = new TableColumn(table, colStyle, i);
if (colSpec.label != null)
column.setText(colSpec.label);
column.setWidth(colSpec.width);
column.setResizable(colSpec.resizable);
}
return table;
}
use of com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec in project mdw-designer by CenturyLinkCloud.
the class PackageConfigurationSection method setSelection.
@Override
public void setSelection(WorkflowElement selection) {
workflowPackage = (WorkflowPackage) selection;
if (table != null)
table.dispose();
if (buttonComposite != null)
buttonComposite.dispose();
BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
public void run() {
propertyGroups = getPropertyGroups();
propertyRows = getPropertyRows(propertyGroups);
columnSpecs = new ArrayList<>();
ColumnSpec propNameColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, PROPERTY, PROPERTY_NAME);
propNameColSpec.width = 200;
columnSpecs.add(propNameColSpec);
for (PropertyGroup propGroup : propertyGroups) {
ColumnSpec colSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, propGroup.getName(), propGroup.getName());
colSpec.width = 200;
columnSpecs.add(colSpec);
}
Collections.sort(columnSpecs, new Comparator<ColumnSpec>() {
public int compare(ColumnSpec cs1, ColumnSpec cs2) {
if (cs1.label != null && cs1.label.equals(PROPERTY))
return -1;
if (cs2.label != null && cs2.label.equals(PROPERTY))
return 1;
// dev always comes first; prod always comes last
if (cs1.label != null && (cs1.label.equalsIgnoreCase("dev") || cs2.label.equalsIgnoreCase("prod")))
return -1;
if (cs2.label != null && (cs2.label.equalsIgnoreCase("dev") || cs1.label.equalsIgnoreCase("prod")))
return 1;
return cs1.label.compareToIgnoreCase(cs2.label);
}
});
Collections.sort(propertyRows);
}
});
table = createTable(composite);
tableViewer = createTableViewer(table);
tableViewer.setContentProvider(new PackageConfigContentProvider());
tableViewer.setLabelProvider(new PackageConfigLabelProvider());
tableViewer.setInput(propertyRows);
if ((!workflowPackage.isArchived() || DesignerProxy.isArchiveEditAllowed()) && workflowPackage.getProject().isUserAuthorizedForSystemAdmin())
createButtons(composite);
composite.layout(true);
}
use of com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec in project mdw-designer by CenturyLinkCloud.
the class SimulationSection method createColumnSpecs.
private List<ColumnSpec> createColumnSpecs() {
List<ColumnSpec> columnSpecs = new ArrayList<ColumnSpec>();
ColumnSpec codeColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Response Name", "code");
codeColSpec.width = 150;
columnSpecs.add(codeColSpec);
ColumnSpec chanceColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Chance", "chance");
chanceColSpec.width = 60;
columnSpecs.add(chanceColSpec);
ColumnSpec respColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Response", "response");
respColSpec.width = 400;
respColSpec.height = 35;
respColSpec.style = SWT.MULTI | SWT.WRAP | SWT.V_SCROLL;
columnSpecs.add(respColSpec);
return columnSpecs;
}
use of com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec in project mdw-designer by CenturyLinkCloud.
the class SubProcessInstancesSection 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 nameColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Name", "name");
nameColSpec.width = 250;
columnSpecs.add(nameColSpec);
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;
}
Aggregations