use of com.centurylink.mdw.plugin.search.ProcessSearchQuery in project mdw-designer by CenturyLinkCloud.
the class WorkflowElementActionHandler method findCallers.
public void findCallers(WorkflowElement element) {
WorkflowProcess processVersion = (WorkflowProcess) element;
List<WorkflowProject> projects = new ArrayList<WorkflowProject>();
projects.add(processVersion.getProject());
Shell shell = MdwPlugin.getActiveWorkbenchWindow().getShell();
ProcessSearchQuery searchQuery = new ProcessSearchQuery(projects, SearchQuery.SearchType.INVOKING_ENTITY, "*", true, shell);
searchQuery.setInvokedEntityId(processVersion.getId());
try {
ProgressMonitorDialog context = new MdwProgressMonitorDialog(shell);
NewSearchUI.runQueryInForeground(context, searchQuery);
// this shouldn't be necessary according to the Eclipse API docs
NewSearchUI.activateSearchResultView();
ISearchResultViewPart part = NewSearchUI.getSearchResultView();
part.updateLabel();
SearchResultsPage page = (SearchResultsPage) part.getActivePage();
page.setSearchQuery(searchQuery);
page.setInput(searchQuery.getSearchResult(), null);
} catch (OperationCanceledException ex) {
MessageDialog.openInformation(shell, "Search Cancelled", "Search for callers cancelled.");
} catch (Exception ex) {
PluginMessages.uiError(shell, ex, "Search for Callers", processVersion.getProject());
}
}
use of com.centurylink.mdw.plugin.search.ProcessSearchQuery in project mdw-designer by CenturyLinkCloud.
the class ToolboxWrapper method searchReferences.
private void searchReferences(ActivityImpl activityImpl) {
List<WorkflowProject> projects = new ArrayList<>();
projects.add(getProject());
Shell shell = MdwPlugin.getActiveWorkbenchWindow().getShell();
ProcessSearchQuery searchQuery = new ProcessSearchQuery(projects, SearchQuery.SearchType.CONTAINING_ENTITY, "*", true, shell);
searchQuery.setContainedEntityId(activityImpl.getId());
searchQuery.setContainedEntityName(activityImpl.getImplClassName());
try {
ProgressMonitorDialog context = new MdwProgressMonitorDialog(shell);
NewSearchUI.runQueryInForeground(context, searchQuery);
// this shouldn't be necessary according to the Eclipse API docs
NewSearchUI.activateSearchResultView();
ISearchResultViewPart part = NewSearchUI.getSearchResultView();
part.updateLabel();
SearchResultsPage page = (SearchResultsPage) part.getActivePage();
page.setSearchQuery(searchQuery);
page.setInput(searchQuery.getSearchResult(), null);
} catch (OperationCanceledException ex) {
MessageDialog.openInformation(shell, "Search Cancelled", "Search for usages cancelled.");
} catch (Exception ex) {
PluginMessages.uiError(shell, ex, "Search for Usages", getProject());
}
}
Aggregations