Search in sources :

Example 26 with ValueChangeListener

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

the class ProcessSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    process = (WorkflowProcess) selection;
    // id text field
    idPropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_TEXT);
    idPropertyEditor.setLabel("ID");
    idPropertyEditor.setWidth(150);
    idPropertyEditor.setReadOnly(true);
    idPropertyEditor.render(composite);
    // name text field
    namePropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_TEXT);
    namePropertyEditor.setLabel("Name");
    namePropertyEditor.setReadOnly(true);
    namePropertyEditor.render(composite);
    // description text area
    descriptionPropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_TEXT);
    descriptionPropertyEditor.setLabel("Description");
    descriptionPropertyEditor.setWidth(475);
    descriptionPropertyEditor.setHeight(100);
    descriptionPropertyEditor.setMultiLine(true);
    descriptionPropertyEditor.setTextLimit(1000);
    descriptionPropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            process.setDescription((String) newValue);
        }
    });
    descriptionPropertyEditor.render(composite);
    // create date read-only text field
    createDatePropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_TEXT);
    createDatePropertyEditor.setLabel("Created");
    createDatePropertyEditor.setWidth(150);
    createDatePropertyEditor.setValueConverter(new DateConverter());
    createDatePropertyEditor.setReadOnly(true);
    createDatePropertyEditor.render(composite);
    // definition link
    definitionLinkEditor = new PropertyEditor(process, PropertyEditor.TYPE_LINK);
    definitionLinkEditor.setLabel("Definition");
    definitionLinkEditor.addValueChangeListener(new ValueChangeListener() {

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

Example 27 with ValueChangeListener

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

the class ProjectMonitoringSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    project = (WorkflowProject) selection;
    // launch visualvm link
    visualVmLaunchEditor = new PropertyEditor(project, PropertyEditor.TYPE_LINK);
    visualVmLaunchEditor.setLabel("Java VisualVM");
    visualVmLaunchEditor.setHeight(20);
    visualVmLaunchEditor.setFont(new FontData("Tahoma", 8, SWT.BOLD));
    visualVmLaunchEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            launchVisualVm();
        }
    });
    visualVmLaunchEditor.render(composite);
    visualVmLaunchEditor.getLabelWidget().setText("Monitoring Tools:");
    // launch jconsole link
    jConsoleLaunchEditor = new PropertyEditor(project, PropertyEditor.TYPE_LINK);
    jConsoleLaunchEditor.setLabel(" <A>JConsole</A>  (for older VMs)");
    jConsoleLaunchEditor.setHeight(20);
    jConsoleLaunchEditor.setFont(new FontData("Tahoma", 8, SWT.BOLD));
    jConsoleLaunchEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            launchJConsole();
        }
    });
    jConsoleLaunchEditor.render(composite);
    // launch filepanel link
    filePanelLaunchEditor = new PropertyEditor(project, PropertyEditor.TYPE_LINK);
    filePanelLaunchEditor.setLabel("FilePanel");
    filePanelLaunchEditor.setHeight(20);
    filePanelLaunchEditor.setFont(new FontData("Tahoma", 8, SWT.BOLD));
    filePanelLaunchEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            launchFilePanel();
        }
    });
    filePanelLaunchEditor.render(composite);
    // jmx port text field
    jmxPortEditor = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
    jmxPortEditor.setLabel("Remote JMX Port");
    jmxPortEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            project.setPersistentProperty(WorkflowProject.MDW_REMOTE_JMX_PORT, newValue == null ? null : newValue.toString());
        }
    });
    jmxPortEditor.render(composite);
    // visual vm id text field
    visualVmIdEditor = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
    visualVmIdEditor.setLabel("VisualVM ID");
    visualVmIdEditor.setComment("(Should match server \"-Dvisualvm.id\" VM argument)");
    visualVmIdEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            project.setPersistentProperty(WorkflowProject.MDW_VISUALVM_ID, newValue == null ? null : newValue.toString());
        }
    });
    visualVmIdEditor.render(composite);
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) FontData(org.eclipse.swt.graphics.FontData) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 28 with ValueChangeListener

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

the class ProjectSection method setSelection.

@Override
public void setSelection(WorkflowElement selection) {
    if (project != null)
        project.removeElementChangeListener(this);
    project = (WorkflowProject) selection;
    project.addElementChangeListener(this);
    // dispose controls to render dynamically
    if (sourceProjectEditor != null)
        sourceProjectEditor.dispose();
    if (jdbcUrlEditor != null)
        jdbcUrlEditor.dispose();
    if (hostEditor != null)
        hostEditor.dispose();
    if (portEditor != null)
        portEditor.dispose();
    if (webContextRootEditor != null)
        webContextRootEditor.dispose();
    if (updateServerCacheEditor != null)
        updateServerCacheEditor.dispose();
    if (localProjectEditor != null)
        localProjectEditor.dispose();
    if (localProjectInfoEditor != null)
        localProjectInfoEditor.dispose();
    if (mdwVersionEditor != null)
        mdwVersionEditor.dispose();
    if (appVersionEditor != null)
        appVersionEditor.dispose();
    // source project text field
    sourceProjectEditor = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
    sourceProjectEditor.setLabel("Source Project");
    sourceProjectEditor.setWidth(200);
    sourceProjectEditor.render(composite);
    sourceProjectEditor.setValue(project.getSourceProjectName());
    sourceProjectEditor.setEditable(false);
    if (!project.checkRequiredVersion(6, 0)) {
        // jdbc url text field
        jdbcUrlEditor = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
        jdbcUrlEditor.setLabel("JDBC URL");
        jdbcUrlEditor.addValueChangeListener(new ValueChangeListener() {

            public void propertyValueChanged(Object newValue) {
                project.getMdwDataSource().setJdbcUrlWithCredentials(((String) newValue).trim());
                project.getMdwDataSource().setEntrySource("projectSection");
                WorkflowProjectManager.updateProject(project);
                project.fireElementChangeEvent(ChangeType.SETTINGS_CHANGE, project.getMdwDataSource());
            }
        });
        jdbcUrlEditor.render(composite);
        jdbcUrlEditor.setValue(project.getMdwDataSource().getJdbcUrlWithMaskedCredentials());
        jdbcUrlEditor.setEditable(!project.isReadOnly());
    }
    // host text field
    hostEditor = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
    hostEditor.setLabel("Server Host");
    hostEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            project.getServerSettings().setHost((String) newValue);
            WorkflowProjectManager.updateProject(project);
            project.fireElementChangeEvent(ChangeType.SETTINGS_CHANGE, project.getServerSettings());
        }
    });
    hostEditor.render(composite);
    hostEditor.setValue(project.getServerSettings().getHost());
    hostEditor.setEditable(!project.isReadOnly());
    // port text field
    portEditor = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
    portEditor.setLabel("Server Port");
    portEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            project.getServerSettings().setPort(Integer.parseInt(((String) newValue).trim()));
            WorkflowProjectManager.updateProject(project);
            project.fireElementChangeEvent(ChangeType.SETTINGS_CHANGE, project.getServerSettings());
        }
    });
    portEditor.render(composite);
    portEditor.setValue(project.getServerSettings().getPort());
    portEditor.setEditable(!project.isReadOnly());
    // web context root text field
    webContextRootEditor = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
    webContextRootEditor.setLabel("Web Context Root");
    webContextRootEditor.setWidth(200);
    if (project.isRemote()) {
        webContextRootEditor.addValueChangeListener(new ValueChangeListener() {

            public void propertyValueChanged(Object newValue) {
                project.setWebContextRoot(((String) newValue).trim());
                WorkflowProjectManager.updateProject(project);
                project.fireElementChangeEvent(ChangeType.SETTINGS_CHANGE, project.getServerSettings());
            }
        });
    }
    webContextRootEditor.render(composite);
    webContextRootEditor.setValue(project.getWebContextRoot());
    webContextRootEditor.setEditable(!project.isReadOnly() && project.isRemote());
    // refresh server cache checkbox
    updateServerCacheEditor = new PropertyEditor(project, PropertyEditor.TYPE_CHECKBOX);
    updateServerCacheEditor.setLabel("Update Server Cache");
    updateServerCacheEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            project.setUpdateServerCache(Boolean.parseBoolean(newValue.toString()));
            WorkflowProjectManager.updateProject(project);
            project.fireElementChangeEvent(ChangeType.SETTINGS_CHANGE, project.isUpdateServerCache());
        }
    });
    updateServerCacheEditor.render(composite);
    updateServerCacheEditor.setValue(project.isUpdateServerCache());
    updateServerCacheEditor.setEditable(!project.isReadOnly());
    // mdw version combo
    if (project.isRemote()) {
        mdwVersionEditor = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
    } else {
        mdwVersionEditor = new PropertyEditor(project, PropertyEditor.TYPE_COMBO);
        String releaseUrl = mdwSettings.getMdwReleasesUrl();
        if (project.getMdwMajorVersion() < 6)
            mdwSettings.setMdwReleasesUrl(mdwSettings.getInternalRepositoryUrl());
        List<String> versionOptions = mdwSettings.getMdwVersions();
        mdwSettings.setMdwReleasesUrl(releaseUrl);
        if (!versionOptions.contains(project.getMdwVersion()))
            versionOptions.add(project.getMdwVersion());
        mdwVersionEditor.setValueOptions(versionOptions);
        mdwVersionEditor.addValueChangeListener(new ValueChangeListener() {

            public void propertyValueChanged(Object newValue) {
                if (!project.isRemote() && !newValue.equals("")) {
                    project.setMdwVersion((String) newValue);
                    WorkflowProjectManager.updateProject(project);
                    if (MessageDialog.openQuestion(getShell(), "Update Framework Libraries", "Download updated framework libraries to match MDW Version selection?")) {
                        ProjectUpdater updater = new ProjectUpdater(getProject(), MdwPlugin.getSettings());
                        try {
                            updater.updateFrameworkJars(null);
                            ExtensionModulesUpdater modulesUpdater = new ExtensionModulesUpdater(getProject());
                            modulesUpdater.doUpdate(getShell());
                        } catch (Exception ex) {
                            PluginMessages.uiError(getShell(), ex, "Update Framework Libraries", getProject());
                        }
                    }
                    if (getProject().isOsgi())
                        MessageDialog.openInformation(getShell(), "MDW Version Changed", "The MDW version has been updated in the plug-in settings file.  Please update any MDW dependencies in your pom.xml build file.");
                }
            }
        });
    }
    mdwVersionEditor.setLabel("MDW Version");
    mdwVersionEditor.setWidth(100);
    mdwVersionEditor.render(composite);
    mdwVersionEditor.setValue(project.getMdwVersion());
    mdwVersionEditor.setEditable(!project.isReadOnly() && !project.isRemote());
    // app version
    if (!project.isCloudProject() && !"Unknown".equals(project.getAppVersion())) {
        appVersionEditor = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
        appVersionEditor.setLabel("App Version");
        appVersionEditor.setWidth(200);
        appVersionEditor.render(composite);
        appVersionEditor.setValue(project.getAppVersion());
        appVersionEditor.setEditable(false);
    }
    if (!project.isRemote()) {
        // local project text field
        localProjectEditor = new PropertyEditor(project, PropertyEditor.TYPE_TEXT);
        localProjectEditor.setLabel("Workspace Project");
        localProjectEditor.setWidth(200);
        localProjectEditor.setReadOnly(true);
        localProjectEditor.render(composite);
        if (project.isCloudProject())
            localProjectEditor.setValue(project.getSourceProjectName());
        else
            localProjectEditor.setValue(project.getEarProjectName());
        if (!project.isOsgi()) {
            // local project info field
            localProjectInfoEditor = new PropertyEditor(project, PropertyEditor.TYPE_LINK);
            localProjectInfoEditor.setLabel("Workspace Project Settings");
            localProjectInfoEditor.addValueChangeListener(new ValueChangeListener() {

                public void propertyValueChanged(Object newValue) {
                    final IProject proj = project.isCloudProject() ? project.getSourceProject() : project.getEarProject();
                    PropertyDialog dialog = PropertyDialog.createDialogOn(getShell(), "mdw.workflow.mdwServerConnectionsPropertyPage", proj);
                    if (dialog != null)
                        dialog.open();
                }
            });
            localProjectInfoEditor.render(composite);
        }
    }
    composite.layout(true);
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) PropertyDialog(org.eclipse.ui.internal.dialogs.PropertyDialog) ProjectUpdater(com.centurylink.mdw.plugin.project.assembly.ProjectUpdater) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor) ExtensionModulesUpdater(com.centurylink.mdw.plugin.project.assembly.ExtensionModulesUpdater) IProject(org.eclipse.core.resources.IProject)

Example 29 with ValueChangeListener

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

the class SearchResultsPage method addValueChangeListener.

/**
 * Really double-click handler
 */
private void addValueChangeListener() {
    valueChangeListener = new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            searchQuery.handleOpen((WorkflowElement) newValue);
        }
    };
    tableEditor.addValueChangeListener(valueChangeListener);
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) WorkflowElement(com.centurylink.mdw.plugin.designer.model.WorkflowElement)

Example 30 with ValueChangeListener

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

the class ExternalEventSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    externalEvent = (ExternalEvent) selection;
    // id text field
    idPropertyEditor = new PropertyEditor(externalEvent, PropertyEditor.TYPE_TEXT);
    idPropertyEditor.setLabel("ID");
    idPropertyEditor.setWidth(150);
    idPropertyEditor.setReadOnly(true);
    idPropertyEditor.render(composite);
    if (!externalEvent.getProject().checkRequiredVersion(6, 0)) {
        // handler class combo
        handlerClassPropertyEditor = new PropertyEditor(externalEvent, PropertyEditor.TYPE_TEXT);
        handlerClassPropertyEditor.setLabel("Handler Class");
        handlerClassPropertyEditor.setWidth(475);
        handlerClassPropertyEditor.addValueChangeListener(new ValueChangeListener() {

            public void propertyValueChanged(Object newValue) {
                externalEvent.setEventHandler((String) newValue);
            }
        });
        handlerClassPropertyEditor.render(composite);
        // handler class link
        handlerLinkPropertyEditor = new PropertyEditor(externalEvent, PropertyEditor.TYPE_LINK);
        handlerLinkPropertyEditor.setLabel("Open Handler Source Code");
        handlerLinkPropertyEditor.addValueChangeListener(new ValueChangeListener() {

            public void propertyValueChanged(Object newValue) {
                externalEvent.getProject().viewSource(externalEvent.getEventHandlerClassName());
            }
        });
        handlerLinkPropertyEditor.render(composite);
        // message pattern text field
        messagePatternPropertyEditor = new PropertyEditor(externalEvent, PropertyEditor.TYPE_TEXT);
        messagePatternPropertyEditor.setLabel("Message Pattern");
        messagePatternPropertyEditor.setWidth(300);
        messagePatternPropertyEditor.addValueChangeListener(new ValueChangeListener() {

            public void propertyValueChanged(Object newValue) {
                externalEvent.setName((String) newValue);
            }
        });
        messagePatternPropertyEditor.render(composite);
        // save button
        savePropertyEditor = new PropertyEditor(externalEvent, PropertyEditor.TYPE_BUTTON);
        savePropertyEditor.setLabel("Save");
        savePropertyEditor.setWidth(65);
        savePropertyEditor.addValueChangeListener(new ValueChangeListener() {

            public void propertyValueChanged(Object newValue) {
                saveExternalEvent();
            }
        });
        savePropertyEditor.render(composite);
        // external event handler help link
        externalEventHelpPropertyEditor = new PropertyEditor(externalEvent, PropertyEditor.TYPE_LINK);
        externalEventHelpPropertyEditor.setLabel("External Event Handler Help");
        externalEventHelpPropertyEditor.render(composite);
        // mdw xpath help link
        mdwXPathSyntaxHelpPropertyEditor = new PropertyEditor(externalEvent, PropertyEditor.TYPE_LINK);
        mdwXPathSyntaxHelpPropertyEditor.setLabel("MDW XPath Syntax Help");
        mdwXPathSyntaxHelpPropertyEditor.setVerticalIndent(-15);
        mdwXPathSyntaxHelpPropertyEditor.render(composite);
    }
}
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