Search in sources :

Example 31 with ValueChangeListener

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

the class PackageSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    workflowPackage = (WorkflowPackage) selection;
    // id text field
    idPropertyEditor = new PropertyEditor(workflowPackage, PropertyEditor.TYPE_TEXT);
    idPropertyEditor.setLabel("ID");
    idPropertyEditor.setWidth(150);
    idPropertyEditor.setReadOnly(true);
    idPropertyEditor.render(composite);
    // name text field
    namePropertyEditor = new PropertyEditor(workflowPackage, PropertyEditor.TYPE_TEXT);
    namePropertyEditor.setLabel("Name");
    namePropertyEditor.setReadOnly(true);
    namePropertyEditor.render(composite);
    // schema version text field
    schemaVersionPropertyEditor = new PropertyEditor(workflowPackage, PropertyEditor.TYPE_TEXT);
    schemaVersionPropertyEditor.setLabel("Schema Version");
    schemaVersionPropertyEditor.setWidth(150);
    schemaVersionPropertyEditor.setReadOnly(true);
    schemaVersionPropertyEditor.render(composite);
    // last modified text field
    lastModifiedPropertyEditor = new PropertyEditor(workflowPackage, PropertyEditor.TYPE_TEXT);
    lastModifiedPropertyEditor.setLabel("Last Modified");
    lastModifiedPropertyEditor.setWidth(150);
    lastModifiedPropertyEditor.setReadOnly(true);
    lastModifiedPropertyEditor.setValueConverter(new DateConverter());
    lastModifiedPropertyEditor.render(composite);
    if (workflowPackage.getProject().isFilePersist()) {
        // metafile text field
        metaFilePropertyEditor = new PropertyEditor(workflowPackage, PropertyEditor.TYPE_TEXT);
        metaFilePropertyEditor.setLabel("Meta File");
        metaFilePropertyEditor.setWidth(150);
        metaFilePropertyEditor.setReadOnly(true);
        metaFilePropertyEditor.render(composite);
    } else {
        // exported text field
        exportedPropertyEditor = new PropertyEditor(workflowPackage, PropertyEditor.TYPE_TEXT);
        exportedPropertyEditor.setLabel("Exported");
        exportedPropertyEditor.setWidth(100);
        exportedPropertyEditor.setReadOnly(true);
        exportedPropertyEditor.render(composite);
    }
    groupPropertyEditor = new PropertyEditor(workflowPackage, PropertyEditor.TYPE_COMBO);
    groupPropertyEditor.setLabel("Workgroup");
    groupPropertyEditor.setWidth(300);
    groupPropertyEditor.setReadOnly(true);
    List<String> options = new ArrayList<String>();
    options.add("");
    options.addAll(getDesignerDataModel().getWorkgroupNames());
    groupPropertyEditor.setValueOptions(options);
    groupPropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            String group = newValue == null || newValue.toString().length() == 0 ? UserGroupVO.COMMON_GROUP : newValue.toString();
            workflowPackage.setGroup(group);
            dirty = true;
            saveGroupEditor.setEnabled(dirty);
        }
    });
    groupPropertyEditor.render(composite);
    saveGroupEditor = new PropertyEditor(workflowPackage, PropertyEditor.TYPE_BUTTON);
    saveGroupEditor.setLabel("Save");
    saveGroupEditor.setWidth(65);
    saveGroupEditor.setEnabled(dirty);
    saveGroupEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            savePackage();
        }
    });
    saveGroupEditor.render(composite);
}
Also used : DateConverter(com.centurylink.mdw.plugin.designer.properties.convert.DateConverter) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) ArrayList(java.util.ArrayList) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 32 with ValueChangeListener

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

the class ProjectConnectionsSettings method setSelection.

public void setSelection(WorkflowElement selection) {
    if (project != null)
        project.removeElementChangeListener(this);
    project = (WorkflowProject) selection;
    project.addElementChangeListener(this);
    if (javaOptionsTextField != null)
        javaOptionsTextField.dispose();
    if (debugModeCheckbox != null)
        debugModeCheckbox.dispose();
    if (debugPortTextField != null)
        debugPortTextField.dispose();
    if (debugSuspendCheckbox != null)
        debugSuspendCheckbox.dispose();
    if (separatorOne != null)
        separatorOne.dispose();
    if (logWatchHostTextField != null)
        logWatchHostTextField.dispose();
    if (logWatchPortTextField != null)
        logWatchPortTextField.dispose();
    if (logWatchTimeoutSpinner != null)
        logWatchTimeoutSpinner.dispose();
    if (separatorTwo != null)
        separatorTwo.dispose();
    if (stubServerHostTextField != null)
        stubServerHostTextField.dispose();
    if (stubServerPortTextField != null)
        stubServerPortTextField.dispose();
    if (stubServerTimeoutSpinner != null)
        stubServerTimeoutSpinner.dispose();
    if (!project.isRemote() && !project.isOsgi()) {
        javaOptionsTextField = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
        javaOptionsTextField.setLabel("Java Options");
        javaOptionsTextField.setWidth(400);
        javaOptionsTextField.addValueChangeListener(new ValueChangeListener() {

            public void propertyValueChanged(Object newValue) {
                String javaOptions = newValue == null ? null : String.valueOf(newValue);
                if (javaOptions != null && javaOptions.trim().length() == 0)
                    javaOptions = null;
                project.getServerSettings().setJavaOptions(javaOptions);
                saveProjectPrefs();
            }
        });
        javaOptionsTextField.render(composite);
        javaOptionsTextField.setValue(project.getServerSettings().getJavaOptions());
        javaOptionsTextField.setEditable(!project.isReadOnly());
        debugModeCheckbox = new PropertyEditor(project, PropertyEditor.TYPE_CHECKBOX);
        debugModeCheckbox.setLabel("Server Runner Debug");
        debugModeCheckbox.addValueChangeListener(new ValueChangeListener() {

            public void propertyValueChanged(Object newValue) {
                Boolean value = (Boolean) newValue;
                project.getServerSettings().setDebug(value);
                enableDebugControls(value);
                saveProjectPrefs();
            }
        });
        debugModeCheckbox.render(composite);
        debugModeCheckbox.setValue(project.getServerSettings().isDebug());
        debugModeCheckbox.setEditable(!project.isReadOnly());
        debugPortTextField = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
        debugPortTextField.setLabel("        Debug Port");
        debugPortTextField.setWidth(100);
        debugPortTextField.addValueChangeListener(new ValueChangeListener() {

            public void propertyValueChanged(Object newValue) {
                int port = Integer.parseInt(String.valueOf(newValue));
                project.getServerSettings().setDebugPort(port);
                saveProjectPrefs();
            }
        });
        debugPortTextField.render(composite);
        debugPortTextField.setValue(project.getServerSettings().getDebugPort());
        debugPortTextField.setEditable(!project.isReadOnly());
        debugSuspendCheckbox = new PropertyEditor(project, PropertyEditor.TYPE_CHECKBOX);
        debugSuspendCheckbox.setLabel("        Suspend");
        debugSuspendCheckbox.addValueChangeListener(new ValueChangeListener() {

            public void propertyValueChanged(Object newValue) {
                Boolean value = (Boolean) newValue;
                project.getServerSettings().setSuspend(value);
                saveProjectPrefs();
            }
        });
        debugSuspendCheckbox.render(composite);
        debugSuspendCheckbox.setValue(project.getServerSettings().isSuspend());
        debugSuspendCheckbox.setEditable(!project.isReadOnly());
        separatorOne = new PropertyEditor(project, PropertyEditor.TYPE_SEPARATOR);
        separatorOne.render(composite);
    }
    logWatchHostTextField = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
    logWatchHostTextField.setLabel("Log Watcher Host");
    logWatchHostTextField.setWidth(225);
    logWatchHostTextField.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            project.getServerSettings().setLogWatcherHost(String.valueOf(newValue));
            saveProjectPrefs();
        }
    });
    logWatchHostTextField.render(composite);
    logWatchHostTextField.setValue(project.getServerSettings().getLogWatcherHost());
    logWatchHostTextField.setEditable(false);
    logWatchPortTextField = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
    logWatchPortTextField.setLabel("        Port");
    logWatchPortTextField.setWidth(100);
    logWatchPortTextField.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            int port = Integer.parseInt(String.valueOf(newValue));
            project.getServerSettings().setLogWatcherPort(port);
            saveProjectPrefs();
        }
    });
    logWatchPortTextField.render(composite);
    logWatchPortTextField.setValue(project.getServerSettings().getLogWatcherPort());
    logWatchPortTextField.setEditable(!project.isReadOnly());
    logWatchTimeoutSpinner = new PropertyEditor(project, PropertyEditor.TYPE_SPINNER);
    logWatchTimeoutSpinner.setLabel("        Timeout");
    logWatchTimeoutSpinner.setWidth(50);
    logWatchTimeoutSpinner.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            int timeout = Integer.parseInt(String.valueOf(newValue));
            project.getServerSettings().setLogWatcherTimeout(timeout);
            saveProjectPrefs();
        }
    });
    logWatchTimeoutSpinner.render(composite);
    logWatchTimeoutSpinner.setValue(project.getServerSettings().getLogWatcherTimeout());
    logWatchTimeoutSpinner.setEditable(!project.isReadOnly());
    separatorTwo = new PropertyEditor(project, PropertyEditor.TYPE_SEPARATOR);
    separatorTwo.render(composite);
    stubServerHostTextField = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
    stubServerHostTextField.setLabel("Stub Server Host");
    stubServerHostTextField.setWidth(225);
    stubServerHostTextField.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            project.getServerSettings().setStubServerHost(String.valueOf(newValue));
            saveProjectPrefs();
        }
    });
    stubServerHostTextField.render(composite);
    stubServerHostTextField.setValue(project.getServerSettings().getStubServerHost());
    stubServerHostTextField.setEditable(false);
    stubServerPortTextField = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
    stubServerPortTextField.setLabel("        Port");
    stubServerPortTextField.setWidth(100);
    stubServerPortTextField.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            int port = Integer.parseInt(String.valueOf(newValue));
            project.getServerSettings().setStubServerPort(port);
            saveProjectPrefs();
        }
    });
    stubServerPortTextField.render(composite);
    stubServerPortTextField.setValue(project.getServerSettings().getStubServerPort());
    stubServerPortTextField.setEditable(!project.isReadOnly());
    stubServerTimeoutSpinner = new PropertyEditor(project, PropertyEditor.TYPE_SPINNER);
    stubServerTimeoutSpinner.setLabel("        Timeout");
    stubServerTimeoutSpinner.setWidth(50);
    stubServerTimeoutSpinner.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            int timeout = Integer.parseInt(String.valueOf(newValue));
            project.getServerSettings().setStubServerTimeout(timeout);
            saveProjectPrefs();
        }
    });
    stubServerTimeoutSpinner.render(composite);
    stubServerTimeoutSpinner.setValue(project.getServerSettings().getStubServerTimeout());
    stubServerTimeoutSpinner.setEditable(!project.isReadOnly());
    composite.layout(true);
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 33 with ValueChangeListener

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

the class ProjectPermissionsSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    project = (WorkflowProject) selection;
    // user text field
    userEditor = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
    userEditor.setLabel("Current User");
    userEditor.setWidth(150);
    userEditor.setReadOnly(true);
    userEditor.render(composite);
    // edit processes checkbox
    editProcessesEditor = new PropertyEditor(project, PropertyEditor.TYPE_CHECKBOX);
    editProcessesEditor.setLabel("Design/Edit Processes");
    editProcessesEditor.setReadOnly(true);
    editProcessesEditor.render(composite);
    // run processes checkbox
    runProcessesEditor = new PropertyEditor(project, PropertyEditor.TYPE_CHECKBOX);
    runProcessesEditor.setLabel("Execute Processes");
    runProcessesEditor.setReadOnly(true);
    runProcessesEditor.render(composite);
    // admin checkbox
    adminPermissionsEditor = new PropertyEditor(project, PropertyEditor.TYPE_CHECKBOX);
    adminPermissionsEditor.setLabel("Administrator Privileges");
    adminPermissionsEditor.setReadOnly(true);
    adminPermissionsEditor.render(composite);
    // sys admin checkbox
    sysAdminPermissionsEditor = new PropertyEditor(project, PropertyEditor.TYPE_CHECKBOX);
    sysAdminPermissionsEditor.setLabel("System Admin Privileges");
    sysAdminPermissionsEditor.setReadOnly(true);
    sysAdminPermissionsEditor.render(composite);
    // task manager link
    taskManagerLinkEditor = new PropertyEditor(project, PropertyEditor.TYPE_LINK);
    taskManagerLinkEditor.setLabel("Launch Task Manager to Change Role Assignments");
    taskManagerLinkEditor.setIndent(-100);
    taskManagerLinkEditor.setHeight(20);
    taskManagerLinkEditor.setWidth(500);
    taskManagerLinkEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            launchTaskManager();
        }
    });
    taskManagerLinkEditor.render(composite);
    // reload button
    reloadButtonEditor = new PropertyEditor(project, PropertyEditor.TYPE_BUTTON);
    reloadButtonEditor.setLabel("Reload");
    reloadButtonEditor.setIndent(-100);
    reloadButtonEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            reloadPermissions();
        }
    });
    reloadButtonEditor.render(composite);
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 34 with ValueChangeListener

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

the class ProjectVcsSection method setSelection.

public void setSelection(WorkflowElement selection) {
    if (project != null)
        project.removeElementChangeListener(this);
    project = (WorkflowProject) selection;
    project.addElementChangeListener(this);
    // dispose controls to render dynamically
    if (gitRepoUrlEditor != null)
        gitRepoUrlEditor.dispose();
    if (gitBranchEditor != null)
        gitBranchEditor.dispose();
    if (assetLocalPathEditor != null)
        assetLocalPathEditor.dispose();
    if (gitSyncEditor != null)
        gitSyncEditor.dispose();
    if (includeArchiveEditor != null)
        includeArchiveEditor.dispose();
    // repository url text field
    gitRepoUrlEditor = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
    gitRepoUrlEditor.setLabel("Git Repository URL");
    gitRepoUrlEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            project.getMdwVcsRepository().setRepositoryUrlWithCredentials(((String) newValue).trim());
            project.getMdwVcsRepository().setEntrySource("projectSection");
            WorkflowProjectManager.updateProject(project);
            project.fireElementChangeEvent(ChangeType.SETTINGS_CHANGE, project.getMdwVcsRepository());
        }
    });
    gitRepoUrlEditor.render(composite);
    gitRepoUrlEditor.setValue(project.getMdwVcsRepository().getRepositoryUrlWithMaskedCredentials());
    gitRepoUrlEditor.setEditable(!project.isReadOnly());
    // git branch text field
    gitBranchEditor = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
    gitBranchEditor.setLabel("Git Branch");
    gitBranchEditor.setWidth(200);
    gitBranchEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            project.getMdwVcsRepository().setBranch(((String) newValue).trim());
            project.getMdwVcsRepository().setEntrySource("projectSection");
            WorkflowProjectManager.updateProject(project);
            project.fireElementChangeEvent(ChangeType.SETTINGS_CHANGE, project.getMdwVcsRepository());
        }
    });
    gitBranchEditor.render(composite);
    gitBranchEditor.setValue(project.getMdwVcsRepository().getBranch());
    gitBranchEditor.setEditable(!project.isReadOnly());
    // asset local path text field
    assetLocalPathEditor = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
    assetLocalPathEditor.setLabel("Asset Local Path");
    assetLocalPathEditor.setWidth(200);
    assetLocalPathEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            project.getMdwVcsRepository().setLocalPath(((String) newValue).trim());
            project.getMdwVcsRepository().setEntrySource("projectSection");
            WorkflowProjectManager.updateProject(project);
            project.fireElementChangeEvent(ChangeType.SETTINGS_CHANGE, project.getMdwVcsRepository());
        }
    });
    assetLocalPathEditor.render(composite);
    assetLocalPathEditor.setValue(project.getMdwVcsRepository().getLocalPath());
    assetLocalPathEditor.setEditable(!project.isReadOnly());
    if (project.isRemote()) {
        if (project.isGitVcs()) {
            // for git: sync switch
            gitSyncEditor = new PropertyEditor(project, PropertyEditor.TYPE_SWITCH);
            gitSyncEditor.setLabel("");
            // gitSyncEditor.setComment("(Unlock to enable asset editing)");
            gitSyncEditor.addValueChangeListener(new ValueChangeListener() {

                public void propertyValueChanged(Object newValue) {
                    boolean unlocked = Boolean.parseBoolean(newValue.toString());
                    if (unlocked) {
                        WorkflowProjectManager.getInstance().makeLocal(project);
                        project.fireElementChangeEvent(ChangeType.SETTINGS_CHANGE, project.getMdwVcsRepository());
                        MessageDialog.openInformation(getShell(), "Remote Project Unlocked", project.getName() + " has been unlocked.  Please close any open assets and refresh.");
                    }
                }
            });
            gitSyncEditor.render(composite);
            SwitchButton switchBtn = (SwitchButton) gitSyncEditor.getWidget();
            switchBtn.setTextForSelect("Synced");
            switchBtn.setTextForUnselect("Unlocked");
            gitSyncEditor.setValue(false);
        }
        // include archive checkbox
        includeArchiveEditor = new PropertyEditor(project, PropertyEditor.TYPE_CHECKBOX);
        includeArchiveEditor.setLabel("Sync Asset Archive");
        includeArchiveEditor.addValueChangeListener(new ValueChangeListener() {

            public void propertyValueChanged(Object newValue) {
                project.getMdwVcsRepository().setSyncAssetArchive(Boolean.parseBoolean(newValue.toString()));
                WorkflowProjectManager.updateProject(project);
                project.fireElementChangeEvent(ChangeType.SETTINGS_CHANGE, project.getMdwVcsRepository());
            }
        });
        includeArchiveEditor.render(composite);
        includeArchiveEditor.setValue(project.getMdwVcsRepository().isSyncAssetArchive());
        includeArchiveEditor.setEditable(true);
    }
    composite.layout(true);
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor) SwitchButton(com.centurylink.mdw.plugin.designer.properties.editor.SwitchButton)

Example 35 with ValueChangeListener

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

the class PropertySection method createSaveButton.

/**
 * For override attributes.
 */
protected PropertyEditor createSaveButton() {
    savePropertyEditor = new PropertyEditor(selection, PropertyEditor.TYPE_BUTTON);
    savePropertyEditor.setLabel("Save");
    savePropertyEditor.setWidth(65);
    savePropertyEditor.setComment(" ");
    savePropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            saveOverrideAttributes();
        }
    });
    savePropertyEditor.render(composite);
    savePropertyEditor.setEnabled(selection.isOverrideAttributeDirty(getOverrideAttributePrefix()));
    return savePropertyEditor;
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Aggregations

ValueChangeListener (com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener)44 PropertyEditor (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)36 TableEditor (com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)9 ArrayList (java.util.ArrayList)8 SelectionEvent (org.eclipse.swt.events.SelectionEvent)6 ArtifactEditor (com.centurylink.mdw.plugin.designer.properties.editor.ArtifactEditor)5 Event (org.eclipse.swt.widgets.Event)5 Label (org.eclipse.swt.widgets.Label)5 Listener (org.eclipse.swt.widgets.Listener)5 DateConverter (com.centurylink.mdw.plugin.designer.properties.convert.DateConverter)4 ColumnSpec (com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec)3 PropertyEditorList (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditorList)3 FontData (org.eclipse.swt.graphics.FontData)3 CustomAttributeVO (com.centurylink.mdw.model.value.attribute.CustomAttributeVO)2 ElementChangeEvent (com.centurylink.mdw.plugin.designer.model.ElementChangeEvent)2 ElementChangeListener (com.centurylink.mdw.plugin.designer.model.ElementChangeListener)2 EmbeddedSubProcess (com.centurylink.mdw.plugin.designer.model.EmbeddedSubProcess)2 TimeInterval (com.centurylink.mdw.plugin.designer.properties.editor.TimeInterval)2 WorkflowAssetEditor (com.centurylink.mdw.plugin.designer.properties.editor.WorkflowAssetEditor)2 MarkdownRenderer (com.centurylink.mdw.designer.utils.MarkdownRenderer)1