Move update tool window method to StudyUtils

This commit is contained in:
Valentina Kiryushkina
2016-03-11 11:59:36 +03:00
parent 6c8f1a0aae
commit 4edf0fac79
2 changed files with 10 additions and 12 deletions
@@ -128,10 +128,9 @@ public class StudyUtils {
}
public static void updateToolWindows(@NotNull final Project project) {
final ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
StudyToolWindowFactory factory = new StudyToolWindowFactory();
factory.update(project);
update(project);
final ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
createProgressToolWindowContent(project, windowManager);
}
@@ -479,4 +478,12 @@ public class StudyUtils {
}
return null;
}
public static void update(Project project) {
final StudyToolWindow studyToolWindow = getStudyToolWindow(project);
if (studyToolWindow != null) {
String taskText = getTaskText(project);
studyToolWindow.setTaskText(taskText);
}
}
}
@@ -10,7 +10,6 @@ import com.intellij.ui.content.ContentManager;
import com.jetbrains.edu.courseFormat.Course;
import com.jetbrains.edu.learning.StudyProjectComponent;
import com.jetbrains.edu.learning.StudyTaskManager;
import com.jetbrains.edu.learning.StudyUtils;
import icons.InteractiveLearningIcons;
import org.jetbrains.annotations.NotNull;
@@ -39,12 +38,4 @@ public class StudyToolWindowFactory implements ToolWindowFactory, DumbAware {
Disposer.register(project, studyToolWindow);
}
}
public void update(Project project) {
final StudyToolWindow studyToolWindow = StudyUtils.getStudyToolWindow(project);
if (studyToolWindow != null) {
String taskText = StudyUtils.getTaskText(project);
studyToolWindow.setTaskText(taskText);
}
}
}