Search in sources :

Example 1 with TableEditor

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

the class OsgiAdapterDesignSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    activity = (Activity) selection;
    interfaceSelector = new WorkflowAssetEditor(activity, WorkAttributeConstant.SERVICE_INTERFACE, getAssetTypes());
    interfaceSelector.setLabel("Service Interface");
    interfaceSelector.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            activity.setAttribute(WorkAttributeConstant.SERVICE_INTERFACE, (String) newValue);
            methodDropdown.setValueOptions(getServiceMethodOptions());
        }
    });
    interfaceSelector.render(composite);
    methodDropdown = new PropertyEditor(activity, PropertyEditor.TYPE_COMBO);
    methodDropdown.setLabel("Method");
    methodDropdown.setWidth(277);
    methodDropdown.setValueOptions(getServiceMethodOptions());
    methodDropdown.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            activity.setAttribute(WorkAttributeConstant.SERVICE_METHOD, (String) newValue);
            paramsTable.setValue(getParamsTableValue());
        }
    });
    methodDropdown.render(composite);
    resultDropdown = new PropertyEditor(activity, PropertyEditor.TYPE_COMBO);
    resultDropdown.setLabel("Result Variable");
    resultDropdown.setWidth(277);
    resultDropdown.setValueOptions(getResultVariableOptions());
    resultDropdown.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            activity.setAttribute(WorkAttributeConstant.SERVICE_RESULT, (String) newValue);
        }
    });
    resultDropdown.render(composite);
    paramsTable = new TableEditor(activity, TableEditor.TYPE_TABLE);
    paramsTable.setColumnSpecs(getInputTableColumns());
    paramsTable.setColumnDelimiter('=');
    paramsTable.setLabel("Parameters");
    paramsTable.setAttributeName(WorkAttributeConstant.SERVICE_PARAMETERS);
    paramsTable.setHorizontalSpan(3);
    paramsTable.render(composite, false);
    helpLink = new PropertyEditor(activity, PropertyEditor.TYPE_LINK);
    helpLink.setLabel("OSGi Service Adapter Help");
    helpLink.render(composite);
}
Also used : WorkflowAssetEditor(com.centurylink.mdw.plugin.designer.properties.editor.WorkflowAssetEditor) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor) TableEditor(com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)

Example 2 with TableEditor

use of com.centurylink.mdw.plugin.designer.properties.editor.TableEditor 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 3 with TableEditor

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

the class SimulationSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    activity = (Activity) selection;
    if (responseListTableEditor == null)
        responseListTableEditor = new TableEditor(activity, TableEditor.TYPE_TABLE);
    if (columnSpecs == null)
        columnSpecs = createColumnSpecs();
    responseListTableEditor.setColumnSpecs(columnSpecs);
    if (contentProvider == null)
        contentProvider = new SimulationContentProvider();
    if (labelProvider == null)
        labelProvider = new SimulationLabelProvider();
    if (cellModifier == null)
        cellModifier = new SimulationCellModifier();
    if (modelUpdater == null)
        modelUpdater = new SimulationModelUpdater();
    // simulation radio button
    simPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_RADIO);
    simPropertyEditor.setLabel("Simulation Mode");
    simPropertyEditor.setWidth(85);
    ArrayList<String> simOpts = new ArrayList<String>();
    simOpts.add("On");
    simOpts.add("Off");
    simPropertyEditor.setValueOptions(simOpts);
    simPropertyEditor.setDefaultValue("Off");
    simPropertyEditor.setFireDirtyStateChange(false);
    simPropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            activity.setAttribute(WorkAttributeConstant.SIMULATION_STUB_MODE, (String) newValue);
            setDirty(true);
        }
    });
    simPropertyEditor.render(composite);
    // response table
    responseListTableEditor.setWidth(500);
    responseListTableEditor.setHeight(100);
    responseListTableEditor.setFillWidth(true);
    responseListTableEditor.setReadOnly(false);
    responseListTableEditor.setFireDirtyStateChange(false);
    responseListTableEditor.setContentProvider(contentProvider);
    responseListTableEditor.setLabelProvider(labelProvider);
    responseListTableEditor.setModelUpdater(modelUpdater);
    responseListTableEditor.setCellModifier(cellModifier);
    responseListTableEditor.setLabel("Responses");
    responseListTableEditor.render(composite);
    responseListTableEditor.getTable().addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            SimulationResponseVO response = (SimulationResponseVO) e.item.getData();
            String responseString = response == null ? null : response.getResponse();
            ValueDisplayDialog dlg = new ValueDisplayDialog(getShell(), responseString);
            dlg.open();
        }
    });
    // save button
    createSaveButton();
    // help link
    // spacer
    new Label(composite, SWT.NONE);
    helpPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_LINK);
    helpPropertyEditor.setLabel("Simulation Mode Help");
    helpPropertyEditor.render(composite);
    helpPropertyEditor.setValue("/MDWHub/doc/todo.html");
}
Also used : ValueDisplayDialog(com.centurylink.mdw.plugin.designer.dialogs.ValueDisplayDialog) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) ArrayList(java.util.ArrayList) Label(org.eclipse.swt.widgets.Label) TableEditor(com.centurylink.mdw.plugin.designer.properties.editor.TableEditor) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) SelectionEvent(org.eclipse.swt.events.SelectionEvent) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 4 with TableEditor

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

the class ActivityInstanceSection method drawWidgets.

@Override
public void drawWidgets(Composite composite, WorkflowElement selection) {
    activity = (Activity) selection;
    tableEditor = new TableEditor(activity, TableEditor.TYPE_TABLE);
    tableEditor.setReadOnly(true);
    if (columnSpecs == null)
        columnSpecs = createColumnSpecs();
    tableEditor.setColumnSpecs(columnSpecs);
    if (contentProvider == null)
        contentProvider = new ActivityInstanceContentProvider();
    tableEditor.setContentProvider(contentProvider);
    if (labelProvider == null)
        labelProvider = new ActivityInstanceLabelProvider();
    tableEditor.setLabelProvider(labelProvider);
    tableEditor.render(composite);
    // double-click
    tableEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            new ActivityInstanceDialog(getShell(), activity, (ActivityInstanceVO) newValue, Mode.VIEW).open();
        }
    });
    // right-click menu
    tableEditor.getTable().addListener(SWT.MenuDetect, new Listener() {

        public void handleEvent(Event event) {
            tableEditor.getTable().setMenu(createContextMenu(getShell()));
        }
    });
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) Listener(org.eclipse.swt.widgets.Listener) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) ActivityInstanceDialog(com.centurylink.mdw.plugin.designer.dialogs.ActivityInstanceDialog) Event(org.eclipse.swt.widgets.Event) SelectionEvent(org.eclipse.swt.events.SelectionEvent) TableEditor(com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)

Example 5 with TableEditor

use of com.centurylink.mdw.plugin.designer.properties.editor.TableEditor 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)

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