Search in sources :

Example 1 with DropdownT

use of noNamespace.DropdownT 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)

Example 2 with DropdownT

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

the class AttributesTableContainer method setEditable.

public void setEditable(boolean editable) {
    boolean lEditable = editable;
    // need values to select
    WidgetT valueWidget = getValueWidget(pageletTable);
    if (valueWidget instanceof DropdownT) {
        DropdownT dropdown = (DropdownT) valueWidget;
        if (dropdown.getOPTIONList().isEmpty())
            lEditable = false;
    }
    tableEditor.setEditable(lEditable);
}
Also used : DropdownT(noNamespace.DropdownT) WidgetT(noNamespace.WidgetT)

Aggregations

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