use of com.centurylink.mdw.plugin.designer.properties.editor.TableEditor in project mdw-designer by CenturyLinkCloud.
the class VariablesSection method drawWidgets.
public void drawWidgets(Composite composite, WorkflowElement selection) {
process = (WorkflowProcess) selection;
tableEditor = new TableEditor(process, TableEditor.TYPE_TABLE);
if (columnSpecs == null)
columnSpecs = createColumnSpecs();
tableEditor.setColumnSpecs(columnSpecs);
if (contentProvider == null)
contentProvider = new VariableContentProvider();
tableEditor.setContentProvider(contentProvider);
if (labelProvider == null)
labelProvider = new VariableLabelProvider();
tableEditor.setLabelProvider(labelProvider);
if (cellModifier == null)
cellModifier = new VariableCellModifier();
tableEditor.setCellModifier(cellModifier);
if (modelUpdater == null)
modelUpdater = new VariableModelUpdater();
tableEditor.setModelUpdater(modelUpdater);
tableEditor.render(composite);
// variables help link
variablesHelpPropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_LINK);
variablesHelpPropertyEditor.setLabel("Process Variables Help");
variablesHelpPropertyEditor.render(composite);
}
use of com.centurylink.mdw.plugin.designer.properties.editor.TableEditor in project mdw-designer by CenturyLinkCloud.
the class AttributesSection method drawWidgets.
@Override
public void drawWidgets(Composite composite, WorkflowElement selection) {
this.element = selection;
tableEditor = new TableEditor(element, TableEditor.TYPE_TABLE);
List<ColumnSpec> columnSpecs = new ArrayList<>();
columnSpecs.add(new ColumnSpec(PropertyEditor.TYPE_TEXT, "Attribute Name", "name"));
columnSpecs.add(new ColumnSpec(PropertyEditor.TYPE_TEXT, "Value", "value"));
tableEditor.setColumnSpecs(columnSpecs);
tableEditor.setReadOnly(true);
tableEditor.setContentProvider(new AttributeContentProvider());
tableEditor.setLabelProvider(new AttributeLabelProvider());
tableEditor.render(composite);
tableEditor.getTable().addSelectionListener(new SelectionAdapter() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
AttributeVO attributeVO = (AttributeVO) e.item.getData();
AttributeDialog dialog = new AttributeDialog(getShell(), attributeVO);
dialog.open();
}
});
}
use of com.centurylink.mdw.plugin.designer.properties.editor.TableEditor in project mdw-designer by CenturyLinkCloud.
the class ImportProjectSelectPage method createProjectListControls.
private void createProjectListControls(Composite parent, int ncol) {
projectTableEditor = new TableEditor(null, TableEditor.TYPE_TABLE);
// colspecs
List<ColumnSpec> projectColSpecs = new ArrayList<>();
ColumnSpec selectionColSpec = new ColumnSpec(PropertyEditor.TYPE_CHECKBOX, "Import/Overwrite", "import");
selectionColSpec.width = 100;
projectColSpecs.add(selectionColSpec);
ColumnSpec projectColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Project", "project");
projectColSpec.width = 250;
projectColSpec.readOnly = true;
projectColSpecs.add(projectColSpec);
ColumnSpec noteColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Note", "note");
noteColSpec.readOnly = true;
noteColSpec.width = 150;
projectColSpecs.add(noteColSpec);
projectTableEditor.setColumnSpecs(projectColSpecs);
projectTableEditor.setFillWidth(true);
projectTableEditor.setModelUpdater(new TableModelUpdater() {
public Object create() {
return null;
}
@SuppressWarnings("rawtypes")
public void updateModelValue(List tableValue) {
List<WorkflowProject> selectedProjects = new ArrayList<>();
for (WorkflowProject workflowProject : getProjectList()) {
for (Object rowObj : tableValue) {
DefaultRowImpl row = (DefaultRowImpl) rowObj;
if (workflowProject.getName().equals(row.getColumnValue(1)) && ((Boolean) row.getColumnValue(0)).booleanValue())
selectedProjects.add(workflowProject);
}
}
setProjectsToImport(selectedProjects);
handleFieldChanged();
}
});
projectTableEditor.render(parent, false);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.horizontalSpan = ncol;
projectTableEditor.getTable().setLayoutData(gd);
}
Aggregations