Package org.eclipse.ui

Examples of org.eclipse.ui.IActionBars2


    }

    public Object execute( ExecutionEvent event ) throws ExecutionException {
        if (ID.equals(current)) {
            tool.reset();
            IActionBars2 actionBars = tool.getContext().getActionBars();
            if (actionBars == null) {
                return null;
            }
            final IStatusLineManager statusBar = actionBars.getStatusLineManager();
            if (statusBar != null) {
                tool.getContext().updateUI(new Runnable(){
                    public void run() {
                        statusBar.setErrorMessage(null);
                        statusBar.setMessage(null);
View Full Code Here


    private void setCursorAndMessage(final Cursor cursor, final String string, final EditToolHandler handler) {
        Runnable runnable = new Runnable(){
            public void run() {
                if( PlatformUI.getWorkbench().isClosing() )
                    return;
                IActionBars2 bars = handler.getContext().getActionBars();
                if (bars!=null){
                    bars.getStatusLineManager().setErrorMessage(null);
                    bars.getStatusLineManager().setMessage(string);
                }
                handler.getContext().getViewportPane().setCursor(cursor);
               
            }
        };
View Full Code Here

   
    private IAction oldAction;
    private DeleteVertexHandler deleteVertexHandler;

    public void activate( EditToolHandler handler ) {
        IActionBars2 actionBars = handler.getContext().getActionBars();
        if( actionBars==null )
            return;
        IWorkbenchPart part=(IWorkbenchPart) ApplicationGISInternal.getActiveEditor();
       
        if( part == null ) return;
       
        oldAction=ApplicationGIS.getToolManager().getDELETEAction();
        IKeyBindingService keyBindingService = part.getSite().getKeyBindingService();
        if( oldAction!=null )
            keyBindingService.unregisterAction(oldAction);

        deleteVertexHandler = new DeleteVertexHandler(handler);
        if( oldAction!=null ){
            deleteVertexHandler.setImageDescriptor(oldAction.getImageDescriptor());
            deleteVertexHandler.setDisabledImageDescriptor(oldAction.getDisabledImageDescriptor());
        }
        ApplicationGIS.getToolManager().setDELETEAction(deleteVertexHandler,part);
        actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), deleteVertexHandler);
        actionBars.updateActionBars();
        keyBindingService.registerAction(deleteVertexHandler);
    }
View Full Code Here

        actionBars.updateActionBars();
        keyBindingService.registerAction(deleteVertexHandler);
    }

    public void deactivate( EditToolHandler handler ) {
        IActionBars2 actionBars = handler.getContext().getActionBars();
        if( actionBars==null || oldAction==null ){
            return;
        }
        IWorkbenchPart part=ApplicationGISInternal.getActiveEditor();
       
        if( part == null ) return;
       
        IWorkbenchPartSite site = part.getSite();
       
        IKeyBindingService keyBindingService = site.getKeyBindingService();
        keyBindingService.unregisterAction(deleteVertexHandler);
        deleteVertexHandler=null;
       
        ApplicationGIS.getToolManager().setDELETEAction(oldAction,part);
        actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), oldAction);
        if( oldAction!=null ){
            keyBindingService.registerAction(oldAction);
        }
        oldAction=null;
       
        actionBars.updateActionBars();
    }
View Full Code Here

    @Override
    public RenderManager getRenderManagerInternal() {
        return getMapInternal().getRenderManagerInternal();
    }
    public IStatusLineManager getStatusBar() {
        IActionBars2 bars = getActionBars();
        if (bars == null)
            return null;
        return bars.getStatusLineManager();
    }
View Full Code Here

 
  /**
   * Creates an IActionBars2 as a wrapper of an IActionBars.
   */
  protected IActionBars2 getIActionBars2Wrapper(final IActionBars actionBars) {
    return new IActionBars2() {
      public ICoolBarManager getCoolBarManager() {
        return new CoolBarManager();
      }
      public void clearGlobalActionHandlers() {
        actionBars.clearGlobalActionHandlers();
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IActionBars2

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.