List of usage examples for org.eclipse.jface.viewers IStructuredSelection size
public int size();
From source file:com.centurylink.mdw.plugin.designer.views.ProcessExplorerActionGroup.java
License:Apache License
public boolean showInstancesApplies(IStructuredSelection selection) { return selection.size() == 1 && selection.getFirstElement() instanceof WorkflowProcess; }
From source file:com.centurylink.mdw.plugin.designer.views.ProcessExplorerActionGroup.java
License:Apache License
public boolean myTasksApplies(IStructuredSelection selection) { return selection.size() == 1 && selection.getFirstElement() instanceof WorkflowProject; }
From source file:com.centurylink.mdw.plugin.designer.views.ProcessExplorerActionGroup.java
License:Apache License
public boolean searchApplies(IStructuredSelection selection) { return selection.size() == 1 && (selection.getFirstElement() instanceof WorkflowProject || selection.getFirstElement() instanceof WorkflowPackage); }
From source file:com.centurylink.mdw.plugin.designer.views.ProcessExplorerActionGroup.java
License:Apache License
public boolean findCallersApplies(IStructuredSelection selection) { if (selection.size() != 1 || !(selection.getFirstElement() instanceof WorkflowProcess)) return false; WorkflowProject project = ((WorkflowProcess) selection.getFirstElement()).getProject(); return project.isPureMdw52(); }
From source file:com.centurylink.mdw.plugin.designer.views.ProcessExplorerActionGroup.java
License:Apache License
public boolean showProcessHierarchyApplies(IStructuredSelection selection) { if (selection.size() != 1 || !(selection.getFirstElement() instanceof WorkflowProcess)) return false; WorkflowProject project = ((WorkflowProcess) selection.getFirstElement()).getProject(); return project.isFilePersist(); // otherwise it's too slow }
From source file:com.centurylink.mdw.plugin.designer.views.ProcessExplorerActionGroup.java
License:Apache License
public boolean createApplies(Class<? extends WorkflowElement> elementClass, IStructuredSelection selection) { if (selection.size() > 1) return false; if (WorkflowProject.class.equals(elementClass) || WorkflowElement.class.equals(elementClass)) return true; // create a new local project if (selection.size() == 1) { if (selection.getFirstElement() instanceof WorkflowElement) { WorkflowElement workflowElement = (WorkflowElement) selection.getFirstElement(); if (!workflowElement.getProject().isUserAuthorizedInAnyGroup(UserRoleVO.PROCESS_DESIGN)) return false; }//from www . ja v a2 s . co m return true; } return false; }
From source file:com.centurylink.mdw.plugin.designer.views.ProcessExplorerActionGroup.java
License:Apache License
public boolean refreshApplies(IStructuredSelection selection) { if (selection.size() == 1 && selection.getFirstElement() instanceof WorkflowProject) return true; if (selection.size() == 1 && (selection.getFirstElement() instanceof AutomatedTestSuite || selection.getFirstElement() instanceof AutomatedTestCase)) return true; return false; }
From source file:com.centurylink.mdw.plugin.designer.views.ProcessExplorerActionGroup.java
License:Apache License
public boolean updateApplies(IStructuredSelection selection) { if (selection.size() == 1 && selection.getFirstElement() instanceof WorkflowPackage) { WorkflowPackage pkgVersion = (WorkflowPackage) selection.getFirstElement(); return !pkgVersion.isArchived() && !pkgVersion.isDefaultPackage(); }/* www. j av a 2s .c o m*/ return false; }
From source file:com.centurylink.mdw.plugin.designer.views.ProcessExplorerActionGroup.java
License:Apache License
public boolean webLaunchApplies(IStructuredSelection selection) { if (selection.size() == 1) { if (selection.getFirstElement() instanceof WorkflowProject) return true; else if (selection.getFirstElement() instanceof WorkflowPackage) { WorkflowPackage packageVersion = (WorkflowPackage) selection.getFirstElement(); return packageVersion.getProject().checkRequiredVersion(5, 1); }/*from w w w . j a v a 2 s .c o m*/ } return false; }
From source file:com.centurylink.mdw.plugin.designer.views.ProcessExplorerActionGroup.java
License:Apache License
public boolean serverActionApplies(IStructuredSelection selection) { if (selection.size() == 1) { if (selection.getFirstElement() instanceof WorkflowProject) { WorkflowProject project = (WorkflowProject) selection.getFirstElement(); if (project.isUserAuthorizedForSystemAdmin() || project.isUserAuthorizedInAnyGroup(UserRoleVO.PROCESS_EXECUTION)) return true; }/*from w w w .j a v a 2s. c o m*/ } return false; }