use of org.jetbrains.plugins.groovy.console.actions.GrSelectModuleAction in project intellij-community by JetBrains.
the class GroovyConsoleRootType method fileOpened.
@Override
public void fileOpened(@NotNull final VirtualFile file, @NotNull FileEditorManager source) {
final Project project = source.getProject();
final GroovyConsoleStateService projectConsole = GroovyConsoleStateService.getInstance(project);
for (FileEditor fileEditor : source.getAllEditors(file)) {
if (!(fileEditor instanceof TextEditor))
continue;
final Editor editor = ((TextEditor) fileEditor).getEditor();
final JPanel panel = new EditorHeaderComponent();
final DefaultActionGroup actionGroup = new DefaultActionGroup(EXECUTE_ACTION, new GrSelectModuleAction(projectConsole, file));
final ActionToolbar menu = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, actionGroup, true);
panel.add(menu.getComponent());
editor.setHeaderComponent(panel);
EXECUTE_ACTION.registerCustomShortcutSet(CommonShortcuts.CTRL_ENTER, editor.getComponent());
}
}
Aggregations