aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2011-02-08 12:17:33 -0800
committerTor Norbye <tnorbye@google.com>2011-02-08 12:17:33 -0800
commit523c97de99580f005611d982df0459324267cf1b (patch)
treee12ee995e5ede1f6606c2700ff35d7b829265396 /eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api
parent3affb7747350f449529260744f37e0274f8fac50 (diff)
downloadsdk-523c97de99580f005611d982df0459324267cf1b.zip
sdk-523c97de99580f005611d982df0459324267cf1b.tar.gz
sdk-523c97de99580f005611d982df0459324267cf1b.tar.bz2
Layout Actions bar fixes
This changeset fixes a couple of layout actions bar issues: (1) Refresh the actions bar after running one of the layout actions. This for example fixes the issue that if you click to toggle the layout orientation then the baseline button will appear for horizontal layouts. (2) Fix an issue with the lazy-initialization of dropdown menus; they weren't actually initialized lazily because the code to determine whether a choice list should be a dropdown or a radio group would cause initialization. (3) Fix layout gravity on RelativeLayouts; it was reading/writing the attribute "layout_gravity" instead of "gravity". Change-Id: Ic41158257b3938a2e6daa8714dcd15d6bf21fa2f
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api')
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/MenuAction.java25
1 files changed, 23 insertions, 2 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/MenuAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/MenuAction.java
index e54ae36..3e912f8 100755
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/MenuAction.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/MenuAction.java
@@ -121,7 +121,7 @@ public abstract class MenuAction implements Comparable<MenuAction> {
return action;
}
- public static MenuAction createChoices(String id, String title, String groupId,
+ public static OrderedChoices createChoices(String id, String title, String groupId,
IMenuCallback callback, List<String> titles, List<URL> iconUrls, List<String> ids,
String current, URL iconUrl, int sortPriority) {
OrderedChoices choices = new OrderedChoices(id, title, groupId, callback, titles, iconUrls,
@@ -131,7 +131,7 @@ public abstract class MenuAction implements Comparable<MenuAction> {
return choices;
}
- public static MenuAction createChoices(String id, String title, String groupId,
+ public static OrderedChoices createChoices(String id, String title, String groupId,
IMenuCallback callback, ChoiceProvider provider,
String current, URL iconUrl, int sortPriority) {
OrderedChoices choices = new DelayedOrderedChoices(id, title, groupId, callback,
@@ -437,6 +437,7 @@ public abstract class MenuAction implements Comparable<MenuAction> {
protected List<String> mTitles;
protected List<URL> mIconUrls;
protected List<String> mIds;
+ private boolean mRadio;
/**
* One or more id for the checked choice(s) that will be check marked.
@@ -468,6 +469,26 @@ public abstract class MenuAction implements Comparable<MenuAction> {
public String getCurrent() {
return mCurrent;
}
+
+ /**
+ * Set whether this choice list is best visualized as a radio group (instead of a
+ * dropdown)
+ *
+ * @param radio true if this choice list should be visualized as a radio group
+ */
+ public void setRadio(boolean radio) {
+ mRadio = radio;
+ }
+
+ /**
+ * Returns true if this choice list is best visualized as a radio group (instead
+ * of a dropdown)
+ *
+ * @return true if this choice list should be visualized as a radio group
+ */
+ public boolean isRadio() {
+ return mRadio;
+ }
}
/** Provides the set of choices associated with an {@link OrderedChoices} object