OSDN Git Service

20542: Contextual prop menu doesn't work well for textStyle. DO NOT MERGE.
authorTor Norbye <tnorbye@google.com>
Wed, 5 Oct 2011 15:46:19 +0000 (08:46 -0700)
committerTor Norbye <tnorbye@google.com>
Wed, 5 Oct 2011 22:27:42 +0000 (15:27 -0700)
Change-Id: I6092924b63448b9700ebe5906fab87f11520e27f

eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java

index daef677..abf47b8 100644 (file)
@@ -274,7 +274,20 @@ public class BaseViewRule implements IViewRule {
                                     } else {
                                         newValues.remove(valueId);
                                     }
-                                    values = join('|', newValues);
+
+                                    List<String> sorted = new ArrayList<String>(newValues);
+                                    Collections.sort(sorted);
+                                    values = join('|', sorted);
+
+                                    // Special case
+                                    if (valueId.equals("normal")) { //$NON-NLS-1$
+                                        // For textStyle for example, if you have "bold|italic"
+                                        // and you select the "normal" property, this should
+                                        // not behave in the normal flag way and "or" itself in;
+                                        // it should replace the other two.
+                                        // This also applies to imeOptions.
+                                        values = valueId;
+                                    }
                                 }
                                 n.setAttribute(uri, actionId, values);
                             } else if (prop.isEnum()) {