Search in sources :

Example 26 with ColumnSpec

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;
}
Also used : ColumnSpec(com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec) ArrayList(java.util.ArrayList) TableEditor(com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)

Example 27 with ColumnSpec

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;
}
Also used : Table(org.eclipse.swt.widgets.Table) ColumnSpec(com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec) GridData(org.eclipse.swt.layout.GridData) TableColumn(org.eclipse.swt.widgets.TableColumn)

Example 28 with ColumnSpec

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);
}
Also used : ColumnSpec(com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec) PropertyGroup(com.centurylink.mdw.bpm.PropertyGroupDocument.PropertyGroup) ArrayList(java.util.ArrayList) Comparator(java.util.Comparator)

Example 29 with ColumnSpec

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;
}
Also used : ColumnSpec(com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec) ArrayList(java.util.ArrayList)

Example 30 with ColumnSpec

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;
}
Also used : ColumnSpec(com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec) ArrayList(java.util.ArrayList)

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