use of com.jetbrains.edu.learning.actions.StudyActionWithShortcut in project intellij-community by JetBrains.
the class StudyProjectComponent method registerShortcuts.
private void registerShortcuts() {
StudyToolWindow window = StudyUtils.getStudyToolWindow(myProject);
if (window != null) {
List<AnAction> actionsOnToolbar = window.getActions(true);
for (AnAction action : actionsOnToolbar) {
if (action instanceof StudyActionWithShortcut) {
String id = ((StudyActionWithShortcut) action).getActionId();
String[] shortcuts = ((StudyActionWithShortcut) action).getShortcuts();
if (shortcuts != null) {
addShortcut(id, shortcuts);
}
}
}
addShortcut(StudyNextWindowAction.ACTION_ID, new String[] { StudyNextWindowAction.SHORTCUT, StudyNextWindowAction.SHORTCUT2 });
addShortcut(StudyPrevWindowAction.ACTION_ID, new String[] { StudyPrevWindowAction.SHORTCUT });
}
}
Aggregations