Search in sources :

Example 6 with TableEditor

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

the class TransitionInstanceSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    transition = (Transition) selection;
    tableEditor = new TableEditor(transition, TableEditor.TYPE_TABLE);
    tableEditor.setReadOnly(true);
    if (columnSpecs == null)
        columnSpecs = createColumnSpecs();
    tableEditor.setColumnSpecs(columnSpecs);
    if (contentProvider == null)
        contentProvider = new TransitionInstanceContentProvider();
    tableEditor.setContentProvider(contentProvider);
    if (labelProvider == null)
        labelProvider = new TransitionInstanceLabelProvider();
    tableEditor.setLabelProvider(labelProvider);
    tableEditor.render(composite);
}
Also used : TableEditor(com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)

Example 7 with TableEditor

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

the class PreferencesSection method createNoticesTable.

private void createNoticesTable() {
    noticesEditor = new TableEditor(null, TableEditor.TYPE_TABLE);
    noticesEditor.setLabel("Desktop Notices");
    // colspecs
    List<ColumnSpec> colSpecs = new ArrayList<ColumnSpec>();
    ColumnSpec selectionColSpec = new ColumnSpec(PropertyEditor.TYPE_CHECKBOX, "", "selected");
    selectionColSpec.width = 50;
    colSpecs.add(selectionColSpec);
    ColumnSpec extensionColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Task Outcome", "outcome");
    extensionColSpec.width = 150;
    extensionColSpec.readOnly = true;
    colSpecs.add(extensionColSpec);
    noticesEditor.setColumnSpecs(colSpecs);
    noticesEditor.setHorizontalSpan(3);
    noticesEditor.setWidth(300);
    noticesEditor.setModelUpdater(new TableModelUpdater() {

        public Object create() {
            return null;
        }

        @SuppressWarnings("rawtypes")
        public void updateModelValue(List tableValue) {
            List<String> selectedNotices = new ArrayList<String>();
            for (Action outcome : UserActionVO.NOTIFIABLE_TASK_ACTIONS) {
                for (Object rowObj : tableValue) {
                    DefaultRowImpl row = (DefaultRowImpl) rowObj;
                    if (outcome.toString().equals(row.getColumnValue(1))) {
                        if (((Boolean) row.getColumnValue(0)).booleanValue())
                            selectedNotices.add(outcome.toString());
                        else
                            selectedNotices.remove(outcome.toString());
                    }
                }
            }
            project.setNoticeChecks(selectedNotices);
        }
    });
}
Also used : Action(com.centurylink.mdw.model.value.user.UserActionVO.Action) 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) ArrayList(java.util.ArrayList) List(java.util.List) TableEditor(com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)

Example 8 with TableEditor

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

the class VariableInstancesSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    process = (WorkflowProcess) selection;
    tableEditor = new TableEditor(process, TableEditor.TYPE_TABLE);
    tableEditor.setReadOnly(true);
    tableEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            openDialog((VariableInstanceInfo) newValue);
        }
    });
    if (columnSpecs == null)
        columnSpecs = createColumnSpecs();
    tableEditor.setColumnSpecs(columnSpecs);
    if (contentProvider == null)
        contentProvider = new VariableInstanceContentProvider();
    tableEditor.setContentProvider(contentProvider);
    if (labelProvider == null)
        labelProvider = new VariableInstanceLabelProvider();
    tableEditor.setLabelProvider(labelProvider);
    tableEditor.render(composite);
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) VariableInstanceInfo(com.centurylink.mdw.model.value.variable.VariableInstanceInfo) TableEditor(com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)

Example 9 with TableEditor

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

the class WorkflowAssetVersionsSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    workflowAsset = (WorkflowAsset) selection;
    tableEditor = new TableEditor(workflowAsset, 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.setFillWidth(true);
    tableEditor.setReadOnly(true);
    tableEditor.setContentProvider(new AssetVersionContentProvider());
    tableEditor.setLabelProvider(new AssetVersionLabelProvider());
    tableEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            openAsset((WorkflowAsset) 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) WorkflowAsset(com.centurylink.mdw.plugin.designer.model.WorkflowAsset) 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)

Example 10 with TableEditor

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

the class PackageVersionsSection method drawWidgets.

@Override
public void drawWidgets(Composite composite, WorkflowElement selection) {
    workflowPackage = (WorkflowPackage) selection;
    tableEditor = new TableEditor(workflowPackage, TableEditor.TYPE_TABLE);
    List<ColumnSpec> columnSpecs = new ArrayList<>();
    ColumnSpec projectColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Project", "project");
    projectColSpec.width = 200;
    columnSpecs.add(projectColSpec);
    ColumnSpec versionColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Version", "version");
    versionColSpec.width = 80;
    columnSpecs.add(versionColSpec);
    ColumnSpec tagsColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Tags", "tags");
    tagsColSpec.width = 150;
    columnSpecs.add(tagsColSpec);
    ColumnSpec idColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Package ID", "id");
    idColSpec.width = 100;
    columnSpecs.add(idColSpec);
    ColumnSpec lastModColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Last Modified", "lastModified");
    lastModColSpec.width = 120;
    columnSpecs.add(lastModColSpec);
    ColumnSpec packageColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Notes", "archived");
    packageColSpec.width = 150;
    columnSpecs.add(packageColSpec);
    tableEditor.setColumnSpecs(columnSpecs);
    tableEditor.setReadOnly(true);
    tableEditor.setContentProvider(new PackageVersionContentProvider());
    tableEditor.setLabelProvider(new PackageVersionLabelProvider());
    tableEditor.render(composite);
}
Also used : ColumnSpec(com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec) ArrayList(java.util.ArrayList) TableEditor(com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)

Aggregations

TableEditor (com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)18 ArrayList (java.util.ArrayList)10 ColumnSpec (com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec)9 ValueChangeListener (com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener)9 SelectionEvent (org.eclipse.swt.events.SelectionEvent)7 PropertyEditor (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)5 Event (org.eclipse.swt.widgets.Event)5 Listener (org.eclipse.swt.widgets.Listener)5 DefaultRowImpl (com.centurylink.mdw.plugin.designer.properties.editor.TableEditor.DefaultRowImpl)4 List (java.util.List)4 TableModelUpdater (com.centurylink.mdw.plugin.designer.properties.editor.TableEditor.TableModelUpdater)3 ElementChangeEvent (com.centurylink.mdw.plugin.designer.model.ElementChangeEvent)2 ElementChangeListener (com.centurylink.mdw.plugin.designer.model.ElementChangeListener)2 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2 GridData (org.eclipse.swt.layout.GridData)2 Button (org.eclipse.swt.widgets.Button)2 Composite (org.eclipse.swt.widgets.Composite)2 Label (org.eclipse.swt.widgets.Label)2 AttributeVO (com.centurylink.mdw.model.value.attribute.AttributeVO)1 TaskInstanceVO (com.centurylink.mdw.model.value.task.TaskInstanceVO)1