Package org.eclipse.ui

Examples of org.eclipse.ui.IActionBars


                saveAs();
            }
        };
        saveAsAction.setId(Messages.docView_saveAs);

        final IActionBars actionBars = getViewSite().getActionBars();
        final IMenuManager menuManager = actionBars.getMenuManager();
        menuManager.add(saveAsAction);
        menuManager.add( new Separator() );
       
        PropertyDialogAction resourcePropertyAction = new PropertyDialogAction( getSite(), resourceSelectionProvider )
        menuManager.add( resourcePropertyAction );
View Full Code Here


    this.runButton.setEnabled(false);
    this.loadButton.setEnabled(false);
    this.saveButton.setEnabled(false);

    // Create the menu on the toolbar
    IActionBars actionBars = getViewSite().getActionBars();
    IMenuManager viewMenu = actionBars.getMenuManager();

    viewMenu.add(runAction);
    viewMenu.add(loadAction);
    viewMenu.add(saveAction);
  }
View Full Code Here

    }


  @Override   
    protected void fillActionBars() {
        IActionBars actionBars = getViewSite().getActionBars();
        IToolBarManager toolBar = actionBars.getToolBarManager();
    
        IAction infoTool = ApplicationGIS.getToolManager().getToolAction(InfoTool.ID, InfoTool.CATEGORY_ID);
        assert( infoTool != null );
        if( toolBar != null ){
            toolBar.add( infoTool );
View Full Code Here

    }
    /**
    *
    */
   protected void fillViewMenu() {
       IActionBars actionBars = getViewSite().getActionBars();
       IMenuManager viewMenu = actionBars.getMenuManager();
      
       viewMenu.add( cancel );
       viewMenu.add(new Separator());
       for (ToggleOrientationAction toggle : toggleOrientationActions) {
           viewMenu.add( toggle );
View Full Code Here

   
    /**
     * Create toolbar with cancel.
     */
    protected void fillActionBars() {
        IActionBars actionBars = getViewSite().getActionBars();
        IToolBarManager toolBar = actionBars.getToolBarManager();

        toolBar.add( cancel );
    }
View Full Code Here

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

            final IActionBars global = getViewSite().getActionBars();
            actionBars = new IActionBars(){
                public void clearGlobalActionHandlers() {
                    global.clearGlobalActionHandlers();
                }

                public IAction getGlobalActionHandler( String actionId ) {
                    return global.getGlobalActionHandler(actionId);
                }

                public IMenuManager getMenuManager() {
                    return null;
                }

                public IStatusLineManager getStatusLineManager() {
                    return global.getStatusLineManager();
                }

                public IToolBarManager getToolBarManager() {
                    if (toolbarManager == null) {
                        toolbarManager = new ToolBarManager(){
                            public void update( boolean force ) {
                                super.update(force);
                                /*
                                 * IToolBarManager gtbm = global.getToolBarManager(); //remove all
                                 * the items in the config group IContributionItem[] items =
                                 * gtbm.getItems(); boolean remove = false; for (int i = 0; i <
                                 * items.length; i++) { if (items[i].isGroupMarker()) { GroupMarker
                                 * marker = (GroupMarker)items[i]; remove =
                                 * marker.getId().equals(CONFIG_MENU_GROUP); } else { if (remove) {
                                 * gtbm.remove(items[i]); } } } //add items to the config group
                                 * items = getItems(); for (int i = 0; i < items.length; i++) {
                                 * gtbm.appendToGroup(CONFIG_MENU_GROUP, items[i]); }
                                 * gtbm.update(false);
                                 */
                            }
                        };
                    }
                    return toolbarManager;
                }

                public void setGlobalActionHandler( String actionId, IAction handler ) {
                    global.setGlobalActionHandler(actionId, handler);
                }

                public void updateActionBars() {
                    global.updateActionBars();
                }

        public IServiceLocator getServiceLocator() {
          return global.getServiceLocator();
        }
            };
            return actionBars;
        }
View Full Code Here

     * @see org.eclipse.ui.part.IPage#setActionBars(org.eclipse.ui.IActionBars)
     */
    public void setActionBars(IActionBars actionBars) {
        // Override the undo and redo global action handlers
        // to use the contributor action handlers
        IActionBars partActionBars = null;
        if (contributor instanceof IEditorPart) {
            IEditorPart editorPart = (IEditorPart) contributor;
            partActionBars = editorPart.getEditorSite().getActionBars();
        } else if (contributor instanceof IViewPart) {
            IViewPart viewPart = (IViewPart) contributor;
            partActionBars = viewPart.getViewSite().getActionBars();
        }

        if (partActionBars != null) {
            IAction action = partActionBars.getGlobalActionHandler(ActionFactory.UNDO.getId());
            if (action != null) {
                actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), action);
            }
            action = partActionBars.getGlobalActionHandler(ActionFactory.REDO.getId());
            if (action != null) {
                actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), action);
            }
        }
    }
View Full Code Here

       
        IWorkbenchPart activePart = activePage.getActivePart();
        if( activePart==null )
            return;
       
        IActionBars actionBars;
        if( activePart instanceof IViewPart ){
            actionBars=((IViewPart)activePart).getViewSite().getActionBars();
        }else if( activePart instanceof IEditorPart ){
            actionBars=((IEditorPart)activePart).getEditorSite().getActionBars();
        }else{
            return;
        }

        if( newValidState ){
            actionBars.getStatusLineManager().setErrorMessage(null);
        }else{
            actionBars.getStatusLineManager().setErrorMessage(editor.getErrorMessage());
        }
    }
View Full Code Here

        data.top = new FormAttachment(control, 0);
        data.bottom = new FormAttachment(100, 0);
        tabFolder.setLayoutData(data);
       
        IViewSite site = getViewSite();
        IActionBars bars = site.getActionBars();
        IToolBarManager toolbarMgr = bars.getToolBarManager();
        toolbarMgr.add(getBackwardAction());
        toolbarMgr.add(getForwardAction());
        toolbarMgr.add(getRefreshAction());
        toolbarMgr.add(locationEntry.getButton());
View Full Code Here

    /**
     * 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 project.
     */
    private void setGlobalActions() {
        IActionBars actionBars = getViewSite().getActionBars();
       
        // register with the tool manager so the projects view will pass keybindings
        // over to the editor
        IToolManager toolManager = ApplicationGIS.getToolManager();
        toolManager.contributeGlobalActions(this, actionBars);
        toolManager.registerActionsWithPart(this);
       
        // except for the delete key we want that one for us
        IKeyBindingService keyBindings = getSite().getKeyBindingService();

        actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), delAction );
        keyBindings.registerAction(delAction);
    }
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.