Search in sources :

Example 1 with StudyActionWithShortcut

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 });
    }
}
Also used : StudyToolWindow(com.jetbrains.edu.learning.ui.StudyToolWindow) StudyActionWithShortcut(com.jetbrains.edu.learning.actions.StudyActionWithShortcut)

Aggregations

StudyActionWithShortcut (com.jetbrains.edu.learning.actions.StudyActionWithShortcut)1 StudyToolWindow (com.jetbrains.edu.learning.ui.StudyToolWindow)1