示例#1
0
  private void createActions() {
    fSearchesDropDownAction = new SearchHistoryDropDownAction(this);
    fSearchesDropDownAction.updateEnablement();
    fSearchAgainAction = new SearchAgainAction(this);
    fSearchAgainAction.setEnabled(false);
    fSearchAgainAction.setActionDefinitionId(IWorkbenchCommandConstants.FILE_REFRESH);
    fCancelAction = new CancelSearchAction(this);
    fCancelAction.setEnabled(false);

    IUndoContext workspaceContext =
        (IUndoContext) ResourcesPlugin.getWorkspace().getAdapter(IUndoContext.class);
    fUndoRedoActionGroup = new UndoRedoActionGroup(getViewSite(), workspaceContext, true);
  }
示例#2
0
 private void updateCancelAction() {
   ISearchResult result = getCurrentSearchResult();
   boolean queryRunning = false;
   if (result != null) {
     queryRunning = InternalSearchUI.getInstance().isQueryRunning(result.getQuery());
   }
   fCancelAction.setEnabled(queryRunning);
   fSearchAgainAction.setEnabled(!queryRunning && result != null && result.getQuery().canRerun());
 }