Search in sources :

Example 6 with ColumnSpec

use of com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec in project mdw-designer by CenturyLinkCloud.

the class ProcessInstanceListView method createColumnSpecs.

private List<ColumnSpec> createColumnSpecs() {
    List<ColumnSpec> colSpecs = new ArrayList<>();
    ColumnSpec processInstColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Instance ID", "id");
    processInstColSpec.width = 100;
    colSpecs.add(processInstColSpec);
    ColumnSpec masterRequestColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Master Request ID", "masterRequestId");
    masterRequestColSpec.width = 180;
    colSpecs.add(masterRequestColSpec);
    ColumnSpec ownerColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Owner", "owner");
    ownerColSpec.width = 100;
    colSpecs.add(ownerColSpec);
    ColumnSpec ownerIdColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Owner ID", "ownerId");
    ownerIdColSpec.width = 100;
    colSpecs.add(ownerIdColSpec);
    ColumnSpec statusColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Status", "statusCode");
    statusColSpec.width = 100;
    colSpecs.add(statusColSpec);
    ColumnSpec startDateColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Start", "startDate");
    startDateColSpec.width = 150;
    colSpecs.add(startDateColSpec);
    ColumnSpec endDateColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "End", "endDate");
    endDateColSpec.width = 150;
    colSpecs.add(endDateColSpec);
    columnProps = new String[colSpecs.size()];
    for (int i = 0; i < colSpecs.size(); i++) {
        columnProps[i] = colSpecs.get(i).property;
    }
    return colSpecs;
}
Also used : ColumnSpec(com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec) ArrayList(java.util.ArrayList)

Example 7 with ColumnSpec

use of com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec in project mdw-designer by CenturyLinkCloud.

the class ExtensionModulesTable method create.

public TableEditor create() {
    tableEditor = new TableEditor(null, TableEditor.TYPE_TABLE);
    // colspecs
    List<ColumnSpec> colSpecs = new ArrayList<ColumnSpec>();
    ColumnSpec selectionColSpec = new ColumnSpec(PropertyEditor.TYPE_CHECKBOX, "", "import");
    selectionColSpec.width = 80;
    colSpecs.add(selectionColSpec);
    ColumnSpec extensionColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Extension", "extension");
    extensionColSpec.width = 150;
    extensionColSpec.readOnly = true;
    colSpecs.add(extensionColSpec);
    ColumnSpec descriptionColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Description", "description");
    descriptionColSpec.readOnly = true;
    descriptionColSpec.width = 350;
    colSpecs.add(descriptionColSpec);
    tableEditor.setColumnSpecs(colSpecs);
    tableEditor.setFillWidth(true);
    tableEditor.setModelUpdater(new TableModelUpdater() {

        public Object create() {
            return null;
        }

        @SuppressWarnings("rawtypes")
        public void updateModelValue(List tableValue) {
            selectedModules = new ArrayList<ExtensionModule>();
            for (ExtensionModule module : WorkflowProjectManager.getInstance().getAvailableExtensions(workflowProject)) {
                for (Object rowObj : tableValue) {
                    DefaultRowImpl row = (DefaultRowImpl) rowObj;
                    if (module.getName().equals(row.getColumnValue(1))) {
                        if (((Boolean) row.getColumnValue(0)).booleanValue())
                            selectedModules.add(module);
                        else
                            selectedModules.remove(module);
                    }
                }
            }
        }
    });
    return tableEditor;
}
Also used : DefaultRowImpl(com.centurylink.mdw.plugin.designer.properties.editor.TableEditor.DefaultRowImpl) ColumnSpec(com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec) TableModelUpdater(com.centurylink.mdw.plugin.designer.properties.editor.TableEditor.TableModelUpdater) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) TableEditor(com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)

Example 8 with ColumnSpec

use of com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec in project mdw-designer by CenturyLinkCloud.

the class LoadTestLaunchTab method createColumnSpecs.

protected void createColumnSpecs() {
    super.createColumnSpecs();
    ColumnSpec testCaseRunColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Count", "count");
    testCaseRunColSpec.width = 50;
    testCaseRunColSpec.readOnly = false;
    testCasesColumnSpecs.add(testCaseRunColSpec);
    testCasesColumnProps = new String[testCasesColumnSpecs.size()];
    for (int i = 0; i < testCasesColumnSpecs.size(); i++) {
        testCasesColumnProps[i] = testCasesColumnSpecs.get(i).property;
    }
}
Also used : ColumnSpec(com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec)

Example 9 with ColumnSpec

use of com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec in project mdw-designer by CenturyLinkCloud.

the class TestSuiteLaunchTab method createColumnSpecs.

protected void createColumnSpecs() {
    testCasesColumnSpecs = new ArrayList<ColumnSpec>();
    ColumnSpec selectionColSpec = new ColumnSpec(PropertyEditor.TYPE_CHECKBOX, "", "run");
    selectionColSpec.width = 28;
    testCasesColumnSpecs.add(selectionColSpec);
    ColumnSpec testCaseColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Test Case", "testCase");
    testCaseColSpec.width = 500;
    testCaseColSpec.readOnly = true;
    testCasesColumnSpecs.add(testCaseColSpec);
    testCasesColumnProps = new String[testCasesColumnSpecs.size()];
    for (int i = 0; i < testCasesColumnSpecs.size(); i++) testCasesColumnProps[i] = testCasesColumnSpecs.get(i).property;
}
Also used : ColumnSpec(com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec)

Example 10 with ColumnSpec

use of com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec in project mdw-designer by CenturyLinkCloud.

the class TestSuiteLaunchTab method createTableViewer.

protected void createTableViewer() {
    testCasesTableViewer = new TableViewer(testCasesTable);
    testCasesTableViewer.setUseHashlookup(true);
    testCasesTableViewer.setColumnProperties(testCasesColumnProps);
    CellEditor[] editors = new CellEditor[testCasesColumnSpecs.size()];
    for (int i = 0; i < testCasesColumnSpecs.size(); i++) {
        ColumnSpec colSpec = testCasesColumnSpecs.get(i);
        CellEditor cellEditor = null;
        if (colSpec.type.equals(PropertyEditor.TYPE_TEXT)) {
            cellEditor = new TextCellEditor(testCasesTable);
        } else if (colSpec.type.equals(PropertyEditor.TYPE_CHECKBOX)) {
            cellEditor = new CheckboxCellEditor(testCasesTable);
        }
        editors[i] = cellEditor;
    }
    testCasesTableViewer.setCellEditors(editors);
    testCasesTableViewer.setCellModifier(new TestCaseCellModifier());
    testCasesTableViewer.setLabelProvider(new TestCaseLabelProvider());
    testCasesTableViewer.setContentProvider(new TestCaseContentProvider());
}
Also used : ColumnSpec(com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec) CheckboxCellEditor(org.eclipse.jface.viewers.CheckboxCellEditor) CellEditor(org.eclipse.jface.viewers.CellEditor) CheckboxCellEditor(org.eclipse.jface.viewers.CheckboxCellEditor) TextCellEditor(org.eclipse.jface.viewers.TextCellEditor) TextCellEditor(org.eclipse.jface.viewers.TextCellEditor) TableViewer(org.eclipse.jface.viewers.TableViewer)

Aggregations

ColumnSpec (com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec)36 ArrayList (java.util.ArrayList)22 TableEditor (com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)9 SelectionEvent (org.eclipse.swt.events.SelectionEvent)6 GridData (org.eclipse.swt.layout.GridData)6 CellEditor (org.eclipse.jface.viewers.CellEditor)5 Table (org.eclipse.swt.widgets.Table)5 TableColumn (org.eclipse.swt.widgets.TableColumn)5 List (java.util.List)4 TableViewer (org.eclipse.jface.viewers.TableViewer)4 TextCellEditor (org.eclipse.jface.viewers.TextCellEditor)4 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)4 Event (org.eclipse.swt.widgets.Event)4 Listener (org.eclipse.swt.widgets.Listener)4 DefaultRowImpl (com.centurylink.mdw.plugin.designer.properties.editor.TableEditor.DefaultRowImpl)3 TableModelUpdater (com.centurylink.mdw.plugin.designer.properties.editor.TableEditor.TableModelUpdater)3 ValueChangeListener (com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener)3 ControlAdapter (org.eclipse.swt.events.ControlAdapter)3 ControlEvent (org.eclipse.swt.events.ControlEvent)3 ElementChangeEvent (com.centurylink.mdw.plugin.designer.model.ElementChangeEvent)2