use of com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor 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);
}
use of com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor in project mdw-designer by CenturyLinkCloud.
the class OutputSection method drawWidgets.
public void drawWidgets(Composite composite, WorkflowElement selection) {
testCase = (AutomatedTestCase) selection;
outputEditor = new PropertyEditor(selection, PropertyEditor.TYPE_TEXT);
outputEditor.setMultiLine(true);
outputEditor.setSpan(4);
outputEditor.setIndent(5);
outputEditor.setWidth(600);
outputEditor.setHeight(175);
outputEditor.render(composite);
outputEditor.setEditable(false);
}
use of com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor 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);
}
}
use of com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor 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);
}
use of com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor 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);
}
Aggregations