OSDN Git Service

Support for editing id, text, string and reference properties
authorTor Norbye <tnorbye@google.com>
Wed, 5 Jan 2011 22:41:49 +0000 (14:41 -0800)
committerTor Norbye <tnorbye@google.com>
Fri, 7 Jan 2011 15:11:56 +0000 (07:11 -0800)
commitc889d55f9ae61c886318c6c5c713b39a57bdbb13
tree023d77e91eb591e920687389996908c18847e162
parent3a825f9a1c68cb6a513ef7c347bede39796005d7
Support for editing id, text, string and reference properties

We have context menu items for editing the properties of the currently
selected view, but it is only available for boolean and enumerated
properties.

This changeset makes it possible to edit these properties in three
ways:

1. It adds in all the other properties to the Property context menu,
   but instead of pullright menus, the actions have "..." as a suffix,
   and when selected will open a dialog asking for the new value.
   (This is similar to how custom layout width/height values are
   handled.)

   If the attribute represents a reference-type, then the Reference
   Chooser (also used by the property sheet) is shown, and if not just
   a plain text field.

   (This context-menu feature was requested by external users.)

2. It adds the "ID" property as a top level item that can be edited
   directly via an "Edit ID..." menu item, right next to the "Layout
   Width" and "Layout Height" properties which are also special-cased
   at the top level.

3. For Views that have a "Text" property, this property is also added
   at the top level to be able to set it quickly and conveniently.  As
   soon as we get inline editing we can consider whether this is still
   needed.

In addition, the changeset extracts constants for the various ids used
for action identity, and makes a common function for setting a
particular node attribute.

Change-Id: Ib86a8a5412c39117fe250ce5788d8457a0e3fbe8
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IClientRulesEngine.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DynamicContextMenu.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/RulesEngine.java
eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java
eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java