From d3089ba17973bfcee3ab0c7b7f135deed64fd7f0 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Thu, 21 Aug 2014 13:22:35 +0400 Subject: [PATCH 1/6] Cleanup (formatting) --- .../keymap/impl/ModifierKeyDoubleClickHandlerTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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..8f1a14c7481a 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 @@ -33,9 +33,8 @@ public class ModifierKeyDoubleClickHandlerTest extends LightPlatformTestCase { 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(); From c10d966c082885bcc550906c2ff4f95911e249eb Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Thu, 21 Aug 2014 14:09:49 +0400 Subject: [PATCH 2/6] platform: fix for click-handler tests --- .../platform-impl/src/com/intellij/ide/IdeEventQueue.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java b/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java index d9d147a4dac0..8b23e7b2361c 100644 --- a/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java +++ b/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java @@ -171,6 +171,12 @@ public class IdeEventQueue extends EventQueue { }); addDispatcher(new WindowsAltSupressor(), null); + + Application app = ApplicationManager.getApplication(); + if (app != null && app.isUnitTestMode()) { + //noinspection AssignmentToStaticFieldFromInstanceMethod + ourAppIsLoaded = true; + } } From e3701de93f27b99b3814c35b8152c218a46e03a1 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Thu, 21 Aug 2014 14:12:22 +0400 Subject: [PATCH 3/6] Cleanup (formatting; typo) --- .../src/com/intellij/ide/IdeEventQueue.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java b/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java index 8b23e7b2361c..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; } @@ -295,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) { @@ -389,7 +387,7 @@ public class IdeEventQueue extends EventQueue { myIsInInputEvent = wasInputEvent; myCurrentEvent = oldEvent; - for (EventDispatcher each : myPostprocessors) { + for (EventDispatcher each : myPostProcessors) { each.dispatch(e); } From 90d68d86394a9295a3c3ea7e0c032812f5e63245 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Thu, 21 Aug 2014 14:13:21 +0400 Subject: [PATCH 4/6] tests: test allowed to run on module classpath --- .../keymap/impl/ModifierKeyDoubleClickHandlerTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 8f1a14c7481a..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,13 +22,13 @@ 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"; From c607a6721e4bcb28c7de316923556ff2b9252acb Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Thu, 21 Aug 2014 12:22:08 +0200 Subject: [PATCH 5/6] Fixed path to edu resources. --- python/edu/build/paths.nsi | 2 +- .../edu/build/resources/{edulogo.bmp => logo.bmp} | Bin python/edu/build/strings.nsi | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename python/edu/build/resources/{edulogo.bmp => logo.bmp} (100%) 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 From 7a9cd4167792e28c243a7a69acbefb1f60245f3b Mon Sep 17 00:00:00 2001 From: Liana Bakradze Date: Thu, 21 Aug 2014 15:15:50 +0400 Subject: [PATCH 6/6] test result popup immediate hiding fixed --- .../python/edu/actions/StudyCheckAction.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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