use of org.stepik.core.actions.StudyActionWithShortcut in project intellij-plugins by StepicOrg.
the class StudyProjectComponent method registerShortcuts.
private void registerShortcuts() {
StudyToolWindow window = StudyUtils.getStudyToolWindow(project);
if (window != null) {
List<AnAction> actionsOnToolbar = window.getActions(true);
if (actionsOnToolbar != null) {
actionsOnToolbar.stream().filter(action -> action instanceof StudyActionWithShortcut).map(action -> (StudyActionWithShortcut) action).forEach(action -> {
String id = action.getActionId();
String[] shortcuts = action.getShortcuts();
if (shortcuts != null) {
addShortcut(id, shortcuts);
}
});
} else {
logger.warn("Actions on toolbar are nulls");
}
}
}
Aggregations