Search in sources :

Example 1 with ExtensionModulesTable

use of com.centurylink.mdw.plugin.project.extensions.ExtensionModulesTable in project mdw-designer by CenturyLinkCloud.

the class ExtensionModulesWizardPage method drawWidgets.

/**
 * draw the widgets using a grid layout
 *
 * @param parent
 *            - the parent composite
 */
public void drawWidgets(Composite parent) {
    // create the composite to hold the widgets
    Composite composite = new Composite(parent, SWT.NULL);
    // create the layout for this wizard page
    GridLayout gl = new GridLayout();
    int ncol = 4;
    gl.numColumns = ncol;
    composite.setLayout(gl);
    extensionsTable = new ExtensionModulesTable(getProject());
    extensionsTable.create();
    extensionsTable.getTableEditor().render(composite, false);
    extensionsTable.setSelectedModules(new ArrayList<ExtensionModule>());
    extensionsTable.getTableEditor().addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            getProject().setExtensionModules(extensionsTable.getSelectedModules());
        }
    });
    setControl(composite);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) Composite(org.eclipse.swt.widgets.Composite) ExtensionModulesTable(com.centurylink.mdw.plugin.project.extensions.ExtensionModulesTable) ExtensionModule(com.centurylink.mdw.plugin.project.extensions.ExtensionModule)

Example 2 with ExtensionModulesTable

use of com.centurylink.mdw.plugin.project.extensions.ExtensionModulesTable in project mdw-designer by CenturyLinkCloud.

the class ExtensionModulesPropertyPage method createContents.

@Override
protected Control createContents(Composite parent) {
    noDefaultAndApplyButton();
    initializeWorkflowProject();
    Composite composite = createComposite(parent);
    extensionsTable = new ExtensionModulesTable(getProject());
    extensionsTable.create();
    extensionsTable.getTableEditor().render(composite, false);
    existingModules = getProject().getExtensionModules();
    List<ExtensionModule> selectedModules = new ArrayList<>();
    selectedModules.addAll(existingModules);
    extensionsTable.setSelectedModules(selectedModules);
    return composite;
}
Also used : Composite(org.eclipse.swt.widgets.Composite) ExtensionModulesTable(com.centurylink.mdw.plugin.project.extensions.ExtensionModulesTable) ExtensionModule(com.centurylink.mdw.plugin.project.extensions.ExtensionModule) ArrayList(java.util.ArrayList)

Aggregations

ExtensionModule (com.centurylink.mdw.plugin.project.extensions.ExtensionModule)2 ExtensionModulesTable (com.centurylink.mdw.plugin.project.extensions.ExtensionModulesTable)2 Composite (org.eclipse.swt.widgets.Composite)2 ValueChangeListener (com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener)1 ArrayList (java.util.ArrayList)1 GridLayout (org.eclipse.swt.layout.GridLayout)1