Examples of IHandler


Examples of org.eclipse.core.commands.IHandler

   *
   * @since 3.1
   */
    public final void activateHandler() {
    if (handlerActivation == null) {
      final IHandler handler = new ShowViewHandler(getId());
      final IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
      handlerActivation = handlerService
          .activateHandler(getId(), handler);
    }
    }
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

   * should be created.
   */
  void checkCreatePinEditorShortcutKeyHandler() {
    if (pinEditorHandlerActivation == null) {
      final Shell shell = window.getShell();
      final IHandler pinEditorHandler = new AbstractHandler() {
        public final Object execute(final ExecutionEvent event) {
          // check if the "Close editors automatically" preference is
          // set
          IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore();
          if (store
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

     * active workbench window is instantiated Eclipse RCP causes this
     * function to fail quietly, so we just don't set the already installed
     * flag true until after it is successful
     */
    ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
    final IHandler handler = this;
    selectionService.addSelectionListener(new ISelectionListener() {
      @Override
      public void selectionChanged(IWorkbenchPart part, ISelection selection) {
        fireHandlerChanged(new HandlerEvent(handler, true, false));
      }
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

    {
        IHandlerService handlerService = ( IHandlerService ) PlatformUI.getWorkbench().getAdapter(
            IHandlerService.class );
        if ( handlerService != null )
        {
            IHandler handler = new org.eclipse.core.commands.AbstractHandler()
            {
                public Object execute( ExecutionEvent event ) throws org.eclipse.core.commands.ExecutionException
                {
                    showPossibleCompletions();
                    return null;
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

    {
        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );
        if ( commandService != null )
        {
            IHandler handler = commandService.getCommand( action.getActionDefinitionId() ).getHandler();
            if ( handler instanceof ActionHandler )
            {
                ActionHandler actionHandler = ( ActionHandler ) handler;
                if ( actionHandler != null && actionHandler.getAction() == action )
                {
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

    {
        IHandlerService handlerService = ( IHandlerService ) PlatformUI.getWorkbench().getAdapter(
            IHandlerService.class );
        if ( handlerService != null )
        {
            IHandler handler = new org.eclipse.core.commands.AbstractHandler()
            {
                public Object execute( ExecutionEvent event ) throws org.eclipse.core.commands.ExecutionException
                {
                    showPossibleCompletions();
                    return null;
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

     
      if(handlerActivation != null) {
        handlerService.deactivateHandler(handlerActivation);
        handlerActivation = null;
      }
      IHandler handler = getHandler(textEditor);
      if(handler != null) {
        handlerActivation = handlerService.activateHandler(commandId, handler);
      }
    }
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

      final Expression expression = new ActiveShellExpression(shell);
      for (Iterator iterator = handlersByCommandId.entrySet().iterator(); iterator
          .hasNext();) {
        Map.Entry entry = (Map.Entry) iterator.next();
        String commandId = (String) entry.getKey();
        IHandler handler = (IHandler) entry.getValue();
        newHandlers.add(handlerService.activateHandler(commandId,
            handler, expression));
      }
    }
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

   */
  public final IHandler getHandler(String commandId) {
    if (fHandlers == null)
      throw new IllegalStateException();

    IHandler handler= (IHandler)fHandlers.get(commandId);
    if (handler != null)
      return handler;

    Assert.isLegal(false);
    return null;
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

  private void activateHandler() {
    IHandlerService handlerService= (IHandlerService)PlatformUI.getWorkbench().getAdapter(IHandlerService.class);
    if (handlerService == null)
      return;

    IHandler handler= new AbstractHandler() {
      public Object execute(ExecutionEvent event) throws ExecutionException {
        if (ContentAssistHandler.this.isEnabled()) // don't call AbstractHandler#isEnabled()!
          fContentAssistant.showPossibleCompletions();
        return 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.