Search in sources :

Example 26 with DefaultActionGroup

use of org.eclipse.che.ide.api.action.DefaultActionGroup in project che by eclipse.

the class MavenExtension method prepareActions.

@Inject
private void prepareActions(ActionManager actionManager, DependencyResolverAction dependencyResolverAction, GetEffectivePomAction getEffectivePomAction, ReimportMavenDependenciesAction reimportMavenDependenciesAction) {
    // register actions
    actionManager.registerAction("getEffectivePom", getEffectivePomAction);
    actionManager.registerAction("reimportMavenDependenciesAction", reimportMavenDependenciesAction);
    // add actions in main menu
    DefaultActionGroup assistantGroup = (DefaultActionGroup) actionManager.getAction(GROUP_ASSISTANT);
    assistantGroup.add(getEffectivePomAction, Constraints.LAST);
    // create maven context menu
    DefaultActionGroup mavenContextMenuGroup = new DefaultActionGroup(MAVEN_GROUP_CONTEXT_MENU_NAME, true, actionManager);
    actionManager.registerAction(MAVEN_GROUP_CONTEXT_MENU_ID, mavenContextMenuGroup);
    mavenContextMenuGroup.getTemplatePresentation().setSVGResource(resources.maven());
    // add maven context menu to main context menu
    DefaultActionGroup mainContextMenuGroup = (DefaultActionGroup) actionManager.getAction("resourceOperation");
    mainContextMenuGroup.addSeparator();
    mainContextMenuGroup.add(mavenContextMenuGroup, Constraints.LAST);
    // add actions in context menu
    mavenContextMenuGroup.add(reimportMavenDependenciesAction);
    mavenContextMenuGroup.addSeparator();
    // add resolver widget on right part of bottom panel
    final DefaultActionGroup rightStatusPanelGroup = (DefaultActionGroup) actionManager.getAction(GROUP_RIGHT_STATUS_PANEL);
    rightStatusPanelGroup.add(dependencyResolverAction);
}
Also used : DefaultActionGroup(org.eclipse.che.ide.api.action.DefaultActionGroup) Inject(com.google.inject.Inject)

Aggregations

DefaultActionGroup (org.eclipse.che.ide.api.action.DefaultActionGroup)26 Inject (com.google.inject.Inject)14 Action (org.eclipse.che.ide.api.action.Action)8 Icon (org.eclipse.che.ide.api.icon.Icon)5 KeyBuilder (org.eclipse.che.ide.api.keybinding.KeyBuilder)4 Machine (org.eclipse.che.api.core.model.machine.Machine)2 Constraints (org.eclipse.che.ide.api.constraints.Constraints)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 Map (java.util.Map)1 MachineConfig (org.eclipse.che.api.core.model.machine.MachineConfig)1 CloseActiveEditorAction (org.eclipse.che.ide.actions.CloseActiveEditorAction)1 CollapseAllAction (org.eclipse.che.ide.actions.CollapseAllAction)1 CompleteAction (org.eclipse.che.ide.actions.CompleteAction)1 ConvertFolderToProjectAction (org.eclipse.che.ide.actions.ConvertFolderToProjectAction)1 CreateProjectAction (org.eclipse.che.ide.actions.CreateProjectAction)1 DeleteResourceAction (org.eclipse.che.ide.actions.DeleteResourceAction)1 DownloadProjectAction (org.eclipse.che.ide.actions.DownloadProjectAction)1 DownloadResourceAction (org.eclipse.che.ide.actions.DownloadResourceAction)1