Examples of IActionBars


Examples of org.eclipse.ui.IActionBars

  /**
   * Create small icons in the view
   */
  private void createToolbarActions() {
    IActionBars bars = getViewSite().getActionBars();
    Action searchAction = new Action() {
      @Override
      public void run() {
        logger.debug("Perform a search");
        CodeConjurer.getInstance().search();
      }
    };
    searchAction.setText("Search Reusable Code");
    searchAction.setImageDescriptor(Activator
        .getImageDescriptor("icons/code_conjurer_m.png"));
    bars.getToolBarManager().add(searchAction);
    Action refreshAction = new Action() {
      @Override
      public void run() {
        logger.debug("Refresh View");
        onEvent(UIEvent.REFRESH);
      }
    };
    refreshAction.setText("Refresh Result View");
    refreshAction.setImageDescriptor(Activator
        .getImageDescriptor("icons/refresh.png"));
    bars.getToolBarManager().add(refreshAction);
  }
View Full Code Here

Examples of org.eclipse.ui.IActionBars

  /**
   * Create small icons in the view
   */
  private void createToolbarActions() {
    IActionBars bars = getViewSite().getActionBars();
    Action searchAction = new Action() {
      @Override
      public void run() {
        logger.debug("Perform a search");
        CodeConjurer.getInstance().search();
      }
    };
    searchAction.setText("Search Reusable Code");
    searchAction.setImageDescriptor(Activator
        .getImageDescriptor("icons/code_conjurer_m.png"));
    bars.getToolBarManager().add(searchAction);
    Action refreshAction = new Action() {
      @Override
      public void run() {
        logger.debug("Refresh View");
        onEvent(UIEvent.REFRESH);
      }
    };
    refreshAction.setText("Refresh Result View");
    refreshAction.setImageDescriptor(Activator
        .getImageDescriptor("icons/refresh.png"));
    bars.getToolBarManager().add(refreshAction);
  }
View Full Code Here

Examples of org.eclipse.ui.IActionBars

  /**
   * 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

Examples of org.eclipse.ui.IActionBars

    if (null == part)
      return;
    activeEditorPart = part;

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

      MultiPageEditorPart editor = (MultiPageEditorPart) part;

      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

Examples of org.eclipse.ui.IActionBars

   *
   * @see org.eclipse.ui.part.MultiPageEditorActionBarContributor#setActivePage(org.eclipse.ui.IEditorPart)
   */
  public void setActivePage(IEditorPart part) {

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

      ITextEditor textEditor = (part instanceof XMLEditor) ? (ITextEditor) part : null;

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

Examples of org.eclipse.ui.IActionBars

  }
 
  @SuppressWarnings("rawtypes")
  private void refreshActionHandlers() {

    IActionBars actionBars = getSite().getActionBars();
    actionBars.clearGlobalActionHandlers();

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

Examples of org.eclipse.ui.IActionBars

    /**
     * We use this method to contribute some global actions from the ToolManager and
     * hook up a custom delete action that is willing to delete a layer.
     */
    private void setGlobalActions() {
        IActionBars actionBars = getViewSite().getActionBars();
       
        IToolManager toolManager = ApplicationGIS.getToolManager();
        toolManager.contributeGlobalActions(this, actionBars);
        toolManager.registerActionsWithPart(this);
       
        IKeyBindingService keyBindings = getSite().getKeyBindingService();
        IAction delAction = getDeleteAction();
        actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), delAction);
        keyBindings.registerAction(delAction);
    }
View Full Code Here

Examples of org.eclipse.ui.IActionBars

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

        // Set new actions.
        if( activeRec.subActionBars != null ){
            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

Examples of org.eclipse.ui.IActionBars

    public void createPartControl( Composite parent ) {
        super.createPartControl(parent);

        // enable printing
        IActionBars actionBars = getEditorSite().getActionBars();
        actionBars.setGlobalActionHandler(ActionFactory.PRINT.getId(), new PrintAction());
    }
View Full Code Here

Examples of org.eclipse.ui.IActionBars

         
          createContextMenu();
         
          if(acquireToolbar()) {
            toolManager = ApplicationGIS.getToolManager();
            IActionBars bars = getViewSite().getActionBars();
        IToolBarManager toolbarManager = bars.getToolBarManager();
            toolManager.contributeModalTools(toolbarManager, bars);
            toolbarManager.add(new Separator());
            toolManager.contributeActionTools(toolbarManager, bars);
            toolManager.setCurrentEditor(this);
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.