private void addWorkingSetAction(IWorkingSet[] workingSets, IMenuManager manager) {
   FindAction action;
   if (fEditor != null)
     action =
         new WorkingSetFindAction(
             fEditor,
             new FindImplementorsInWorkingSetAction(fEditor, workingSets),
             SearchUtil.toString(workingSets));
   else
     action =
         new WorkingSetFindAction(
             fSite,
             new FindImplementorsInWorkingSetAction(fSite, workingSets),
             SearchUtil.toString(workingSets));
   action.update(getContext().getSelection());
   addAction(action, manager);
 }
  /* (non-Javadoc)
   * Method declared on ActionGroup.
   */
  public void fillContextMenu(IMenuManager manager) {
    MenuManager javaSearchMM = new MenuManager(MENU_TEXT, IContextMenuConstants.GROUP_SEARCH);
    addAction(fFindImplementorsAction, javaSearchMM);
    addAction(fFindImplementorsInProjectAction, javaSearchMM);

    javaSearchMM.add(new Separator());

    Iterator iter = SearchUtil.getLRUWorkingSets().sortedIterator();
    while (iter.hasNext()) {
      addWorkingSetAction((IWorkingSet[]) iter.next(), javaSearchMM);
    }
    addAction(fFindImplementorsInWorkingSetAction, javaSearchMM);

    if (!javaSearchMM.isEmpty()) manager.appendToGroup(fGroupId, javaSearchMM);
  }
Exemplo n.º 3
0
 private boolean isSearchResultView(IWorkbenchPart part) {
   return SearchUtil.isSearchPlugInActivated() && part instanceof ISearchResultViewPart;
 }