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);
}
Aggregations