Package org.eclipse.ui.actions.ActionFactory

Examples of org.eclipse.ui.actions.ActionFactory.IWorkbenchAction


    page.getActiveEditor();
    for (EditorAction action : editor.getActions()) {
      if (action == null) {
        manager.add(new Separator());
      } else if (action.isRetargetable()) {
        IWorkbenchAction workbenchAction = action.getActionFactory().create(window);
        if (workbenchAction instanceof RetargetAction) {
          RetargetAction retargetAction = (RetargetAction) workbenchAction;
          page.addPartListener(retargetAction);
          retargetAction.partActivated(editor);
        }
View Full Code Here


            if(parentMenuBar.getId().equalsIgnoreCase(IWorkbenchActionConstants.M_FILE)){
            parentMenuBar.add(new GroupMarker(START_GROUP));
            parentMenuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
            parentMenuBar.add(new GroupMarker(END_GROUP));
            }
            IWorkbenchAction exitAction = ActionFactory.QUIT.create(workbenchWindow);
            parentMenuBar.add(new Separator());
            parentMenuBar.add(exitAction);           
          }
        }
      }
View Full Code Here

  }
 
  @Override
  public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
    IWorkbenchWindow win = configurer.getWindowConfigurer().getWindow();
    IWorkbenchAction deleteAction = ActionFactory.DELETE.create(win);
    IWorkbenchAction copyAction = ActionFactory.COPY.create(win);
    IWorkbenchAction pasteAction = ActionFactory.PASTE.create(win);
    IWorkbenchAction cutAction = ActionFactory.CUT.create(win);
    IWorkbenchAction saveAllAction = ActionFactory.SAVE_ALL.create(win);
   
   
    configurer.registerGlobalAction(deleteAction);
    configurer.registerGlobalAction(copyAction);
    configurer.registerGlobalAction(pasteAction);
View Full Code Here

      resetPerspectiveItem = createItem(ActionFactory.RESET_PERSPECTIVE, window);
      aboutItem = createItem(ActionFactory.ABOUT, window);
    }

    private ActionContributionItem createItem(ActionFactory factory, IWorkbenchWindow window) {
      final IWorkbenchAction action = factory.create(window);
      register(action);
      return new ActionContributionItem(action);
    }
View Full Code Here

    getViewSite().setSelectionProvider(tree);
    createContextMenu();
  }

  private void createActions() {
    IWorkbenchAction reuseCompareEditorAction = new CompareUtils.ReuseCompareEditorAction();
    actionsToDispose.add(reuseCompareEditorAction);
    getViewSite().getActionBars().getMenuManager().add(
        reuseCompareEditorAction);

    compareModeAction = new BooleanPrefAction(
View Full Code Here

        break;
      }

        /* Close */
      case CLOSE: {
        IWorkbenchAction action = ActionFactory.CLOSE.create(fWindow);
        action.run();
        break;
      }

        /* Close Others */
      case CLOSE_OTHERS: {
        IWorkbenchPage page = fWindow.getActivePage();
        if (page != null) {
          IEditorReference[] refArray = page.getEditorReferences();
          if (refArray != null && refArray.length > 1) {
            IEditorReference[] otherEditors = new IEditorReference[refArray.length - 1];
            IEditorReference activeEditor = (IEditorReference) page.getReference(page.getActiveEditor());
            for (int i = 0; i < refArray.length; i++) {
              if (refArray[i] != activeEditor)
                continue;
              System.arraycopy(refArray, 0, otherEditors, 0, i);
              System.arraycopy(refArray, i + 1, otherEditors, i, refArray.length - 1 - i);
              break;
            }
            page.closeEditors(otherEditors, true);
          }
        }
        break;
      }

        /* Close All */
      case CLOSE_ALL: {
        IWorkbenchAction action = ActionFactory.CLOSE_ALL.create(fWindow);
        action.run();
        break;
      }

        /* Open */
      case OPEN: {
        IStructuredSelection selection = OwlUI.getActiveFeedViewSelection();
        FeedView feedView = OwlUI.getActiveFeedView();
        if (selection != null && !selection.isEmpty() && feedView != null) {
          OpenInBrowserAction action = new OpenInBrowserAction(selection, WebBrowserContext.createFrom(selection, feedView));
          action.run();
        }
        break;
      }

        /* Save As */
      case SAVE_AS: {
        FeedView activeFeedView = OwlUI.getActiveFeedView();
        if (activeFeedView != null)
          activeFeedView.doSaveAs();
        break;
      }

        /* Print */
      case PRINT: {
        FeedView activeFeedView = OwlUI.getActiveFeedView();
        if (activeFeedView != null)
          activeFeedView.print();
        break;
      }

        /* Fullscreen */
      case FULLSCREEN: {
        OwlUI.toggleFullScreen();
        wrappingAction.setChecked(fWindow.getShell().getFullScreen());
        break;
      }

        /* Toggle Bookmarks View */
      case BOOKMARK_VIEW: {
        OwlUI.toggleBookmarks();
        break;
      }

        /* Sticky */
      case STICKY: {
        IStructuredSelection selection = OwlUI.getActiveFeedViewSelection();
        if (selection != null && !selection.isEmpty())
          new MakeNewsStickyAction(selection).run();
        break;
      }

        /* Find more Feeds */
      case FIND_MORE_FEEDS: {
        SearchFeedsAction action = new SearchFeedsAction();
        action.init(fWindow);
        action.run(null);
        break;
      }

        /* Downloads & Activity */
      case ACTIVITIES: {
        ShowActivityAction action = new ShowActivityAction();
        action.init(fWindow);
        action.run(null);
        break;
      }

        /* Preferences */
      case PREFERENCES: {
        IWorkbenchAction action = ActionFactory.PREFERENCES.create(fWindow);
        action.run();
        break;
      }

        /* History */
      case HISTORY: {
View Full Code Here

TOP

Related Classes of org.eclipse.ui.actions.ActionFactory.IWorkbenchAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.