use of com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec 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