diff --git a/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java b/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java index d9d147a4dac0..8f19594a801a 100644 --- a/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java +++ b/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java @@ -130,9 +130,9 @@ public class IdeEventQueue extends EventQueue { private final Set myDispatchers = new LinkedHashSet(); - private final Set myPostprocessors = new LinkedHashSet(); - + private final Set myPostProcessors = new LinkedHashSet(); private final Set myReady = new HashSet(); + private boolean myKeyboardBusy; private boolean myDispatchingFocusEvent; @@ -148,16 +148,14 @@ public class IdeEventQueue extends EventQueue { private IdeEventQueue() { addIdleTimeCounterRequest(); - final KeyboardFocusManager keyboardFocusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager(); - //noinspection HardCodedStringLiteral + final KeyboardFocusManager keyboardFocusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager(); keyboardFocusManager.addPropertyChangeListener("permanentFocusOwner", new PropertyChangeListener() { @Override public void propertyChange(final PropertyChangeEvent e) { final Application application = ApplicationManager.getApplication(); if (application == null) { - // We can get focus event before application is initialized return; } @@ -171,6 +169,12 @@ public class IdeEventQueue extends EventQueue { }); addDispatcher(new WindowsAltSupressor(), null); + + Application app = ApplicationManager.getApplication(); + if (app != null && app.isUnitTestMode()) { + //noinspection AssignmentToStaticFieldFromInstanceMethod + ourAppIsLoaded = true; + } } @@ -289,11 +293,11 @@ public class IdeEventQueue extends EventQueue { } public void addPostprocessor(EventDispatcher dispatcher, @Nullable Disposable parent) { - _addProcessor(dispatcher, parent, myPostprocessors); + _addProcessor(dispatcher, parent, myPostProcessors); } public void removePostprocessor(EventDispatcher dispatcher) { - myPostprocessors.remove(dispatcher); + myPostProcessors.remove(dispatcher); } private static void _addProcessor(final EventDispatcher dispatcher, Disposable parent, final Set set) { @@ -383,7 +387,7 @@ public class IdeEventQueue extends EventQueue { myIsInInputEvent = wasInputEvent; myCurrentEvent = oldEvent; - for (EventDispatcher each : myPostprocessors) { + for (EventDispatcher each : myPostProcessors) { each.dispatch(e); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ModifierKeyDoubleClickHandlerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ModifierKeyDoubleClickHandlerTest.java index 96d85c122624..54a2865ad444 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ModifierKeyDoubleClickHandlerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ModifierKeyDoubleClickHandlerTest.java @@ -22,20 +22,19 @@ import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.KeyboardShortcut; import com.intellij.openapi.keymap.KeymapManager; import com.intellij.openapi.util.Clock; -import com.intellij.testFramework.LightPlatformTestCase; +import com.intellij.testFramework.LightPlatformLangTestCase; import javax.swing.*; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; -public class ModifierKeyDoubleClickHandlerTest extends LightPlatformTestCase { +public class ModifierKeyDoubleClickHandlerTest extends LightPlatformLangTestCase { private static final String MY_SHIFT_SHIFT_ACTION = "ModifierKeyDoubleClickHandlerTest.action1"; private static final String MY_SHIFT_KEY_ACTION = "ModifierKeyDoubleClickHandlerTest.action2"; private static final String MY_SHIFT_SHIFT_KEY_ACTION = "ModifierKeyDoubleClickHandlerTest.action3"; - public static final KeyboardShortcut SHIFT_KEY_SHORTCUT = new KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, - InputEvent.SHIFT_MASK), - null); + private static final KeyboardShortcut SHIFT_KEY_SHORTCUT = + new KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, InputEvent.SHIFT_MASK), null); private final JComponent myComponent = new JPanel(); diff --git a/python/edu/build/paths.nsi b/python/edu/build/paths.nsi index 910f2b3555b7..5a49ea65d0aa 100644 --- a/python/edu/build/paths.nsi +++ b/python/edu/build/paths.nsi @@ -1,5 +1,5 @@ ; Installer images -!define IMAGES_LOCATION ${COMMUNITY_DIR}\python\build\resources +!define IMAGES_LOCATION ${COMMUNITY_DIR}\python\build\edu\resources ;!define LICENSE_FILE ${BASE_DIR}\python\license\PyCharm_Preview_License !define PRODUCT_PROPERTIES_FILE ${BASE_DIR}\out\pycharmEDU\layout\bin\idea.properties !define PRODUCT_VM_OPTIONS_NAME pycharm.exe.vmoptions diff --git a/python/edu/build/resources/edulogo.bmp b/python/edu/build/resources/logo.bmp similarity index 100% rename from python/edu/build/resources/edulogo.bmp rename to python/edu/build/resources/logo.bmp diff --git a/python/edu/build/strings.nsi b/python/edu/build/strings.nsi index 649fed1c4f80..fa10d421024c 100644 --- a/python/edu/build/strings.nsi +++ b/python/edu/build/strings.nsi @@ -4,7 +4,7 @@ !define PRODUCT_EXE_FILE "pycharm.exe" !define PRODUCT_ICON_FILE "PC_instCom.ico" !define PRODUCT_UNINST_ICON_FILE "PC_uninstCom.ico" -!define PRODUCT_LOGO_FILE "edulogo.bmp" +!define PRODUCT_LOGO_FILE "logo.bmp" !define PRODUCT_HEADER_FILE "headerlogo.bmp" ; if SHOULD_SET_DEFAULT_INSTDIR != 0 then default installation directory will be directory where highest-numbered PyCharm build has been installed diff --git a/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyCheckAction.java b/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyCheckAction.java index eef2d00237b5..79e7325f5320 100644 --- a/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyCheckAction.java +++ b/python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyCheckAction.java @@ -15,9 +15,7 @@ import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.project.DumbAwareAction; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.MessageType; -import com.intellij.openapi.ui.popup.Balloon; -import com.intellij.openapi.ui.popup.BalloonBuilder; -import com.intellij.openapi.ui.popup.JBPopupFactory; +import com.intellij.openapi.ui.popup.*; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.wm.IdeFocusManager; @@ -185,7 +183,6 @@ public class StudyCheckAction extends DumbAwareAction { IdeFocusManager.getInstance(project).requestFocus(editorToNavigate.getContentComponent(), true); } }); - taskFileToNavigate.navigateToFirstFailedTaskWindow(editor); } @@ -253,12 +250,17 @@ public class StudyCheckAction extends DumbAwareAction { private static void createTestResultPopUp(final String text, Color color, @NotNull final Project project) { BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(text, null, color, null); - Balloon balloon = balloonBuilder.createBalloon(); + final Balloon balloon = balloonBuilder.createBalloon(); StudyEditor studyEditor = StudyEditor.getSelectedStudyEditor(project); assert studyEditor != null; JButton checkButton = studyEditor.getCheckButton(); balloon.showInCenterOf(checkButton); - Disposer.dispose(balloon); + balloon.addListener(new JBPopupAdapter() { + @Override + public void onClosed(LightweightWindowEvent event) { + Disposer.dispose(balloon); + } + }); } @Override