diff options
author | Tor Norbye <tnorbye@google.com> | 2014-09-04 13:24:04 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2014-09-04 13:24:04 -0700 |
commit | c3d3a90f6b4ead083d63e28e6b9fcea93d675678 (patch) | |
tree | fc0dcd722b6d445468dbe7dad13b4c11781b1cbe /python/edu/learn-python/src/com/jetbrains/python/edu/StudyTaskManager.java | |
parent | 1aa2e09bdbd413eacb677e9fa4b50630530d0656 (diff) | |
download | idea-c3d3a90f6b4ead083d63e28e6b9fcea93d675678.tar.gz |
Snapshot idea/138.1980 from git://git.jetbrains.org/idea/community.git
Change-Id: Ib567c9c152d770212a7a3db20fbf591c210920bd
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, |