use of org.stepik.core.StudyPluginConfigurator in project intellij-plugins by StepicOrg.
the class StudyToolWindow method getActionGroup.
@NotNull
private static DefaultActionGroup getActionGroup(@NotNull final Project project) {
DefaultActionGroup group = new DefaultActionGroup();
if (!StepikProjectManager.isStepikProject(project)) {
logger.warn(project.getName() + " is not Stepik-project");
return group;
}
StudyPluginConfigurator configurator = StudyUtils.getConfigurator(project);
if (configurator != null) {
group.addAll(configurator.getActionGroup(project));
return group;
} else {
logger.warn("No configurator is provided for plugin");
return StudyBasePluginConfigurator.getDefaultActionGroup();
}
}
use of org.stepik.core.StudyPluginConfigurator in project intellij-plugins by StepicOrg.
the class StudyToolWindow method init.
void init(@NotNull final Project project) {
this.project = project;
final DefaultActionGroup group = getActionGroup(project);
setActionToolbar(group);
final JPanel panel = new JPanel(new BorderLayout());
JComponent stepInfoPanel = createStepInfoPanel(project);
panel.add(stepInfoPanel, BorderLayout.CENTER);
contentPanel.add(STEP_INFO_ID, panel);
splitPane.setFirstComponent(contentPanel);
addAdditionalPanels(project);
cardLayout.show(contentPanel, STEP_INFO_ID);
setContent(splitPane);
StudyPluginConfigurator configurator = StudyUtils.getConfigurator(project);
if (configurator != null) {
final FileEditorManagerListener listener = configurator.getFileEditorManagerListener(project);
project.getMessageBus().connect().subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, listener);
}
StudyNode<?, ?> stepNode = StepikProjectManager.getSelected(project);
setStepNode(stepNode);
}
Aggregations