diff options
Diffstat (limited to 'python/edu/learn-python/src/com/jetbrains/python/edu/StudyTaskManager.java')
-rw-r--r-- | python/edu/learn-python/src/com/jetbrains/python/edu/StudyTaskManager.java | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/python/edu/learn-python/src/com/jetbrains/python/edu/StudyTaskManager.java b/python/edu/learn-python/src/com/jetbrains/python/edu/StudyTaskManager.java index 213c1f7601f0..3013fbcb05d3 100644 --- a/python/edu/learn-python/src/com/jetbrains/python/edu/StudyTaskManager.java +++ b/python/edu/learn-python/src/com/jetbrains/python/edu/StudyTaskManager.java @@ -109,21 +109,29 @@ public class StudyTaskManager implements ProjectComponent, PersistentStateCompon StartupManager.getInstance(myProject).runWhenProjectIsInitialized(new Runnable() { @Override public void run() { - ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.PROJECT_VIEW).show(null); - FileEditor[] editors = FileEditorManager.getInstance(myProject).getSelectedEditors(); - if (editors.length > 0) { - JComponent focusedComponent = editors[0].getPreferredFocusedComponent(); - if (focusedComponent != null) { - IdeFocusManager.getInstance(myProject).requestFocus(focusedComponent, true); + ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.PROJECT_VIEW).show(new Runnable() { + @Override + public void run() { + FileEditor[] editors = FileEditorManager.getInstance(myProject).getSelectedEditors(); + if (editors.length > 0) { + final JComponent focusedComponent = editors[0].getPreferredFocusedComponent(); + if (focusedComponent != null) { + ApplicationManager.getApplication().invokeLater(new Runnable() { + @Override + public void run() { + IdeFocusManager.getInstance(myProject).requestFocus(focusedComponent, true); + } + }); + } + } } - } + }); } }); UISettings.getInstance().HIDE_TOOL_STRIPES = false; UISettings.getInstance().fireUISettingsChanged(); ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject); String toolWindowId = StudyToolWindowFactory.STUDY_TOOL_WINDOW; - //TODO:decide smth with tool window position try { Method method = toolWindowManager.getClass().getDeclaredMethod("registerToolWindow", String.class, JComponent.class, |