aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/plugins
diff options
context:
space:
mode:
authorRaphaƫl Moll <ralf@android.com>2012-10-21 10:17:42 -0700
committerRaphael Moll <ralf@android.com>2012-10-22 11:34:29 -0700
commita39da6f152565726aaea41bc90d7e86f8759ba19 (patch)
tree18daa168833f4ffeb985310b6f2f153abd61bf27 /eclipse/plugins
parent8d2b76b49875cc01d8221d7dadece33554185603 (diff)
downloadsdk-a39da6f152565726aaea41bc90d7e86f8759ba19.zip
sdk-a39da6f152565726aaea41bc90d7e86f8759ba19.tar.gz
sdk-a39da6f152565726aaea41bc90d7e86f8759ba19.tar.bz2
SDK Manager: fix SWTMenuBar crash on MacOS X Mountain Lion.
The bug happens when the SDK Manager is open using the embedded class from within Eclipse 4.2 -- the SWT used is then the newer 3.7 which doesn't have the same cocoa interface for menus. The fix is threefold: - If the cocoa enhancer fails, revert to the generic one. This doesn't quite help here since the crash is actually when the native handler is invoked but the setup is fine. - Implement a new enhancer on top of the newer SWT 3.7 APIs that lets us access the About and Preference menus on Mac. That was the whole point of the enhancer workaround since SWT 3.5 an 3.6 don't have access to these menus directly. This new enhancer is used if SWT version 3700+ is used on Mac. - Finally the crash only happens when using the embedded version of the SDK Manager within ADT. When possible this uses the forked standalone version. It will still revert to the embedded one if ADT is started without any tools. The new enhancer for 3.7 on Mac is sub-optimal: since it *adds* a listener to the about/preference Mac menus, that means when it is invoked from within Eclipse these menus will generate 2 events, e.g. bringing both the Eclipse preferences and then the SDK Manager preferences. To support this case properly, we should detect this runs from within Eclipse, not change the about menu and instead integrate the sdk manager pref as a panel in eclipse's prefs. A cheaper workaround is to revert to the default generic enhancer that will create an options menu. Maybe for a later CL. SDK Bug: 38640 Change-Id: Ib1588e401616548a5dc9eb216d3c35b579d3950b
Diffstat (limited to 'eclipse/plugins')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java
index 9e17f0f..e08d7ea 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java
@@ -1197,14 +1197,13 @@ public class AdtPlugin extends AbstractUIPlugin implements ILogger {
}
private void openSdkManager() {
- // Windows only: open the standalone external SDK Manager since we know
+ // Open the standalone external SDK Manager since we know
// that ADT on Windows is bound to be locking some SDK folders.
- // Also when this is invoked becasue SdkManagerAction.run() fails, this
+ //
+ // Also when this is invoked because SdkManagerAction.run() fails, this
// test will fail and we'll fallback on using the internal one.
- if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_WINDOWS) {
- if (SdkManagerAction.openExternalSdkManager()) {
- return;
- }
+ if (SdkManagerAction.openExternalSdkManager()) {
+ return;
}
// Otherwise open the regular SDK Manager bundled within ADT