Search in sources :

Example 16 with WorkflowProject

use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.

the class ActivityPage method createAttrXmlControls.

private void createAttrXmlControls(Composite parent, int ncol) {
    Label label = new Label(parent, SWT.NONE);
    label.setText("Pagelet:");
    GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
    label.setLayoutData(gd);
    attributeXmlTextField = new Text(parent, SWT.MULTI | SWT.BORDER | SWT.WRAP);
    gd = new GridData(GridData.BEGINNING);
    gd.widthHint = 400;
    gd.heightHint = 100;
    gd.horizontalSpan = ncol - 1;
    attributeXmlTextField.setLayoutData(gd);
    if (getWizard() instanceof StartActivityWizard) {
        WorkflowProject workflowProject = getProject();
        String baseStartClass = "com.centurylink.mdw.workflow.activity.process.ProcessStartActivity";
        if (workflowProject != null && !workflowProject.checkRequiredVersion(5, 5))
            baseStartClass = "com.qwest.mdw.workflow.activity.impl.process.ProcessStartControlledActivity";
        ActivityImpl startImpl = workflowProject == null ? null : workflowProject.getActivityImpl(baseStartClass);
        if (startImpl != null && startImpl.getAttrDescriptionXml() != null) {
            attributeXmlTextField.setText(startImpl.getAttrDescriptionXml());
            getActivity().setAttrXml(startImpl.getAttrDescriptionXml());
        }
    }
    attributeXmlTextField.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            getActivity().setAttrXml(attributeXmlTextField.getText().trim());
            handleFieldChanged();
        }
    });
}
Also used : ModifyEvent(org.eclipse.swt.events.ModifyEvent) ActivityImpl(com.centurylink.mdw.plugin.designer.model.ActivityImpl) ModifyListener(org.eclipse.swt.events.ModifyListener) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) Text(org.eclipse.swt.widgets.Text) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject)

Example 17 with WorkflowProject

use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.

the class ProcessExplorerActionGroup method createSwingActionGroup.

private ActionGroup createSwingActionGroup() {
    swingMenu = new MenuManager("Swing Tools", null, MdwMenuManager.MDW_MENU_PREFIX + "menu.swing.tools");
    return new ActionGroup() {

        @Override
        public void fillContextMenu(IMenuManager menu) {
            swingMenu.removeAll();
            IStructuredSelection selection = getSelection();
            if (swingLaunchApplies(selection)) {
                WorkflowProject project = (WorkflowProject) selection.getFirstElement();
                MdwSettings settings = MdwPlugin.getSettings();
                if (settings.isSwingLaunchEventManager() && project.isUserAuthorizedForSystemAdmin())
                    swingMenu.add(eventManagerAction);
                if (settings.isSwingLaunchThreadPoolManager() && project.isUserAuthorizedForSystemAdmin())
                    swingMenu.add(threadPoolManagerAction);
            }
        }
    };
}
Also used : ActionGroup(org.eclipse.ui.actions.ActionGroup) MdwSettings(com.centurylink.mdw.plugin.preferences.model.MdwSettings) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) MdwMenuManager(com.centurylink.mdw.plugin.actions.MdwMenuManager) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) IMenuManager(org.eclipse.jface.action.IMenuManager) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 18 with WorkflowProject

use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.

the class ProcessExplorerActionGroup method createLogWatcherAction.

private IAction createLogWatcherAction() {
    IAction action = new Action("Log Watcher", Action.AS_CHECK_BOX) {

        @Override
        public void run() {
            WorkflowProject project = (WorkflowProject) getSelection().getFirstElement();
            actionHandler.serverAction(project, WorkflowElementActionHandler.LOG_WATCHER);
        }
    };
    ImageDescriptor imageDesc = MdwPlugin.getImageDescriptor("icons/logwatch.gif");
    action.setImageDescriptor(imageDesc);
    return action;
}
Also used : WebLaunchAction(com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction) IAction(org.eclipse.jface.action.IAction) IWorkbenchAction(org.eclipse.ui.actions.ActionFactory.IWorkbenchAction) Action(org.eclipse.jface.action.Action) IAction(org.eclipse.jface.action.IAction) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)

Example 19 with WorkflowProject

use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.

the class ProcessExplorerActionGroup method createImportTaskTemplateAction.

private IAction createImportTaskTemplateAction() {
    IAction action = new Action() {

        @Override
        public void run() {
            if (!importTaskTemplateApplies(getSelection()))
                return;
            WorkflowElement selection = (WorkflowElement) getSelection().getFirstElement();
            WorkflowProject workflowProject = selection.getProject();
            if (!workflowProject.isUserAuthorizedInAnyGroup(UserRoleVO.PROCESS_DESIGN)) {
                MessageDialog.openError(getViewSite().getShell(), "Task Template Import", NOT_AUTHORIZED + workflowProject.getName());
                return;
            }
            actionHandler.imporT(TaskTemplate.class, selection);
        }
    };
    ImageDescriptor imageDesc = MdwPlugin.getImageDescriptor("icons/task.gif");
    action.setImageDescriptor(imageDesc);
    action.setId(MdwMenuManager.MDW_MENU_PREFIX + "import.tasks");
    action.setText("Task Templates...");
    return action;
}
Also used : WebLaunchAction(com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction) IAction(org.eclipse.jface.action.IAction) IWorkbenchAction(org.eclipse.ui.actions.ActionFactory.IWorkbenchAction) Action(org.eclipse.jface.action.Action) IAction(org.eclipse.jface.action.IAction) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) WorkflowElement(com.centurylink.mdw.plugin.designer.model.WorkflowElement)

Example 20 with WorkflowProject

use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.

the class ProcessExplorerActionGroup method exportPackageApplies.

public boolean exportPackageApplies(IStructuredSelection selection) {
    Object element = selection.getFirstElement();
    if (!(element instanceof WorkflowElement))
        return false;
    WorkflowProject project = ((WorkflowElement) element).getProject();
    if (selection.size() > 1 && !project.getProject().checkRequiredVersion(5, 5))
        return false;
    for (Object item : selection.toList()) {
        if (!(item instanceof WorkflowPackage))
            return false;
        WorkflowPackage pkg = (WorkflowPackage) item;
        if (pkg.isDefaultPackage() || !pkg.getProject().equals(project))
            return false;
    }
    return true;
}
Also used : WorkflowPackage(com.centurylink.mdw.plugin.designer.model.WorkflowPackage) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) WorkflowElement(com.centurylink.mdw.plugin.designer.model.WorkflowElement)

Aggregations

WorkflowProject (com.centurylink.mdw.plugin.project.model.WorkflowProject)128 WorkflowPackage (com.centurylink.mdw.plugin.designer.model.WorkflowPackage)31 WorkflowElement (com.centurylink.mdw.plugin.designer.model.WorkflowElement)25 WebLaunchAction (com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction)22 ArrayList (java.util.ArrayList)22 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)21 CoreException (org.eclipse.core.runtime.CoreException)19 Action (org.eclipse.jface.action.Action)19 IAction (org.eclipse.jface.action.IAction)18 IProject (org.eclipse.core.resources.IProject)17 IFile (org.eclipse.core.resources.IFile)16 PartInitException (org.eclipse.ui.PartInitException)16 IWorkbenchAction (org.eclipse.ui.actions.ActionFactory.IWorkbenchAction)16 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)15 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)12 AutomatedTestCase (com.centurylink.mdw.plugin.designer.model.AutomatedTestCase)11 InvocationTargetException (java.lang.reflect.InvocationTargetException)11 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)11 IOException (java.io.IOException)10 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)9