Search in sources :

Example 6 with WorkflowElementActionHandler

use of com.centurylink.mdw.plugin.actions.WorkflowElementActionHandler in project mdw-designer by CenturyLinkCloud.

the class WorkflowAssetEditor method createWorkflowAsset.

@SuppressWarnings("restriction")
private WorkflowElement createWorkflowAsset() {
    if (isProcess()) {
        WorkflowElementActionHandler actionHandler = new WorkflowElementActionHandler();
        actionHandler.create(WorkflowProcess.class, getElement().getPackage());
        return null;
    } else {
        IWorkbench workbench = PlatformUI.getWorkbench();
        org.eclipse.ui.internal.dialogs.NewWizard wizard = new org.eclipse.ui.internal.dialogs.NewWizard();
        wizard.setCategoryId("mdw.designer.asset");
        wizard.init(workbench, new StructuredSelection(new Object[] { getElement().getPackage() }));
        IDialogSettings workbenchSettings = org.eclipse.ui.internal.ide.IDEWorkbenchPlugin.getDefault().getDialogSettings();
        IDialogSettings wizardSettings = workbenchSettings.getSection("NewWizardAction");
        if (wizardSettings == null)
            wizardSettings = workbenchSettings.addNewSection("NewWizardAction");
        wizardSettings.put("NewWizardSelectionPage.STORE_SELECTED_ID", getWizardId());
        wizard.setDialogSettings(wizardSettings);
        wizard.setForcePreviousAndNextButtons(true);
        if (isTaskTemplate() && getElement() instanceof Activity) {
            Activity activity = (Activity) getElement();
            if (activity.isAutoFormManualTask())
                wizardSettings.put(TaskTemplate.TASK_TYPE, TaskTemplate.AUTOFORM);
            else
                wizardSettings.put(TaskTemplate.TASK_TYPE, TaskTemplate.CUSTOM);
        }
        WizardDialog dialog = new WizardDialog(null, wizard);
        dialog.create();
        dialog.open();
        IWizardPage wizardPage = dialog.getCurrentPage();
        if (wizardPage instanceof WorkflowAssetPage)
            return ((WorkflowAssetPage) wizardPage).getWorkflowAsset();
    }
    return null;
}
Also used : StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) Activity(com.centurylink.mdw.plugin.designer.model.Activity) WorkflowAssetPage(com.centurylink.mdw.plugin.designer.wizards.WorkflowAssetPage) WorkflowElementActionHandler(com.centurylink.mdw.plugin.actions.WorkflowElementActionHandler) IWorkbench(org.eclipse.ui.IWorkbench) IDialogSettings(org.eclipse.jface.dialogs.IDialogSettings) IWizardPage(org.eclipse.jface.wizard.IWizardPage) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 7 with WorkflowElementActionHandler

use of com.centurylink.mdw.plugin.actions.WorkflowElementActionHandler in project mdw-designer by CenturyLinkCloud.

the class ProjectMonitoringSection method launchVisualVm.

private void launchVisualVm() {
    WorkflowElementActionHandler actionHandler = new WorkflowElementActionHandler();
    actionHandler.launchSwing(project, "Java VisualVM");
}
Also used : WorkflowElementActionHandler(com.centurylink.mdw.plugin.actions.WorkflowElementActionHandler)

Example 8 with WorkflowElementActionHandler

use of com.centurylink.mdw.plugin.actions.WorkflowElementActionHandler in project mdw-designer by CenturyLinkCloud.

the class ProjectMonitoringSection method launchJConsole.

private void launchJConsole() {
    WorkflowElementActionHandler actionHandler = new WorkflowElementActionHandler();
    actionHandler.launchSwing(project, "JConsole");
}
Also used : WorkflowElementActionHandler(com.centurylink.mdw.plugin.actions.WorkflowElementActionHandler)

Example 9 with WorkflowElementActionHandler

use of com.centurylink.mdw.plugin.actions.WorkflowElementActionHandler 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());
}
Also used : WorkflowElementActionHandler(com.centurylink.mdw.plugin.actions.WorkflowElementActionHandler) Action(org.eclipse.jface.action.Action) ServerSettings(com.centurylink.mdw.plugin.project.model.ServerSettings) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) Separator(org.eclipse.jface.action.Separator)

Example 10 with WorkflowElementActionHandler

use of com.centurylink.mdw.plugin.actions.WorkflowElementActionHandler 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);
    }
}
Also used : WorkflowElementActionHandler(com.centurylink.mdw.plugin.actions.WorkflowElementActionHandler) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) WorkflowProjectManager(com.centurylink.mdw.plugin.project.WorkflowProjectManager)

Aggregations

WorkflowElementActionHandler (com.centurylink.mdw.plugin.actions.WorkflowElementActionHandler)15 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)5 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)4 SelectionEvent (org.eclipse.swt.events.SelectionEvent)4 WorkflowProject (com.centurylink.mdw.plugin.project.model.WorkflowProject)3 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)3 Menu (org.eclipse.swt.widgets.Menu)3 MenuItem (org.eclipse.swt.widgets.MenuItem)3 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)2 Iterator (java.util.Iterator)2 CoreException (org.eclipse.core.runtime.CoreException)2 ProcessInstanceVO (com.centurylink.mdw.model.value.process.ProcessInstanceVO)1 DocumentReference (com.centurylink.mdw.model.value.variable.DocumentReference)1 Activity (com.centurylink.mdw.plugin.designer.model.Activity)1 ActivityImpl (com.centurylink.mdw.plugin.designer.model.ActivityImpl)1 WorkflowAsset (com.centurylink.mdw.plugin.designer.model.WorkflowAsset)1 PropertyEditor (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)1 ValueChangeListener (com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener)1 DocumentStorage (com.centurylink.mdw.plugin.designer.storage.DocumentStorage)1 StorageEditorInput (com.centurylink.mdw.plugin.designer.storage.StorageEditorInput)1