use of com.centurylink.mdw.plugin.designer.properties.editor.TableEditor.DefaultRowImpl in project mdw-designer by CenturyLinkCloud.
the class ExtensionModulesTable method setSelectedModules.
public void setSelectedModules(List<ExtensionModule> list) {
this.selectedModules = list;
List<DefaultRowImpl> tableRows = new ArrayList<DefaultRowImpl>();
for (ExtensionModule module : WorkflowProjectManager.getInstance().getAvailableExtensions(workflowProject)) {
String[] rowData = new String[3];
if (selectedModules.contains(module))
rowData[0] = "true";
else
rowData[0] = "false";
rowData[1] = module.getName();
rowData[2] = module.getDescription();
DefaultRowImpl row = tableEditor.new DefaultRowImpl(rowData);
tableRows.add(row);
}
tableEditor.setValue(tableRows);
}
use of com.centurylink.mdw.plugin.designer.properties.editor.TableEditor.DefaultRowImpl in project mdw-designer by CenturyLinkCloud.
the class ImportProjectSelectPage method createSelectButtonControls.
private void createSelectButtonControls(Composite parent, int ncol) {
Composite buttonComposite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
layout.horizontalSpacing = 5;
buttonComposite.setLayout(layout);
GridData gd = new GridData(SWT.END, SWT.TOP, true, false);
gd.horizontalSpan = ncol;
buttonComposite.setLayoutData(gd);
Button selectAllButton = new Button(buttonComposite, SWT.PUSH);
selectAllButton.setText("Select All");
gd = new GridData(GridData.BEGINNING);
gd.widthHint = 75;
selectAllButton.setLayoutData(gd);
selectAllButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
for (Object rowObj : projectTableEditor.getTableValue()) {
DefaultRowImpl row = (DefaultRowImpl) rowObj;
row.setColumnValue(0, "true");
}
setProjectsToImport(getProjectList());
projectTableEditor.getTableViewer().update(projectTableEditor.getTableValue(), null);
handleFieldChanged();
}
});
Button deselectAllButton = new Button(buttonComposite, SWT.PUSH);
deselectAllButton.setText("Deselect All");
gd = new GridData(GridData.BEGINNING);
gd.widthHint = 70;
deselectAllButton.setLayoutData(gd);
deselectAllButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
for (Object rowObj : projectTableEditor.getTableValue()) {
DefaultRowImpl row = (DefaultRowImpl) rowObj;
row.setColumnValue(0, "false");
}
setProjectsToImport(new ArrayList<WorkflowProject>());
projectTableEditor.getTableViewer().update(projectTableEditor.getTableValue(), null);
handleFieldChanged();
}
});
}
use of com.centurylink.mdw.plugin.designer.properties.editor.TableEditor.DefaultRowImpl 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);
}
use of com.centurylink.mdw.plugin.designer.properties.editor.TableEditor.DefaultRowImpl in project mdw-designer by CenturyLinkCloud.
the class ImportProjectSelectPage method initialize.
/**
* Populate the table based on the imported data.
*/
public void initialize() {
List<DefaultRowImpl> tableRows = new ArrayList<>();
List<WorkflowProject> projectsToImport = new ArrayList<>();
for (WorkflowProject workflowProject : getProjectList()) {
IProject existing = MdwPlugin.getWorkspaceRoot().getProject(workflowProject.getName());
String[] rowData = new String[3];
rowData[0] = "true";
rowData[1] = workflowProject.getName();
rowData[2] = "";
if (existing != null && existing.exists()) {
rowData[0] = "false";
if (existing.isOpen())
rowData[2] = "Already exists in workspace";
else
rowData[2] = "Closed project exists in workspace";
} else if (workflowProject.getMdwDataSource().getJdbcUrl() == null) {
rowData[0] = "false";
rowData[2] = "Missing JDBC URL";
} else {
projectsToImport.add(workflowProject);
}
DefaultRowImpl row = projectTableEditor.new DefaultRowImpl(rowData);
tableRows.add(row);
}
projectTableEditor.setValue(tableRows);
setProjectsToImport(projectsToImport);
handleFieldChanged();
}
Aggregations