EDU-543 IAE in StudyBrowser if several projects opened
authorLiana Bakradze <liana.bakradze@jetbrains.com>
Mon, 29 Feb 2016 12:34:40 +0000 (15:34 +0300)
committerLiana Bakradze <liana.bakradze@jetbrains.com>
Mon, 29 Feb 2016 12:34:40 +0000 (15:34 +0300)
python/educational-core/student/src/com/jetbrains/edu/learning/ui/StudyJavaFxToolWindow.java
python/educational-core/student/src/com/jetbrains/edu/learning/ui/StudySwingToolWindow.java
python/educational-core/student/src/com/jetbrains/edu/learning/ui/StudyToolWindow.java

index e740d3fba715dc227711c6e2f11de05e0a7720c0..873c987da77dc652e89fc6af9b5efebcbe69592f 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 package com.jetbrains.edu.learning.ui;
+import com.intellij.openapi.project.Project;
 import com.intellij.openapi.project.ProjectUtil;
 import com.jetbrains.edu.learning.StudyToolWindowConfigurator;
 import com.jetbrains.edu.learning.StudyUtils;
@@ -28,10 +29,10 @@ public class StudyJavaFxToolWindow extends StudyToolWindow {
   }
 
   @Override
-  public JComponent createTaskInfoPanel(String taskText) {
+  public JComponent createTaskInfoPanel(String taskText, Project project) {
     myBrowserWindow = new StudyBrowserWindow(true, false);
     myBrowserWindow.addBackAndOpenButtons();
-    myBrowserWindow.loadContent(taskText, StudyUtils.getConfigurator(ProjectUtil.guessCurrentProject(this)));
+    myBrowserWindow.loadContent(taskText, StudyUtils.getConfigurator(project));
     JPanel panel = new JPanel();
     panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
     panel.add(myBrowserWindow.getPanel());
index 56ca088e282ad6f9eacd964965ac1f5981d329e7..ae4914313f1084f42c2b68dfc1033642d6cd51f7 100644 (file)
@@ -16,6 +16,7 @@
 package com.jetbrains.edu.learning.ui;
 import com.intellij.openapi.editor.colors.EditorColorsManager;
 import com.intellij.openapi.editor.colors.EditorColorsScheme;
+import com.intellij.openapi.project.Project;
 import com.intellij.ui.BrowserHyperlinkListener;
 import com.intellij.ui.ColorUtil;
 import com.intellij.util.ui.UIUtil;
@@ -34,7 +35,7 @@ public class StudySwingToolWindow extends StudyToolWindow {
   }
 
   @Override
-  public JComponent createTaskInfoPanel(String taskText) {
+  public JComponent createTaskInfoPanel(String taskText, Project project) {
     myTaskTextPane = new JTextPane();
     myTaskTextPane.setContentType(new HTMLEditorKit().getContentType());
     final EditorColorsScheme editorColorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
index f9ebe579e376893d97b04b9e2b26e44d0c762a35..c03a621624e7e5fd616c85b487cfabe741e7e1d5 100644 (file)
@@ -63,7 +63,7 @@ public abstract class StudyToolWindow extends SimpleToolWindowPanel implements D
     JPanel toolbarPanel = createToolbarPanel(project);
     setToolbar(toolbarPanel);
 
-    myContentPanel.add(TASK_INFO_ID, createTaskInfoPanel(taskText));
+    myContentPanel.add(TASK_INFO_ID, createTaskInfoPanel(taskText, project));
     mySplitPane.setFirstComponent(myContentPanel);
     addAdditionalPanels(project);
     myCardLayout.show(myContentPanel, TASK_INFO_ID);
@@ -138,7 +138,7 @@ public abstract class StudyToolWindow extends SimpleToolWindowPanel implements D
     return null;
   }
   
-  public abstract JComponent createTaskInfoPanel(String taskText);
+  public abstract JComponent createTaskInfoPanel(String taskText, Project project);
 
   private static JPanel createToolbarPanel(@NotNull final Project project) {
     final DefaultActionGroup group = getActionGroup(project);