use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class TomcatServerBehavior method getDefaultJavaOptions.
protected String getDefaultJavaOptions() {
WorkflowProject project = getProject();
String runtimeEnv = project != null && project.checkRequiredVersion(6, 0) ? "-Dmdw.runtime.env=dev" : "-DruntimeEnv=dev";
return runtimeEnv + "\n" + "-Dmdw.config.location=" + (project == null ? "null" : project.getProjectDir()) + System.getProperty("file.separator") + "config\n" + "-Xms512m -Xmx1024m -XX:MaxPermSize=256m";
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class ServerConsole method addToMenuAndToolbar.
public void addToMenuAndToolbar() {
// start action
startAction = new Action("Start") {
public void run() {
WorkflowElementActionHandler actionHandler = new WorkflowElementActionHandler();
actionHandler.run(getRunnableObject());
}
};
startAction.setImageDescriptor(MdwPlugin.getImageDescriptor("icons/run.gif"));
Object runnableObj = getRunnableObject();
String startText = "Start";
if (runnableObj instanceof WorkflowProject)
startText += " " + ((WorkflowProject) runnableObj).getName();
else if (runnableObj instanceof ServerSettings)
startText += " " + ((ServerSettings) runnableObj).getServerName();
startAction.setToolTipText(startText);
startAction.setEnabled(runnableObj != null);
// client shell action
clientShellAction = new Action("Client Shell") {
public void run() {
WorkflowElementActionHandler actionHandler = new WorkflowElementActionHandler();
actionHandler.clientShell(getRunnableObject());
}
};
clientShellAction.setImageDescriptor(MdwPlugin.getImageDescriptor("icons/client_shell.gif"));
clientShellAction.setToolTipText("Client Shell");
clientShellAction.setEnabled(false);
// deploy action
deployAction = new Action("Deploy") {
public void run() {
WorkflowElementActionHandler actionHandler = new WorkflowElementActionHandler();
actionHandler.deploy(getRunnableObject());
}
};
deployAction.setImageDescriptor(MdwPlugin.getImageDescriptor("icons/deploy.gif"));
deployAction.setToolTipText("Deploy");
deployAction.setEnabled(false);
// stop action
stopAction = new Action("Stop") {
public void run() {
WorkflowElementActionHandler actionHandler = new WorkflowElementActionHandler();
actionHandler.stop(getRunnableObject());
}
};
stopAction.setImageDescriptor(MdwPlugin.getImageDescriptor("icons/stop.gif"));
stopAction.setToolTipText("Stop");
stopAction.setEnabled(false);
// create menu
getViewSite().getActionBars().getMenuManager().add(startAction);
// getViewSite().getActionBars().getMenuManager().add(clientShellAction);
getViewSite().getActionBars().getMenuManager().add(deployAction);
getViewSite().getActionBars().getMenuManager().add(stopAction);
getViewSite().getActionBars().getMenuManager().add(new Separator());
// create toolbar
getViewSite().getActionBars().getToolBarManager().add(startAction);
getViewSite().getActionBars().getToolBarManager().add(clientShellAction);
getViewSite().getActionBars().getToolBarManager().add(deployAction);
getViewSite().getActionBars().getToolBarManager().add(stopAction);
getViewSite().getActionBars().getToolBarManager().add(new Separator());
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerContentProvider method handleElementChange.
private void handleElementChange(ElementChangeEvent ece) {
if (ece.getChangeType().equals(ChangeType.ELEMENT_CREATE)) {
Object parent = getParent(ece.getElement());
if (parent == null) {
treeViewer.refresh(true);
ece.getElement().addElementChangeListener(this);
} else {
if (parent instanceof WorkflowPackage) {
try {
((WorkflowPackage) parent).getFolder().refreshLocal(IResource.DEPTH_ONE, null);
} catch (Exception ex) {
PluginMessages.log(ex);
}
}
treeViewer.refresh(parent, true);
}
treeViewer.expandToLevel(ece.getElement(), 0);
treeViewer.setSelection(ece.getElement());
} else if (ece.getChangeType().equals(ChangeType.ELEMENT_DELETE)) {
Object parent = getParent(ece.getElement());
if (parent != null) {
if (ece.getElement() instanceof ActivityImpl)
// impl can be associated with
treeViewer.refresh();
else
// multiple packages
treeViewer.refresh(parent, true);
} else {
// must be a workflowProject
ece.getElement().removeElementChangeListener(this);
treeViewer.refresh();
}
} else if (ece.getChangeType().equals(ChangeType.RENAME)) {
treeViewer.refresh(ece.getElement(), true);
treeViewer.getControl().forceFocus();
} else if (ece.getChangeType().equals(ChangeType.VERSION_CHANGE)) {
treeViewer.refresh(ece.getElement(), true);
if (ece.getElement() instanceof WorkflowPackage)
treeViewer.refresh(ece.getElement().getProject().getArchivedUserVisiblePackagesFolder(), true);
} else if (ece.getChangeType().equals(ChangeType.LABEL_CHANGE)) {
treeViewer.update(ece.getElement(), null);
} else if (ece.getChangeType().equals(ChangeType.SETTINGS_CHANGE)) {
// only applies for workflow projects
if (ece.getElement() instanceof WorkflowProject) {
WorkflowProject workflowProject = (WorkflowProject) ece.getElement();
if (ece.getNewValue() instanceof JdbcDataSource) {
treeViewer.collapseToLevel(workflowProject, TreeViewer.ALL_LEVELS);
treeViewer.refresh(workflowProject, true);
} else if (ece.getNewValue() == null) {
// general refresh
treeViewer.refresh(workflowProject, true);
}
} else {
treeViewer.refresh(ece.getElement(), true);
}
} else if (ece.getChangeType().equals(ChangeType.STATUS_CHANGE)) {
treeViewer.update(ece.getElement(), null);
if (ece.getElement() instanceof AutomatedTestCase) {
AutomatedTestCase testCase = (AutomatedTestCase) ece.getElement();
Object testResults;
if (testCase.isLegacy())
testResults = testCase.getLegacyExpectedResults();
else
testResults = testCase.getExpectedResults();
if (testResults != null)
treeViewer.refresh(testResults, true);
}
}
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerDropTarget method handleDropActivityImpl.
private boolean handleDropActivityImpl(String activityImplInfo, WorkflowPackage targetPackage, int operation) {
Long activityImplId = getActivityImplId(activityImplInfo);
WorkflowProject workflowProject = targetPackage.getProject();
WorkflowPackage sourcePackage = workflowProject.getPackage(getPackageName(activityImplInfo));
DesignerProxy designerProxy = workflowProject.getDesignerProxy();
if (operation == DND.DROP_COPY) {
if (!targetPackage.isDefaultPackage()) {
designerProxy.addActivityImplToPackage(activityImplId, targetPackage);
((TreeViewer) getViewer()).refresh(targetPackage, true);
return true;
}
return false;
} else if (operation == DND.DROP_MOVE) {
if (targetPackage.isDefaultPackage()) {
designerProxy.removeActivityImplFromPackage(activityImplId, sourcePackage);
} else {
designerProxy.addActivityImplToPackage(activityImplId, targetPackage);
if (RunnerStatus.SUCCESS.equals(designerProxy.getRunnerStatus()))
designerProxy.removeActivityImplFromPackage(activityImplId, sourcePackage);
}
((TreeViewer) getViewer()).refresh(targetPackage.getProject(), true);
return true;
} else {
return false;
}
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerView method handleRefresh.
public void handleRefresh() {
BusyIndicator.showWhile(getSite().getShell().getDisplay(), new Runnable() {
public void run() {
treeViewer.collapseAll();
WorkflowProjectManager projectMgr = WorkflowProjectManager.getInstance();
projectMgr.refresh();
treeViewer.setInput(projectMgr.getWorkflowProjects());
}
});
WorkflowElementActionHandler actionHandler = new WorkflowElementActionHandler();
for (WorkflowProject project : WorkflowProjectManager.getInstance().getWorkflowProjects()) {
if (!project.isFilePersist())
actionHandler.syncOpenEditors(project);
}
}
Aggregations