use of com.intellij.openapi.keymap.impl.ui.EditKeymapsDialog in project intellij-community by JetBrains.
the class AssignShortcutAction method actionPerformed.
public void actionPerformed(@NotNull AnActionEvent e) {
final DataContext context = e.getDataContext();
String actionId = getGoalActionId(context);
if (actionId != null) {
new EditKeymapsDialog(MavenActionUtil.getProject(context), actionId).show();
}
}
use of com.intellij.openapi.keymap.impl.ui.EditKeymapsDialog in project intellij-community by JetBrains.
the class AssignRunConfigurationShortcutAction method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
Project project = getProject(e);
assert project != null;
final List<ExternalSystemNode> selectedNodes = ExternalSystemDataKeys.SELECTED_NODES.getData(e.getDataContext());
if (selectedNodes == null || selectedNodes.size() != 1 || !(selectedNodes.get(0) instanceof RunConfigurationNode))
return;
RunnerAndConfigurationSettings settings = ((RunConfigurationNode) selectedNodes.get(0)).getSettings();
assert settings != null;
ExternalSystemRunConfiguration runConfiguration = (ExternalSystemRunConfiguration) settings.getConfiguration();
String actionIdPrefix = getActionPrefix(project, runConfiguration.getSettings().getExternalProjectPath());
String actionId = actionIdPrefix + settings.getName();
AnAction action = ActionManager.getInstance().getAction(actionId);
if (action == null) {
ExternalSystemKeymapExtension.getOrRegisterAction(project, settings);
}
new EditKeymapsDialog(project, actionId).show();
}
use of com.intellij.openapi.keymap.impl.ui.EditKeymapsDialog in project intellij-community by JetBrains.
the class AssignShortcutAction method perform.
@Override
protected void perform(@NotNull Project project, @NotNull ProjectSystemId projectSystemId, @NotNull TaskData taskData, @NotNull AnActionEvent e) {
final ExternalSystemShortcutsManager shortcutsManager = ExternalProjectsManager.getInstance(project).getShortcutsManager();
final String actionId = shortcutsManager.getActionId(taskData.getLinkedExternalProjectPath(), taskData.getName());
if (actionId != null) {
AnAction action = ActionManager.getInstance().getAction(actionId);
if (action == null) {
ExternalSystemNode<?> taskNode = ContainerUtil.getFirstItem(ExternalSystemDataKeys.SELECTED_NODES.getData(e.getDataContext()));
assert taskNode != null;
final String group;
final ModuleNode moduleDataNode = taskNode.findParent(ModuleNode.class);
if (moduleDataNode != null) {
ModuleData moduleData = moduleDataNode.getData();
group = moduleData != null ? moduleData.getInternalName() : null;
} else {
ProjectNode projectNode = taskNode.findParent(ProjectNode.class);
ProjectData projectData = projectNode != null ? projectNode.getData() : null;
group = projectData != null ? projectData.getInternalName() : null;
}
if (group != null) {
ExternalSystemKeymapExtension.getOrRegisterAction(project, group, taskData);
}
}
new EditKeymapsDialog(project, actionId).show();
}
}
Aggregations