use of org.jetbrains.idea.maven.tasks.MavenShortcutsManager in project intellij-community by JetBrains.
the class AssignShortcutAction method getGoalActionId.
@Nullable
private static String getGoalActionId(DataContext context) {
final List<String> goals = MavenDataKeys.MAVEN_GOALS.getData(context);
if (goals == null || goals.size() != 1) {
return null;
}
MavenProject project = MavenActionUtil.getMavenProject(context);
if (project == null)
return null;
String goal = goals.get(0);
final MavenShortcutsManager shortcutsManager = getShortcutsManager(context);
String actionId = shortcutsManager != null ? shortcutsManager.getActionId(project.getPath(), goal) : null;
if (actionId != null) {
AnAction action = ActionManager.getInstance().getAction(actionId);
if (action == null) {
MavenKeymapExtension.getOrRegisterAction(project, actionId, goal);
}
}
return actionId;
}
Aggregations