Search in sources :

Example 1 with ColumnSpec

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

the class OsgiAdapterDesignSection method getInputTableColumns.

private List<ColumnSpec> getInputTableColumns() {
    List<ColumnSpec> columnSpecs = new ArrayList<ColumnSpec>();
    ColumnSpec paramColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Name", "name");
    paramColSpec.readOnly = true;
    paramColSpec.width = 300;
    columnSpecs.add(paramColSpec);
    ColumnSpec valueColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Value", "value");
    valueColSpec.width = 300;
    columnSpecs.add(valueColSpec);
    return columnSpecs;
}
Also used : ColumnSpec(com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec) ArrayList(java.util.ArrayList)

Example 2 with ColumnSpec

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

the class PackageConfigurationSection method createTableViewer.

private TableViewer createTableViewer(Table table) {
    TableViewer tblViewer = new TableViewer(table);
    tblViewer.setUseHashlookup(true);
    String[] columnProps = new String[columnSpecs.size()];
    for (int i = 0; i < columnSpecs.size(); i++) columnProps[i] = columnSpecs.get(i).property;
    tblViewer.setColumnProperties(columnProps);
    CellEditor[] cellEditors = new CellEditor[columnSpecs.size()];
    for (int i = 0; i < columnSpecs.size(); i++) {
        ColumnSpec colSpec = columnSpecs.get(i);
        CellEditor cellEditor = null;
        if (colSpec.style != 0)
            cellEditor = new TextCellEditor(table, colSpec.style);
        else
            cellEditor = new TextCellEditor(table);
        if (colSpec.listener != null)
            cellEditor.addListener(colSpec.listener);
        cellEditors[i] = cellEditor;
        tblViewer.setCellEditors(cellEditors);
        tblViewer.setCellModifier(new PackageConfigCellModifier());
    }
    return tblViewer;
}
Also used : ColumnSpec(com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec) CellEditor(org.eclipse.jface.viewers.CellEditor) TextCellEditor(org.eclipse.jface.viewers.TextCellEditor) TextCellEditor(org.eclipse.jface.viewers.TextCellEditor) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 3 with ColumnSpec

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

the class ProcessVersionsSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    process = (WorkflowProcess) selection;
    tableEditor = new TableEditor(process, TableEditor.TYPE_TABLE);
    List<ColumnSpec> columnSpecs = new ArrayList<ColumnSpec>();
    ColumnSpec packageColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Package", "package");
    packageColSpec.width = 160;
    columnSpecs.add(packageColSpec);
    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 = 65;
    columnSpecs.add(idColSpec);
    ColumnSpec createDateColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Created", "createDate");
    createDateColSpec.width = 110;
    columnSpecs.add(createDateColSpec);
    ColumnSpec userColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "User", "user");
    userColSpec.width = 75;
    columnSpecs.add(userColSpec);
    ColumnSpec commentsColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Comments", "comments");
    commentsColSpec.width = 200;
    columnSpecs.add(commentsColSpec);
    ColumnSpec lockedToColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Locked To", "lockedTo");
    lockedToColSpec.width = 75;
    columnSpecs.add(lockedToColSpec);
    ColumnSpec modDateColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Last Modified", "modDate");
    modDateColSpec.width = 110;
    columnSpecs.add(modDateColSpec);
    tableEditor.setColumnSpecs(columnSpecs);
    tableEditor.setReadOnly(true);
    tableEditor.setContentProvider(new ProcessVersionContentProvider());
    tableEditor.setLabelProvider(new ProcessVersionLabelProvider());
    tableEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            openProcess((WorkflowProcess) newValue);
        }
    });
    tableEditor.render(composite);
    // right-click menu
    tableEditor.getTable().addListener(SWT.MenuDetect, new Listener() {

        public void handleEvent(Event event) {
            tableEditor.getTable().setMenu(createContextMenu(tableEditor.getTable().getShell()));
        }
    });
}
Also used : ColumnSpec(com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) Listener(org.eclipse.swt.widgets.Listener) ElementChangeListener(com.centurylink.mdw.plugin.designer.model.ElementChangeListener) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) ArrayList(java.util.ArrayList) Event(org.eclipse.swt.widgets.Event) ElementChangeEvent(com.centurylink.mdw.plugin.designer.model.ElementChangeEvent) SelectionEvent(org.eclipse.swt.events.SelectionEvent) TableEditor(com.centurylink.mdw.plugin.designer.properties.editor.TableEditor) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess)

Example 4 with ColumnSpec

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

the class SubTaskInstancesSection method createColumnSpecs.

@Override
protected List<ColumnSpec> createColumnSpecs() {
    List<ColumnSpec> columnSpecs = super.createColumnSpecs();
    ColumnSpec masterInstColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Master Task Inst.", "masterInstanceId");
    masterInstColSpec.width = 100;
    columnSpecs.add(0, masterInstColSpec);
    return columnSpecs;
}
Also used : ColumnSpec(com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec)

Example 5 with ColumnSpec

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

the class TaskInstancesSection method createColumnSpecs.

protected List<ColumnSpec> createColumnSpecs() {
    List<ColumnSpec> columnSpecs = new ArrayList<ColumnSpec>();
    ColumnSpec instanceIdColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Task Instance ID", "instanceId");
    instanceIdColSpec.width = 100;
    columnSpecs.add(instanceIdColSpec);
    ColumnSpec taskNameColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Name", "name");
    taskNameColSpec.width = 150;
    columnSpecs.add(taskNameColSpec);
    ColumnSpec taskIdColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Task Def. ID", "taskId");
    taskIdColSpec.width = 100;
    columnSpecs.add(taskIdColSpec);
    ColumnSpec statusColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Status", "status");
    statusColSpec.width = 100;
    columnSpecs.add(statusColSpec);
    ColumnSpec assigneeColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Assignee", "assignee");
    assigneeColSpec.width = 100;
    columnSpecs.add(assigneeColSpec);
    ColumnSpec workgroupsColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Workgroup(s)", "workgroups");
    workgroupsColSpec.width = 150;
    columnSpecs.add(workgroupsColSpec);
    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