aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaphael Moll <ralf@android.com>2012-05-18 13:01:34 -0700
committerandroid code review <noreply-gerritcodereview@google.com>2012-05-18 13:01:34 -0700
commit3b5af5fe75e4f03352f178a1c98cb6a8990f24f4 (patch)
tree2da8ea8b025d4fc283113b728cbdb31a1ef16761
parent95bee010d37fc66e470861237e6d62a7989f9d41 (diff)
parentfd47d7cf39065ee72b3de3a671a59bae19f9cfec (diff)
downloadsdk-3b5af5fe75e4f03352f178a1c98cb6a8990f24f4.zip
sdk-3b5af5fe75e4f03352f178a1c98cb6a8990f24f4.tar.gz
sdk-3b5af5fe75e4f03352f178a1c98cb6a8990f24f4.tar.bz2
Merge "SDK Manager: display options menu when invoked from IDE."
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/META-INF/MANIFEST.MF3
-rwxr-xr-xeclipse/scripts/create_all_symlinks.sh2
-rwxr-xr-xsdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AvdManagerWindowImpl1.java55
-rwxr-xr-xsdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java10
4 files changed, 31 insertions, 39 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.adt/META-INF/MANIFEST.MF
index 42de1eb..427b176 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/META-INF/MANIFEST.MF
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/META-INF/MANIFEST.MF
@@ -17,7 +17,8 @@ Bundle-ClassPath: .,
libs/asm-4.0.jar,
libs/asm-tree-4.0.jar,
libs/propertysheet.jar,
- libs/ant-glob.jar
+ libs/ant-glob.jar,
+ libs/swtmenubar.jar
Bundle-Activator: com.android.ide.eclipse.adt.AdtPlugin
Bundle-Vendor: The Android Open Source Project
Require-Bundle: com.android.ide.eclipse.base,
diff --git a/eclipse/scripts/create_all_symlinks.sh b/eclipse/scripts/create_all_symlinks.sh
index e4af2bd..68481c1 100755
--- a/eclipse/scripts/create_all_symlinks.sh
+++ b/eclipse/scripts/create_all_symlinks.sh
@@ -124,7 +124,7 @@ CP_FILES="$CP_FILES @:$BASE_PLUGIN_DEST $BASE_PLUGIN_LIBS $BASE_PLUGIN_PREBUILTS
### ADT ###
ADT_DEST="sdk/eclipse/plugins/com.android.ide.eclipse.adt/libs"
-ADT_LIBS="layoutlib_api lint_api lint_checks ide_common rule_api ninepatch sdkuilib assetstudio propertysheet ant-glob"
+ADT_LIBS="ant-glob assetstudio ide_common layoutlib_api lint_api lint_checks ninepatch propertysheet rule_api sdkuilib swtmenubar"
ADT_PREBUILTS="\
prebuilts/misc/common/kxml2/kxml2-2.3.0.jar \
prebuilts/tools/common/asm-tools/asm-4.0.jar \
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AvdManagerWindowImpl1.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AvdManagerWindowImpl1.java
index 74c061f..0070097 100755
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AvdManagerWindowImpl1.java
+++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AvdManagerWindowImpl1.java
@@ -178,6 +178,11 @@ public class AvdManagerWindowImpl1 {
@SuppressWarnings("unused") // MenuBarWrapper works using side effects
private void createMenuBar() {
+ // Only create the menu when running as standalone.
+ // We don't need the menu when invoked from the IDE, or the SDK Manager
+ // or from the AVD Chooser dialog. The only point of the menu is to
+ // get the about box, and invoke Tools > SDK Manager, which we don't
+ // need to do in these cases.
if (mContext != AvdInvocationContext.STANDALONE) {
return;
}
@@ -200,38 +205,30 @@ public class AvdManagerWindowImpl1 {
}
});
- if (mContext != AvdInvocationContext.IDE) {
- // Note: when invoked from an IDE, the SwtMenuBar library isn't
- // available. This means this source should not directly import
- // any of SwtMenuBar classes, otherwise the whole window class
- // would fail to load. The MenuBarWrapper below helps to make
- // that indirection.
-
- try {
- new MenuBarWrapper(APP_NAME_MAC_MENU, menuTools) {
- @Override
- public void onPreferencesMenuSelected() {
- SettingsDialog sd = new SettingsDialog(mShell, mUpdaterData);
- sd.open();
- }
+ try {
+ new MenuBarWrapper(APP_NAME_MAC_MENU, menuTools) {
+ @Override
+ public void onPreferencesMenuSelected() {
+ SettingsDialog sd = new SettingsDialog(mShell, mUpdaterData);
+ sd.open();
+ }
- @Override
- public void onAboutMenuSelected() {
- AboutDialog ad = new AboutDialog(mShell, mUpdaterData);
- ad.open();
- }
+ @Override
+ public void onAboutMenuSelected() {
+ AboutDialog ad = new AboutDialog(mShell, mUpdaterData);
+ ad.open();
+ }
- @Override
- public void printError(String format, Object... args) {
- if (mUpdaterData != null) {
- mUpdaterData.getSdkLog().error(null, format, args);
- }
+ @Override
+ public void printError(String format, Object... args) {
+ if (mUpdaterData != null) {
+ mUpdaterData.getSdkLog().error(null, format, args);
}
- };
- } catch (Exception e) {
- mUpdaterData.getSdkLog().error(e, "Failed to setup menu bar");
- e.printStackTrace();
- }
+ }
+ };
+ } catch (Throwable e) {
+ mUpdaterData.getSdkLog().error(e, "Failed to setup menu bar");
+ e.printStackTrace();
}
}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java
index 9a7ffe1..7a7a5b3 100755
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java
+++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java
@@ -320,13 +320,7 @@ public class SdkUpdaterWindowImpl2 implements ISdkUpdaterWindow {
mPkgPage.registerMenuAction(
MenuAction.SHOW_ADDON_SITES, manageSources);
- if (mContext == SdkInvocationContext.STANDALONE) {
- // Note: when invoked from an IDE, the SwtMenuBar library isn't
- // available. This means this source should not directly import
- // any of SwtMenuBar classes, otherwise the whole window class
- // would fail to load. The MenuBarWrapper below helps to make
- // that indirection.
-
+ if (mContext == SdkInvocationContext.STANDALONE || mContext == SdkInvocationContext.IDE) {
try {
new MenuBarWrapper(APP_NAME, menuTools) {
@Override
@@ -348,7 +342,7 @@ public class SdkUpdaterWindowImpl2 implements ISdkUpdaterWindow {
}
}
};
- } catch (Exception e) {
+ } catch (Throwable e) {
mUpdaterData.getSdkLog().error(e, "Failed to setup menu bar");
e.printStackTrace();
}