diff options
author | Tor Norbye <tnorbye@google.com> | 2011-12-19 13:35:49 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2011-12-19 14:46:21 -0800 |
commit | 0dfb2056c7f71a7a448beb78e0b2d11f3822b3e2 (patch) | |
tree | 9962b8005021ebde55c54c2017643b9ac930e53f /eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common | |
parent | aeac6ced11a0d0544c55973f29e32a028e8c406e (diff) | |
download | sdk-0dfb2056c7f71a7a448beb78e0b2d11f3822b3e2.tar.gz |
Don't assign ids to all newly dropped widgets
This changeset makes the layout editor no longer assign default id's
to all newly dropped widgets. In particular, it no longer assigns id's
to *Layout widgets, such as LinearLayout and RelativeLayout. These
id's are typically unused, and in the case where you do want an id to
manipulate the widget you probably want to change it to some more
logical name than "linearLayout1" anyway. (It also stops assigning
id's to <include> tags, <merge> tags and <Space> widgets.)
It also changes the label of the "Edit ID..." context menu action to
"Assign ID..." for widgets that do not currently have an id.
Change-Id: Ibf0ec25a6a687e34d3eebf828251d196cadb9d54
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common')
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java index cb75b0c64..e7facf5b2 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java @@ -363,7 +363,9 @@ public class BaseViewRule extends AbstractViewRule { null, 10, true)); } - actions.add(RuleAction.createAction(ATTR_ID, "Edit ID...", onChange, null, 20, true)); + String editIdLabel = selectedNode.getStringAttr(ANDROID_URI, ATTR_ID) != null ? + "Edit ID..." : "Assign ID..."; + actions.add(RuleAction.createAction(ATTR_ID, editIdLabel, onChange, null, 20, true)); addCommonPropertyActions(actions, selectedNode, onChange, 21); |