Search in sources :

Example 1 with OptionT

use of noNamespace.OptionT in project mdw-designer by CenturyLinkCloud.

the class BamEventComposer method createBamDataTable.

private void createBamDataTable() {
    if (attributesTableContainer != null) {
        if (dataTableDirtyStateListener != null)
            attributesTableContainer.removeDirtyStateListener(dataTableDirtyStateListener);
        attributesTableContainer.dispose();
    }
    // attributes
    TableT bamTable = null;
    if (bamPagelet != null) {
        try {
            bamTable = getBamPageletTable();
        } catch (BamPageletValidationException ex) {
            PluginMessages.uiError(ex, "BAM Pagelet");
        }
    }
    String label;
    if (bamTable != null && (bamTable.getNAME() != null || bamTable.getLABEL() != null)) {
        label = bamTable.getLABEL() == null ? bamTable.getNAME() : bamTable.getLABEL();
        bamTable.setLABEL(label);
        for (DropdownT dropdown : bamTable.getDROPDOWNList()) {
            if ("Variables".equalsIgnoreCase(dropdown.getSOURCE())) {
                WorkflowProcess processVersion = getProcess();
                if (processVersion != null) {
                    List<String> varNames = processVersion.getNonDocRefVariableNames();
                    // add process variable values
                    for (String var : varNames) {
                        OptionT option = dropdown.addNewOPTION();
                        option.setVALUE("#{" + var + "}");
                        option.setStringValue(var);
                    }
                }
            }
        }
    }
    attributesTableContainer = createAttributesTable(getWidth(), LAYOUT_COLS, bamTable);
    dataTableDirtyStateListener = new DirtyStateListener() {

        public void dirtyStateChanged(boolean dirty) {
            if (bamMessage != null) {
                bamMessage.setAttributes(attributesTableContainer.getAttributes());
                Event event = new Event();
                event.widget = attributesTableContainer.tableEditor.getTable();
                event.data = attributesTableContainer.getAttributes();
                fireModify(new ModifyEvent(event));
            }
        }
    };
    attributesTableContainer.addDirtyStateListener(dataTableDirtyStateListener);
    this.layout(true);
}
Also used : OptionT(noNamespace.OptionT) DirtyStateListener(com.centurylink.mdw.plugin.designer.DirtyStateListener) ModifyEvent(org.eclipse.swt.events.ModifyEvent) DropdownT(noNamespace.DropdownT) Event(org.eclipse.swt.widgets.Event) ModifyEvent(org.eclipse.swt.events.ModifyEvent) SelectionEvent(org.eclipse.swt.events.SelectionEvent) TableT(noNamespace.TableT) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess)

Aggregations

DirtyStateListener (com.centurylink.mdw.plugin.designer.DirtyStateListener)1 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)1 DropdownT (noNamespace.DropdownT)1 OptionT (noNamespace.OptionT)1 TableT (noNamespace.TableT)1 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 Event (org.eclipse.swt.widgets.Event)1