Package org.eclipse.ui

Examples of org.eclipse.ui.IActionBars


   
    // set up action handlers that operate on the current context
    undoAction = new UndoActionHandler(getSite(), undoContext);
    redoAction = new RedoActionHandler(getSite(), undoContext);
   
    IActionBars actionBars = getViewSite().getActionBars();
   
    actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undoAction);
    actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction);
   
    // Install the standard text actions.
    addTextAction(ActionFactory.CUT, ITextOperationTarget.CUT);
    addTextAction(ActionFactory.COPY, ITextOperationTarget.COPY);
    addTextAction(ActionFactory.PASTE, ITextOperationTarget.PASTE);
View Full Code Here


   
    // Make sure it's up to date.
    textAction.update();
   
    // Register our text action with the global action handler.
    IActionBars actionBars = getViewSite().getActionBars();
   
    actionBars.setGlobalActionHandler(actionFactory.getId(), textAction);
  }
View Full Code Here

   
  }

  private void contributeToActionBars()
  {
    IActionBars bars = getViewSite().getActionBars();
   
    fillLocalPullDown(bars.getMenuManager());
    fillLocalToolBar(bars.getToolBarManager());
  }
View Full Code Here

        viewer.getControl().setMenu(menu);
        getSite().registerContextMenu(menuMgr, viewer);
    }

    private void contributeToActionBars() {
        IActionBars bars = getViewSite().getActionBars();
        fillLocalPullDown(bars.getMenuManager());
        fillLocalToolBar(bars.getToolBarManager());
    }
View Full Code Here

  /**
   * Refreshes the global actions for the active page.
   */
  private void refreshGlobalActionHandlers() {
    // Clear old actions.
    IActionBars bars = getViewSite().getActionBars();
    bars.clearGlobalActionHandlers();

    // Set new actions.
    Map newActionHandlers = activeRec.subActionBars
        .getGlobalActionHandlers();
    if (newActionHandlers != null) {
      Set keys = newActionHandlers.entrySet();
      Iterator iter = keys.iterator();
      while (iter.hasNext()) {
        Map.Entry entry = (Map.Entry) iter.next();
        bars.setGlobalActionHandler((String) entry.getKey(),
            (IAction) entry.getValue());
      }
    }
  }
View Full Code Here

        } else if (event.getProperty().equals(IAction.CHECKED)) {
            Boolean bool = (Boolean) event.getNewValue();
            setChecked(bool.booleanValue());
        } else if (event.getProperty().equals(SubActionBars.P_ACTION_HANDLERS)) {
            if (event.getSource() instanceof IActionBars) {
                IActionBars bars = (IActionBars) event.getSource();
                setActionHandler(bars.getGlobalActionHandler(getId()));
            }
        }
    }
View Full Code Here

        }
    }
   
    public void populateStatusBar(Image icon, String message)
    {
        IActionBars bars = getViewSite().getActionBars();
        bars.getStatusLineManager().setMessage(icon, message);
    }
View Full Code Here

        bars.getStatusLineManager().setMessage(icon, message);
    }
   
    public void populateStatusBar(String message)
    {
        IActionBars bars = getViewSite().getActionBars();
        bars.getStatusLineManager().setMessage(message);
    }
View Full Code Here

        if (activeEditorPart == part)
            return;

        activeEditorPart = part;

        IActionBars actionBars = getActionBars();
        if (actionBars != null) {

            ITextEditor editor = (part instanceof ITextEditor) ? (ITextEditor) part : null;

            actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), getAction(editor,
                ITextEditorActionConstants.DELETE));
            actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), getAction(editor,
                ITextEditorActionConstants.UNDO));
            actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), getAction(editor,
                ITextEditorActionConstants.REDO));
            actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), getAction(editor,
                ITextEditorActionConstants.CUT));
            actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), getAction(editor,
                ITextEditorActionConstants.COPY));
            actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), getAction(editor,
                ITextEditorActionConstants.PASTE));
            actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), getAction(editor,
                ITextEditorActionConstants.SELECT_ALL));
            actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), getAction(editor,
                ITextEditorActionConstants.FIND));
            actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(), getAction(editor,
                IDEActionFactory.BOOKMARK.getId()));
            actionBars.updateActionBars();
        }
    }
View Full Code Here

  /**
   * Create small icons in the view
   */
  private void createToolbarActions() {
    IActionBars bars = getViewSite().getActionBars();

    Action collapseAction = new Action() {
      @Override
      public void run() {
        logger.debug("Collapse Results");
        resultTree.collapseAll();
      }
    };
    collapseAction.setText("Collapse Results");
    collapseAction.setImageDescriptor(Activator
        .getImageDescriptor("icons/collapse.png"));
    bars.getToolBarManager().add(collapseAction);
    Action expandAction = new Action() {
      @Override
      public void run() {
        logger.debug("Expand Results");
        resultTree.expandAll();
      }
    };
    expandAction.setText("Expand Results");
    expandAction.setImageDescriptor(Activator
        .getImageDescriptor("icons/expand.png"));
    bars.getToolBarManager().add(expandAction);

  }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IActionBars

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.