Package org.eclipse.jface.commands

Examples of org.eclipse.jface.commands.ActionHandler


        ApplicationUtils.showViewByID(DiskView.ID);
      }
    };
    showDiskViewAction.setImageDescriptor(Activator.getImageDescriptor("/icons/folderview_16.png"));
    showDiskViewAction.setActionDefinitionId("Jampa.showDiskView");
    handlerService.activateHandler("Jampa.showDiskView", new ActionHandler(showDiskViewAction));
   
    showLibraryViewAction = new Action(Messages.getString("Menu.Views.ShowLibraryView"), SWT.NONE) {
      public void run() {
        ApplicationUtils.showViewByID(LibraryView.ID);
      }
    };
    showLibraryViewAction.setImageDescriptor(Activator.getImageDescriptor("/icons/libraryview_16.png"));
    showLibraryViewAction.setActionDefinitionId("Jampa.showLibraryView");
    handlerService.activateHandler("Jampa.showLibraryView", new ActionHandler(showLibraryViewAction));
   
    showPlaylistsViewAction = new Action(Messages.getString("Menu.Views.ShowPlaylistsView"), SWT.NONE) {
      public void run() {
        ApplicationUtils.showViewByID(PlaylistOverview.ID);
      }
    };
    showPlaylistsViewAction.setImageDescriptor(Activator.getImageDescriptor("/icons/playlistoverview_16.png"));
    showPlaylistsViewAction.setActionDefinitionId("Jampa.showPlaylistOverview");
    handlerService.activateHandler("Jampa.showPlaylistOverview", new ActionHandler(showPlaylistsViewAction));
   
    showDefaultPlaylistViewAction = new Action(Messages.getString("Menu.Views.ShowDefaultPlaylistView"), SWT.NONE) {
      public void run() {
        ApplicationUtils.showViewByID(PlaylistView.ID, Constants.DEFAULT_PLAYLIST_ID);
      }
    };
    showDefaultPlaylistViewAction.setImageDescriptor(Activator.getImageDescriptor("/icons/playlist_16.png"));
    showDefaultPlaylistViewAction.setActionDefinitionId("Jampa.showDefaultPlaylist");
    handlerService.activateHandler("Jampa.showDefaultPlaylist", new ActionHandler(showDefaultPlaylistViewAction));
   
    showPodcastViewAction = new Action(Messages.getString("Menu.Views.ShowPodcastView"), SWT.NONE) {
      public void run() {
        ApplicationUtils.showViewByID(PodcastListView.ID);
      }
    };
    showPodcastViewAction.setImageDescriptor(Activator.getImageDescriptor("/icons/rss_list_16.png"));
    showPodcastViewAction.setActionDefinitionId("Jampa.showPodcastListView");
    handlerService.activateHandler("Jampa.showPodcastListView", new ActionHandler(showPodcastViewAction));
   
    showRadioViewAction = new Action(Messages.getString("Menu.Views.ShowRadioView"), SWT.NONE) {
      public void run() {
        ApplicationUtils.showViewByID(RadioView.ID);
      }
    };
    showRadioViewAction.setImageDescriptor(Activator.getImageDescriptor("/icons/radio_16.png"));
    showRadioViewAction.setActionDefinitionId("Jampa.showRadioView");
    handlerService.activateHandler("Jampa.showRadioView", new ActionHandler(showRadioViewAction));
   
    showPropertyViewAction = new Action(Messages.getString("Menu.Views.ShowPropertyView"), SWT.NONE) {
      public void run() {
        ApplicationUtils.showViewByID(PropertyView.ID);
      }
    };
    showPropertyViewAction.setImageDescriptor(Activator.getImageDescriptor("/icons/property_16.png"));
    showPropertyViewAction.setActionDefinitionId("Jampa.showPropertyView");
    handlerService.activateHandler("Jampa.showPropertyView", new ActionHandler(showPropertyViewAction));
   
    showControlsViewAction = new Action(Messages.getString("Menu.Views.ShowControlsView"), SWT.NONE) {
      public void run() {
        ApplicationUtils.showViewByID(PlayerView.ID);
      }
    };
    showControlsViewAction.setImageDescriptor(Activator.getImageDescriptor("/icons/playerview_16.png"));
    showControlsViewAction.setActionDefinitionId("Jampa.showPlayerView");
    handlerService.activateHandler("Jampa.showPlayerView", new ActionHandler(showControlsViewAction));
   
    showEqualizerViewAction = new Action(Messages.getString("Menu.Views.ShowEqualizerView"), SWT.NONE) {
      public void run() {
        ApplicationUtils.showViewByID(EqualizerView.ID);
      }
    };
    showEqualizerViewAction.setImageDescriptor(Activator.getImageDescriptor("/icons/equalizer_16.png"));
    showEqualizerViewAction.setActionDefinitionId("Jampa.showEqualizerView");
    handlerService.activateHandler("Jampa.showEqualizerView", new ActionHandler(showEqualizerViewAction));
   
    showStatisticsViewAction = new Action(Messages.getString("Menu.Views.ShowStatisticsView"), SWT.NONE) {
      public void run() {
        ApplicationUtils.showViewByID(StatisticView.ID);
      }
    };
    showStatisticsViewAction.setImageDescriptor(Activator.getImageDescriptor("/icons/stats_16.png"));
    showStatisticsViewAction.setActionDefinitionId("Jampa.showStatisticView");
    handlerService.activateHandler("Jampa.showStatisticView", new ActionHandler(showStatisticsViewAction));       
   
    showPreferencesWindowAction = ActionFactory.PREFERENCES.create(window);       
    showPreferencesWindowAction.setImageDescriptor(Activator.getImageDescriptor("/icons/preferences_16.png"));
    showPreferencesWindowAction.setActionDefinitionId("org.eclipse.ui.window.preferences");
    handlerService.activateHandler("org.eclipse.ui.window.preferences", new ActionHandler(showPreferencesWindowAction));
       
    savePerspectiveAction = ActionFactory.SAVE_PERSPECTIVE.create(window);
    savePerspectiveAction.setText(Messages.getString("Menu.Views.SavePerspective"));
   
    removePerspectiveAction = new Action(Messages.getString("Menu.Views.RemovePerspective"), SWT.NONE) {
View Full Code Here


        ApplicationUtils.showViewByID(SearchView.ID);
      }
    };
    showSearchViewAction.setImageDescriptor(Activator.getImageDescriptor("/icons/search_16.png"));
    showSearchViewAction.setActionDefinitionId("Jampa.showSearchView");
    handlerService.activateHandler("Jampa.showSearchView", new ActionHandler(showSearchViewAction));   
   
    manageExternalDevices = new Action(Messages.getString("Menu.Actions.ManageExternalDevices"), SWT.NONE) {
      public void run() {
        RemovableStorageDialog dialog = new RemovableStorageDialog(Display.getCurrent().getActiveShell());
        dialog.open();
      }
    };
    manageExternalDevices.setImageDescriptor(Activator.getImageDescriptor("/icons/folder_removable_16.png"));
    manageExternalDevices.setActionDefinitionId("Jampa.menuManageRemovableStorage");
    handlerService.activateHandler("Jampa.menuManageRemovableStorage", new ActionHandler(manageExternalDevices));
   
    updateLibrary = new Action(Messages.getString("Menu.Actions.UpdateLibrary"), SWT.NONE) {
      public void run() {
        Controller.getInstance().doUpdateLibrary();
      }
    };
    updateLibrary.setImageDescriptor(Activator.getImageDescriptor("/icons/scanplaylist_16.png"));
    updateLibrary.setActionDefinitionId("Jampa.updateLibrary");
    handlerService.activateHandler("Jampa.updateLibrary", new ActionHandler(updateLibrary));
   
    scanLibrary = new Action(Messages.getString("Menu.Actions.ScanLibrary"), SWT.NONE) {
      public void run() {
        Controller.getInstance().doScanLibrary();
      }
    };   
    scanLibrary.setActionDefinitionId("Jampa.scanLibrary");
    handlerService.activateHandler("Jampa.scanLibrary", new ActionHandler(scanLibrary));
  }
View Full Code Here

        new SetVolumeAction(Controller.getInstance().getPreferenceStore().getInt(PreferenceConstants.PLAYBACK_VOLUME) - 10).run();
      }
    };
    volumeDownAction.setImageDescriptor(Activator.getImageDescriptor("/icons/volumedown_16.png"));
    volumeDownAction.setActionDefinitionId("Jampa.menuVolumeDown");
    handlerService.activateHandler("Jampa.menuVolumeDown", new ActionHandler(volumeDownAction));
   
    volumeUpAction = new Action(Messages.getString("Menu.Actions.VolumeUp"), SWT.NONE) {
      public void run() {
        new SetVolumeAction(Controller.getInstance().getPreferenceStore().getInt(PreferenceConstants.PLAYBACK_VOLUME) + 10).run();
      }
    };
    volumeUpAction.setImageDescriptor(Activator.getImageDescriptor("/icons/volumeup_16.png"));
    volumeUpAction.setActionDefinitionId("Jampa.menuVolumeUp");
    handlerService.activateHandler("Jampa.menuVolumeUp", new ActionHandler(volumeUpAction));
   
    volumeMuteAction = new Action(Messages.getString("Menu.Actions.VolumeMute"), SWT.NONE) {
      public void run() {
        new VolumeMuteAction().run();
      }
    };
    volumeMuteAction.setImageDescriptor(Activator.getImageDescriptor("/icons/volumemute_16.png"));
    volumeMuteAction.setActionDefinitionId("Jampa.menuVolumeMute");
    handlerService.activateHandler("Jampa.menuVolumeMute", new ActionHandler(volumeMuteAction));
    volumeMuteAction.setEnabled(false);
   
    volume100Action = new Action(Messages.getString("Menu.Actions.Volume100"), SWT.NONE) {
      public void run() {
        new SetVolumeAction(100).run();
      }
    };
    volume100Action.setActionDefinitionId("Jampa.menuVolume100");
    handlerService.activateHandler("Jampa.menuVolume100", new ActionHandler(volume100Action));
   
    volume75Action = new Action(Messages.getString("Menu.Actions.Volume75"), SWT.NONE) {
      public void run() {
        new SetVolumeAction(75).run()
      }
    };
    volume75Action.setActionDefinitionId("Jampa.menuVolume75");
    handlerService.activateHandler("Jampa.menuVolume75", new ActionHandler(volume75Action));
   
    volume50Action = new Action(Messages.getString("Menu.Actions.Volume50"), SWT.NONE) {
      public void run() {
        new SetVolumeAction(50).run();
      }
    };
    volume50Action.setActionDefinitionId("Jampa.menuVolume50");
    handlerService.activateHandler("Jampa.menuVolume50", new ActionHandler(volume50Action));
   
    volume25Action = new Action(Messages.getString("Menu.Actions.Volume25"), SWT.NONE) {
      public void run() {
        new SetVolumeAction(25).run();
      }
    };
    volume25Action.setActionDefinitionId("Jampa.menuVolume25");
    handlerService.activateHandler("Jampa.menuVolume25", new ActionHandler(volume25Action));
   
    previousAction = new Action(Messages.getString("Menu.Actions.Previous"), SWT.NONE) {
      public void run() {
        new PlayPreviousAction().run();
      }
    };
    previousAction.setImageDescriptor(Activator.getImageDescriptor("/icons/previous_16.png"));
    previousAction.setActionDefinitionId("Jampa.menuPrevious");
    handlerService.activateHandler("Jampa.menuPrevious", new ActionHandler(previousAction));
    previousAction.setEnabled(false);
   
    stopAction = new Action(Messages.getString("Menu.Actions.Stop"), SWT.NONE) {
      public void run() {
        new StopAction().run();
      }
    };
    stopAction.setImageDescriptor(Activator.getImageDescriptor("/icons/stop_16.png"));
    stopAction.setActionDefinitionId("Jampa.menuStop");
    handlerService.activateHandler("Jampa.menuStop", new ActionHandler(stopAction));
    stopAction.setEnabled(false);
   
    pauseAction = new Action(Messages.getString("Menu.Actions.Pause"), SWT.NONE) {
      public void run() {
        new PauseAction().run();
      }
    };
    pauseAction.setImageDescriptor(Activator.getImageDescriptor("/icons/pause_16.png"));
    pauseAction.setActionDefinitionId("Jampa.menuPause");
    handlerService.activateHandler("Jampa.menuPause", new ActionHandler(pauseAction));
    pauseAction.setEnabled(false);
   
    nextAction = new Action(Messages.getString("Menu.Actions.Next"), SWT.NONE) {
      public void run() {
        new PlayNextAction().run();
      }
    };
    nextAction.setImageDescriptor(Activator.getImageDescriptor("/icons/next_16.png"));
    nextAction.setActionDefinitionId("Jampa.menuNext");
    handlerService.activateHandler("Jampa.menuNext", new ActionHandler(nextAction));
    nextAction.setEnabled(false);
  }
View Full Code Here

        new NewPlaylistAction(Display.getCurrent().getActiveShell()).run();
      }
    };
    newPlaylistAction.setImageDescriptor(Activator.getImageDescriptor("/icons/newplaylist_16.png"));
    newPlaylistAction.setActionDefinitionId("Jampa.newPlaylist");
    handlerService.activateHandler("Jampa.newPlaylist", new ActionHandler(newPlaylistAction));
   
    playlistGeneratorAction = new Action(Messages.getString("Menu.Playlists.PlaylistGenerator"), SWT.NONE) {
      public void run() {
        System.out.println("test2");
        PlaylistGeneratorWizard wizard = new PlaylistGeneratorWizard();
       
        WizardDialog wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
        wizardDialog.setPageSize(500, 200);
       
        if (wizardDialog.open() == Dialog.OK) {     
          Controller.getInstance().getPlaylistController().addEmptyPlaylist(wizard.getPlaylistName());
          Controller.getInstance().getPlaylistController().addItemToPlaylist(wizard.getPlaylistName(), wizard.getGenerator().getResults(), wizard.getPlay());
          new OpenPlaylistAction(wizard.getPlaylistName()).run();
        }
      }
    };
    playlistGeneratorAction.setActionDefinitionId("Jampa.playlistGeneratorWizard");
    handlerService.activateHandler("Jampa.playlistGeneratorWizard", new ActionHandler(playlistGeneratorAction));
   
    importPlaylistAction = new Action(Messages.getString("Menu.Playlists.ImportPlaylist"), SWT.NONE) {
      public void run() {
        PlaylistImportWizard wizard = new PlaylistImportWizard();
       
        WizardDialog wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
        wizardDialog.setPageSize(500, 100);
       
        if (wizardDialog.open() == Dialog.OK) {
          Log.getInstance(MenuController.class).debug("Importing file " + wizard.getFileName() + " to playlist: " + wizard.getPlaylistName()); //$NON-NLS-1$ //$NON-NLS-2$
          Controller.getInstance().getPlaylistController().importPlaylist(wizard.getPlaylistName(), wizard.getFileName());
        }
      }
    };
    importPlaylistAction.setActionDefinitionId("Jampa.playlistImportWizard");
    handlerService.activateHandler("Jampa.playlistImportWizard", new ActionHandler(importPlaylistAction));
   
    exportPlaylistAction = new Action(Messages.getString("Menu.Playlists.ExportPlaylist"), SWT.NONE) {
      public void run() {
        PlaylistExportWizard wizard = new PlaylistExportWizard();
       
        WizardDialog wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
        wizardDialog.setPageSize(500, 225);
           
        wizardDialog.open();
      }
    };
    exportPlaylistAction.setActionDefinitionId("Jampa.playlistExportWizard");
    handlerService.activateHandler("Jampa.playlistExportWizard", new ActionHandler(exportPlaylistAction));
   
    checkPlaylistsAction = new Action(Messages.getString("Menu.Playlists.CheckPlaylist"), SWT.NONE) {
      public void run() {
        CheckPlaylistsDialog dialog = new CheckPlaylistsDialog(Display.getCurrent().getActiveShell());
        dialog.open();
      }
    };
    checkPlaylistsAction.setImageDescriptor(Activator.getImageDescriptor("/icons/checkplaylists_16.png"));
    checkPlaylistsAction.setActionDefinitionId("Jampa.checkPlaylists");
    handlerService.activateHandler("Jampa.checkPlaylists", new ActionHandler(checkPlaylistsAction));
   
    exitAction = new Action(Messages.getString("Menu.Playlists.Exit"), SWT.NONE) {
      public void run() {
        window.close();
      }
    };   
    exitAction.setActionDefinitionId("Jampa.exit");
    handlerService.activateHandler("Jampa.exit", new ActionHandler(exitAction));
  }
View Full Code Here

    _actions = new ChangeDesignerStyleAction[] { verAction, horAction,
        designAction, sourceAction };
        _actionHandlers = new ArrayList<ActionHandler>();
    for (int i = 0; i < _actions.length; i++)
    {
          _actionHandlers.add(new ActionHandler(_actions[i]));
    }
    _handlers = new ArrayList<IHandlerActivation>();
  }
View Full Code Here

        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

        {
            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

        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

        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );
        if ( commandService != null )
        {
            IAction elaa = getAction( EditLdifAttributeAction.class.getName() );
            commandService.getCommand( elaa.getActionDefinitionId() ).setHandler( new ActionHandler( elaa ) );
            IAction elva = getAction( OpenDefaultValueEditorAction.class.getName() );
            commandService.getCommand( elva.getActionDefinitionId() ).setHandler( new ActionHandler( elva ) );
            IAction elra = getAction( EditLdifRecordAction.class.getName() );
            commandService.getCommand( elra.getActionDefinitionId() ).setHandler( new ActionHandler( elra ) );
        }
    }
View Full Code Here

        {
            if ( commandService != null )
            {
                IAction da = ( IAction ) entryEditorActionMap.get( deleteAction );
                da.setActionDefinitionId( "org.apache.directory.ldapstudio.browser.action.delete" );
                commandService.getCommand( da.getActionDefinitionId() ).setHandler( new ActionHandler( da ) );

                IAction ca = ( IAction ) entryEditorActionMap.get( copyAction );
                ca.setActionDefinitionId( "org.apache.directory.ldapstudio.browser.action.copy" );
                commandService.getCommand( ca.getActionDefinitionId() ).setHandler( new ActionHandler( ca ) );

                IAction pa = ( IAction ) entryEditorActionMap.get( pasteAction );
                pa.setActionDefinitionId( "org.apache.directory.ldapstudio.browser.action.paste" );
                commandService.getCommand( pa.getActionDefinitionId() ).setHandler( new ActionHandler( pa ) );

                showQuickFilterAction.setActionDefinitionId( "org.apache.directory.ldapstudio.browser.action.find" );
                commandService.getCommand( showQuickFilterAction.getActionDefinitionId() ).setHandler(
                    new ActionHandler( showQuickFilterAction ) );

                IAction pda = ( IAction ) entryEditorActionMap.get( propertyDialogAction );
                pda.setActionDefinitionId( "org.apache.directory.ldapstudio.browser.action.properties" );
                commandService.getCommand( pda.getActionDefinitionId() ).setHandler( new ActionHandler( pda ) );
            }
        }

        if ( commandService != null )
        {
            IAction nva = ( IAction ) entryEditorActionMap.get( newValueAction );
            commandService.getCommand( nva.getActionDefinitionId() ).setHandler( new ActionHandler( nva ) );
            commandService.getCommand( openDefaultValueEditorActionProxy.getActionDefinitionId() ).setHandler(
                new ActionHandler( openDefaultValueEditorActionProxy ) );
        }

    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.commands.ActionHandler

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.