Examples of ICommandService


Examples of org.eclipse.ui.commands.ICommandService

     * @param commandIDs
     */
    public static void refreshUIElements(final String[] commandIDs) {
        Utils.runSafeSWTAsync(log, new Runnable() {
            public void run() {
                ICommandService commandService = (ICommandService) PlatformUI
                    .getWorkbench().getActiveWorkbenchWindow()
                    .getService(ICommandService.class);

                if (commandService != null) {
                    for (String commandID : commandIDs) {
                        commandService.refreshElements(commandID, null);
                    }
                }
            }
        });
    }
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

    createDefaultPageViewer(composite);
    createDefaultPageButtonList(composite);
  }

  private void createDefaultPageLabel(Composite composite, int h_span) {
      final ICommandService commandSvc= (ICommandService) PlatformUI.getWorkbench().getAdapter(ICommandService.class);
    final Command command= commandSvc.getCommand(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
    ParameterizedCommand pCmd= new ParameterizedCommand(command, null);
    String key= getKeyboardShortcut(pCmd);
    if (key == null) {
      key= SSEUIMessages.CodeAssistAdvancedConfigurationBlock_no_shortcut;
    }
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

          modelQuery.setEditMode(newState);

          // Force a Refresh on this command so that the image can
          // be
          // updated.
          ICommandService commandService = (ICommandService) HandlerUtil.getActiveWorkbenchWindow(event).getService(ICommandService.class);
          Map filter = new HashMap();
          filter.put(IServiceScopes.WINDOW_SCOPE, HandlerUtil.getActiveWorkbenchWindow(event));
          commandService.refreshElements(event.getCommand().getId(), filter);
        }
      }
    }

    return null;
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

        } catch (CoreException e)
        {
          DestecsUIPlugin.log("Failed to upgrade project in action", e);
        }

        ICommandService cmdService = (ICommandService) HandlerUtil.getActiveSite(event).getService(ICommandService.class);
        Command upgradeCommand = cmdService.getCommand(IDestecsUiConstants.UPGRADE_LIBRARY_COMMANDID);
        if (upgradeCommand.isDefined())
        {
          try
          {
            upgradeCommand.executeWithChecks(event);
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

                .get( renameAction ) );
        }

        super.activateGlobalActionHandlers();

        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );
        if ( commandService != null )
        {
            IAction leid = ( IAction ) browserActionMap.get( locateEntryInDitAction );
            commandService.getCommand( leid.getActionDefinitionId() ).setHandler( new ActionHandler( leid ) );
        }

    }
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

            actionBars.setGlobalActionHandler( ActionFactory.MOVE.getId(), null );
        }

        super.deactivateGlobalActionHandlers();

        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );
        if ( commandService != null )
        {
            IAction leid = ( IAction ) browserActionMap.get( locateEntryInDitAction );
            commandService.getCommand( leid.getActionDefinitionId() ).setHandler( null );
        }

    }
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

    /**
     * Activates the action handlers.
     */
    public void activateGlobalActionHandlers()
    {
        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );

        if ( actionBars != null )
        {
            actionBars.setGlobalActionHandler( ActionFactory.REFRESH.getId(), ( IAction ) browserActionMap
                .get( refreshAction ) );
            actionBars.setGlobalActionHandler( ActionFactory.PROPERTIES.getId(), ( IAction ) browserActionMap
                .get( propertyDialogAction ) );
            actionBars.updateActionBars();
        }
        else
        {
            if ( commandService != null )
            {
                IAction pda = ( IAction ) browserActionMap.get( propertyDialogAction );
                pda.setActionDefinitionId( "org.apache.directory.ldapstudio.browser.action.properties" );
                commandService.getCommand( pda.getActionDefinitionId() ).setHandler( new ActionHandler( pda ) );

                IAction ra = ( IAction ) browserActionMap.get( refreshAction );
                commandService.getCommand( ra.getActionDefinitionId() ).setHandler( new ActionHandler( ra ) );
            }
        }

        if ( commandService != null )
        {
            IAction ua = ( IAction ) browserActionMap.get( upAction );
            commandService.getCommand( ua.getActionDefinitionId() ).setHandler( new ActionHandler( ua ) );
        }
    }
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

     * Deactivates the action handlers.
     */
    public void deactivateGlobalActionHandlers()
    {

        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );

        if ( actionBars != null )
        {
            actionBars.setGlobalActionHandler( ActionFactory.REFRESH.getId(), null );
            actionBars.setGlobalActionHandler( ActionFactory.PROPERTIES.getId(), null );
            actionBars.updateActionBars();
        }
        else
        {
            if ( commandService != null )
            {
                IAction pda = ( IAction ) browserActionMap.get( propertyDialogAction );
                commandService.getCommand( pda.getActionDefinitionId() ).setHandler( null );

                IAction ra = ( IAction ) browserActionMap.get( refreshAction );
                commandService.getCommand( ra.getActionDefinitionId() ).setHandler( null );
            }
        }

        if ( commandService != null )
        {
            IAction ua = ( IAction ) browserActionMap.get( upAction );
            commandService.getCommand( ua.getActionDefinitionId() ).setHandler( null );
        }

    }
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

     */
    public void activateGlobalActionHandlers()
    {
        super.activateGlobalActionHandlers();

        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );
        if ( commandService != null )
        {
            IAction naa = ( IAction ) entryEditorActionMap.get( newAttributeAction );
            commandService.getCommand( naa.getActionDefinitionId() ).setHandler( new ActionHandler( naa ) );
            IAction eada = ( IAction ) entryEditorActionMap.get( editAttributeDescriptionAction );
            commandService.getCommand( eada.getActionDefinitionId() ).setHandler( new ActionHandler( eada ) );
        }
    }
View Full Code Here

Examples of org.eclipse.ui.commands.ICommandService

     */
    public void deactivateGlobalActionHandlers()
    {
        super.deactivateGlobalActionHandlers();

        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );
        if ( commandService != null )
        {
            IAction naa = ( IAction ) entryEditorActionMap.get( newAttributeAction );
            commandService.getCommand( naa.getActionDefinitionId() ).setHandler( null );
            IAction eada = ( IAction ) entryEditorActionMap.get( editAttributeDescriptionAction );
            commandService.getCommand( eada.getActionDefinitionId() ).setHandler( null );
        }
    }
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.