OSDN Git Service

Mark internal strings as NON-NLS in rule classes
authorTor Norbye <tnorbye@google.com>
Fri, 5 Nov 2010 00:20:24 +0000 (17:20 -0700)
committerTor Norbye <tnorbye@google.com>
Fri, 5 Nov 2010 16:48:26 +0000 (09:48 -0700)
Mark internal strings as NON-NLS in rule classes. This code was
initially written in Groovy which is why it didn't have NON-NLS
markers.

Change-Id: I74517771271e54f165332543092a9d29fc2bc52a

eclipse/dictionary.txt
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/AbsoluteLayoutRule.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseLayout.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseView.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LinearLayoutRule.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/RelativeLayoutRule.java

index e82a6dc..b3c0fba 100644 (file)
@@ -26,6 +26,8 @@ codename
 codenames
 combo
 config
+configurability
+coords
 ddms
 debuggable
 deprecated
index e2d64eb..18ea968 100644 (file)
@@ -166,8 +166,10 @@ public class AbsoluteLayoutRule extends BaseLayout {
                         y += be.isValid() ? be.h : 10;
                     }
 
-                    newChild.setAttribute(ANDROID_URI, "layout_x", x + "dip");
-                    newChild.setAttribute(ANDROID_URI, "layout_y", y + "dip");
+                    newChild.setAttribute(ANDROID_URI, "layout_x", //$NON-NLS-1$
+                            x + "dip"); //$NON-NLS-1$
+                    newChild.setAttribute(ANDROID_URI, "layout_y", //$NON-NLS-1$
+                            y + "dip"); //$NON-NLS-1$
 
                     addInnerElements(newChild, element, idMap);
                 }
index 2a2102a..412e495 100644 (file)
@@ -194,7 +194,7 @@ public class BaseLayout extends BaseView {
                 String new_id = findNewId(value.getSecond(), existingIdSet);
                 value = Pair.of(new_id, value.getSecond());
                 new_map.put(id, value);
-                new_map.put(id.replaceFirst("@\\+", "@"), value);
+                new_map.put(id.replaceFirst("@\\+", "@"), value); //$NON-NLS-1$ //$NON-NLS-2$
             }
         }
 
@@ -210,7 +210,7 @@ public class BaseLayout extends BaseView {
         String name = fqcn.substring(fqcn.lastIndexOf('.') + 1);
 
         for (int i = 1; i < 1000000; i++) {
-            String id = String.format("@+id/%s%02d", name, i);
+            String id = String.format("@+id/%s%02d", name, i); //$NON-NLS-1$
             if (!existingIdSet.contains(id)) {
                 existingIdSet.add(id);
                 return id;
@@ -247,8 +247,8 @@ public class BaseLayout extends BaseView {
      * Transforms @id/name into @+id/name to treat both forms the same way.
      */
     protected String normalizeId(String id) {
-        if (id.indexOf("@+") == -1) {
-            id = id.replaceFirst("@", "@+");
+        if (id.indexOf("@+") == -1) { //$NON-NLS-1$
+            id = id.replaceFirst("@", "@+"); //$NON-NLS-1$ //$NON-NLS-2$
         }
         return id;
     }
@@ -263,27 +263,27 @@ public class BaseLayout extends BaseView {
 
     private static final String[] EXCLUDED_ATTRIBUTES = new String[] {
         // from AbsoluteLayout
-        "layout_x",
-        "layout_y",
+        "layout_x",                      //$NON-NLS-1$
+        "layout_y",                      //$NON-NLS-1$
 
         // from RelativeLayout
-        "layout_above",
-        "layout_below",
-        "layout_toLeftOf",
-        "layout_toRightOf",
-        "layout_alignBaseline",
-        "layout_alignTop",
-        "layout_alignBottom",
-        "layout_alignLeft",
-        "layout_alignRight",
-        "layout_alignParentTop",
-        "layout_alignParentBottom",
-        "layout_alignParentLeft",
-        "layout_alignParentRight",
-        "layout_alignWithParentMissing",
-        "layout_centerHorizontal",
-        "layout_centerInParent",
-        "layout_centerVertical",
+        "layout_above",                  //$NON-NLS-1$
+        "layout_below",                  //$NON-NLS-1$
+        "layout_toLeftOf",               //$NON-NLS-1$
+        "layout_toRightOf",              //$NON-NLS-1$
+        "layout_alignBaseline",          //$NON-NLS-1$
+        "layout_alignTop",               //$NON-NLS-1$
+        "layout_alignBottom",            //$NON-NLS-1$
+        "layout_alignLeft",              //$NON-NLS-1$
+        "layout_alignRight",             //$NON-NLS-1$
+        "layout_alignParentTop",         //$NON-NLS-1$
+        "layout_alignParentBottom",      //$NON-NLS-1$
+        "layout_alignParentLeft",        //$NON-NLS-1$
+        "layout_alignParentRight",       //$NON-NLS-1$
+        "layout_alignWithParentMissing", //$NON-NLS-1$
+        "layout_centerHorizontal",       //$NON-NLS-1$
+        "layout_centerInParent",         //$NON-NLS-1$
+        "layout_centerVertical",         //$NON-NLS-1$
     };
 
     /**
index 9bd82a7..15871d7 100644 (file)
@@ -51,24 +51,25 @@ public class BaseView implements IViewRule {
      * Namespace for the Android resource XML, i.e.
      * "http://schemas.android.com/apk/res/android"
      */
-    public static String ANDROID_URI = "http://schemas.android.com/apk/res/android";
+    public static String ANDROID_URI = "http://schemas.android.com/apk/res/android"; //$NON-NLS-1$
 
     // Some common Android layout attribute names used by the view rules.
     // All these belong to the attribute namespace ANDROID_URI.
-    public static String ATTR_ID = "id";
+    public static String ATTR_ID = "id"; //$NON-NLS-1$
 
-    public static String ATTR_TEXT = "text";
+    public static String ATTR_TEXT = "text"; //$NON-NLS-1$
 
-    public static String ATTR_LAYOUT_WIDTH = "layout_width";
+    public static String ATTR_LAYOUT_WIDTH = "layout_width"; //$NON-NLS-1$
 
-    public static String ATTR_LAYOUT_HEIGHT = "layout_height";
+    public static String ATTR_LAYOUT_HEIGHT = "layout_height"; //$NON-NLS-1$
 
     // Some common Android layout attribute values used by the view rules.
-    public static String VALUE_FILL_PARENT = "fill_parent";
+    public static String VALUE_FILL_PARENT = "fill_parent"; //$NON-NLS-1$
 
-    public static String VALUE_MATCH_PARENT = "match_parent"; // like fill_parent for API 8
+    // like fill_parent for API 8
+    public static String VALUE_MATCH_PARENT = "match_parent"; //$NON-NLS-1$
 
-    public static String VALUE_WRAP_CONTENT = "wrap_content";
+    public static String VALUE_WRAP_CONTENT = "wrap_content"; //$NON-NLS-1$
 
     // Cache of attributes. Key is FQCN of a node mixed with its view hierarchy
     // parent. Values are a custom map as needed by getContextMenu.
@@ -127,7 +128,7 @@ public class BaseView implements IViewRule {
         if (VALUE_FILL_PARENT.equals(curr_w)) {
             curr_w = VALUE_MATCH_PARENT;
         } else if (!VALUE_WRAP_CONTENT.equals(curr_w) && !VALUE_MATCH_PARENT.equals(curr_w)) {
-            curr_w = "zcustom";
+            curr_w = "zcustom"; //$NON-NLS-1$
             custom_w = "Custom: " + curr_w;
         }
 
@@ -137,7 +138,7 @@ public class BaseView implements IViewRule {
         if (VALUE_FILL_PARENT.equals(curr_h)) {
             curr_h = VALUE_MATCH_PARENT;
         } else if (!VALUE_WRAP_CONTENT.equals(curr_h) && !VALUE_MATCH_PARENT.equals(curr_h)) {
-            curr_h = "zcustom";
+            curr_h = "zcustom"; //$NON-NLS-1$
             custom_h = "Custom: " + curr_h;
         }
 
@@ -148,12 +149,12 @@ public class BaseView implements IViewRule {
                     final String valueId,
                     final Boolean newValue) {
                 String fullActionId = action.getId();
-                boolean isProp = fullActionId.startsWith("@prop@");
+                boolean isProp = fullActionId.startsWith("@prop@"); //$NON-NLS-1$
                 final String actionId = isProp ? fullActionId.substring(6) : fullActionId;
                 final INode node = selectedNode;
 
-                if (fullActionId.equals("layout_1width")) {
-                    if (!valueId.startsWith("z")) {
+                if (fullActionId.equals("layout_1width")) { //$NON-NLS-1$
+                    if (!valueId.startsWith("z")) {         //$NON-NLS-1$
                         node.editXml("Change attribute " + ATTR_LAYOUT_WIDTH, new INodeHandler() {
                             public void handle(INode n) {
                                 n.setAttribute(ANDROID_URI, ATTR_LAYOUT_WIDTH, valueId);
@@ -161,8 +162,8 @@ public class BaseView implements IViewRule {
                         });
                     }
                     return;
-                } else if (fullActionId.equals("layout_2height")) {
-                    if (!valueId.startsWith("z")) {
+                } else if (fullActionId.equals("layout_2height")) { //$NON-NLS-1$
+                    if (!valueId.startsWith("z")) {                 //$NON-NLS-1$
                         node.editXml("Change attribute " + ATTR_LAYOUT_HEIGHT, new INodeHandler() {
                             public void handle(INode n) {
                                 n.setAttribute(ANDROID_URI, ATTR_LAYOUT_HEIGHT, valueId);
@@ -181,21 +182,22 @@ public class BaseView implements IViewRule {
                             public void handle(INode n) {
                                 if (prop.isToggle()) {
                                     // case of toggle
-                                    String value = "";
-                                    if (valueId.equals("1t")) {
-                                        value = newValue ? "true" : "";
+                                    String value = "";                  //$NON-NLS-1$
+                                    if (valueId.equals("1t")) {         //$NON-NLS-1$
+                                        value = newValue ? "true" : ""; //$NON-NLS-1$ //$NON-NLS-2$
                                     } else if (valueId.equals("2f")) {
-                                        value = newValue ? "false" : "";
+                                        value = newValue ? "false" : "";//$NON-NLS-1$ //$NON-NLS-2$
                                     }
                                     n.setAttribute(ANDROID_URI, actionId, value);
                                 } else if (prop.isFlag()) {
                                     // case of a flag
-                                    String values = "";
-                                    if (!valueId.equals("~2clr")) {
+                                    String values = "";                 //$NON-NLS-1$
+                                    if (!valueId.equals("~2clr")) {     //$NON-NLS-1$
                                         values = n.getStringAttr(ANDROID_URI, actionId);
                                         Set<String> newValues = new HashSet<String>();
                                         if (values != null) {
-                                            newValues.addAll(Arrays.asList(values.split("\\|")));
+                                            newValues.addAll(Arrays.asList(
+                                                    values.split("\\|"))); //$NON-NLS-1$
                                         }
                                         if (newValue) {
                                             newValues.add(valueId);
@@ -207,9 +209,9 @@ public class BaseView implements IViewRule {
                                     n.setAttribute(ANDROID_URI, actionId, values);
                                 } else {
                                     // case of an enum
-                                    String value = "";
-                                    if (!valueId.equals("~2clr")) {
-                                        value = newValue ? valueId : "";
+                                    String value = "";                   //$NON-NLS-1$
+                                    if (!valueId.equals("~2clr")) {      //$NON-NLS-1$
+                                        value = newValue ? valueId : ""; //$NON-NLS-1$
                                     }
                                     n.setAttribute(ANDROID_URI, actionId, value);
                                 }
@@ -221,23 +223,23 @@ public class BaseView implements IViewRule {
         };
 
         List<MenuAction> list1 = Arrays.asList(new MenuAction[] {
-            new MenuAction.Choices("layout_1width", "Layout Width",
+            new MenuAction.Choices("layout_1width", "Layout Width", //$NON-NLS-1$
                     mapify(
-                      "wrap_content", "Wrap Content",
-                      "match_parent", "Match Parent",
-                      "zcustom", custom_w
+                      "wrap_content", "Wrap Content", //$NON-NLS-1$
+                      "match_parent", "Match Parent", //$NON-NLS-1$
+                      "zcustom", custom_w             //$NON-NLS-1$
                     ),
                     curr_w,
                     onChange ),
-           new MenuAction.Choices("layout_2height", "Layout Height",
+           new MenuAction.Choices("layout_2height", "Layout Height", //$NON-NLS-1$
                    mapify(
-                      "wrap_content", "Wrap Content",
-                      "match_parent", "Match Parent",
-                      "zcustom", custom_h
+                      "wrap_content", "Wrap Content", //$NON-NLS-1$
+                      "match_parent", "Match Parent", //$NON-NLS-1$
+                      "zcustom", custom_h             //$NON-NLS-1$
                    ),
                     curr_h,
                     onChange ),
-           new MenuAction.Group("properties", "Properties")
+           new MenuAction.Group("properties", "Properties") //$NON-NLS-1$
         });
 
         // Prepare a list of all simple properties.
@@ -298,44 +300,45 @@ public class BaseView implements IViewRule {
                 String value = selectedNode.getStringAttr(ANDROID_URI, id);
                 if (value != null)
                     value = value.toLowerCase();
-                if ("true".equals(value)) {
-                    value = "1t";
-                } else if ("false".equals(value)) {
-                    value = "2f";
+                if ("true".equals(value)) {         //$NON-NLS-1$
+                    value = "1t";                   //$NON-NLS-1$
+                } else if ("false".equals(value)) { //$NON-NLS-1$
+                    value = "2f";                   //$NON-NLS-1$
                 } else {
-                    value = "4clr";
+                    value = "4clr";                 //$NON-NLS-1$
                 }
 
                 a = new MenuAction.Choices(
-                    "@prop@" + id,
+                    "@prop@" + id,          //$NON-NLS-1$
                     p.getTitle(),
                     mapify(
-                        "1t", "True",
-                        "2f", "False",
-                        "3sep", MenuAction.Choices.SEPARATOR,
-                        "4clr", "Clear"),
+                        "1t", "True",       //$NON-NLS-1$
+                        "2f", "False",      //$NON-NLS-1$
+                        "3sep", MenuAction.Choices.SEPARATOR, //$NON-NLS-1$
+                        "4clr", "Clear"),   //$NON-NLS-1$
                     value,
-                    "properties",
+                    "properties",           //$NON-NLS-1$
                     onChange);
             } else {
                 // Enum or flags. Their possible values are the multiple-choice
                 // items, with an extra "clear" option to remove everything.
                 String current = selectedNode.getStringAttr(ANDROID_URI, id);
                 if (current == null || current.length() == 0) {
-                    current = "~2clr";
+                    current = "~2clr";   //$NON-NLS-1$
                 }
                 a = new MenuAction.Choices(
-                    "@prop@" + id,
+                    "@prop@" + id,       //$NON-NLS-1$
                     p.getTitle(),
                     concatenate(
                         p.getChoices(),
                         mapify(
-                            "~1sep", MenuAction.Choices.SEPARATOR,
-                            "~2clr", "Clear " + (p.isFlag() ? "flag" : "enum")
+                            "~1sep", MenuAction.Choices.SEPARATOR,  //$NON-NLS-1$
+                            "~2clr",                                //$NON-NLS-1$
+                            "Clear " + (p.isFlag() ? "flag" : "enum")
                         )
                     ),
                     current,
-                    "properties",
+                    "properties", //$NON-NLS-1$
                     onChange);
             }
             list2.add(a);
index b8b205b..caaef5d 100644 (file)
@@ -38,9 +38,9 @@ import java.util.Map;
  * classes.
  */
 public class LinearLayoutRule extends BaseLayout {
-    public static String ATTR_ORIENTATION = "orientation";
-    public static String VALUE_HORIZONTAL = "horizontal";
-    public static String VALUE_VERTICAL = "vertical";
+    public static String ATTR_ORIENTATION = "orientation"; //$NON-NLS-1$
+    public static String VALUE_HORIZONTAL = "horizontal";  //$NON-NLS-1$
+    public static String VALUE_VERTICAL = "vertical";      //$NON-NLS-1$
 
     /**
      * Add an explicit Orientation toggle to the context menu.
@@ -58,7 +58,7 @@ public class LinearLayoutRule extends BaseLayout {
                 String actionId = action.getId();
                 final INode node = selectedNode;
 
-                if (actionId.equals("_orientation")) {
+                if (actionId.equals("_orientation")) { //$NON-NLS-1$
                     node.editXml("Change LinearLayout " + ATTR_ORIENTATION, new INodeHandler() {
                         public void handle(INode n) {
                             node.setAttribute(ANDROID_URI, ATTR_ORIENTATION, valueId);
@@ -69,10 +69,10 @@ public class LinearLayoutRule extends BaseLayout {
         };
 
         return concatenate(super.getContextMenu(selectedNode),
-            new MenuAction.Choices("_orientation", "Orientation",
+            new MenuAction.Choices("_orientation", "Orientation",  //$NON-NLS-1$
                 mapify(
-                    "horizontal", "Horizontal",
-                    "vertical", "Vertical"
+                    "horizontal", "Horizontal",                    //$NON-NLS-1$
+                    "vertical", "Vertical"                         //$NON-NLS-1$
                 ),
                 curr_orient, onChange));
     }
@@ -366,7 +366,9 @@ public class LinearLayoutRule extends BaseLayout {
 
         @Override
         public String toString() {
-            return "MatchPos [distance=" + mDistance + ", position=" + mPosition + "]";
+            return "MatchPos [distance=" + mDistance //$NON-NLS-1$
+                    + ", position=" + mPosition      //$NON-NLS-1$
+                    + "]";                           //$NON-NLS-1$
         }
 
         private int getDistance() {
@@ -412,9 +414,15 @@ public class LinearLayoutRule extends BaseLayout {
 
         @Override
         public String toString() {
-            return "LinearDropData [currX=" + mCurrX + ", currY=" + mCurrY + ", height=" + mHeight
-                    + ", indexes=" + mIndexes + ", insertPos=" + mInsertPos + ", isVertical="
-                    + mVertical + ", selfPos=" + mSelfPos + ", width=" + mWidth + "]";
+            return "LinearDropData [currX=" + mCurrX //$NON-NLS-1$
+                    + ", currY=" + mCurrY //$NON-NLS-1$
+                    + ", height=" + mHeight //$NON-NLS-1$
+                    + ", indexes=" + mIndexes //$NON-NLS-1$
+                    + ", insertPos=" + mInsertPos //$NON-NLS-1$
+                    + ", isVertical=" + mVertical //$NON-NLS-1$
+                    + ", selfPos=" + mSelfPos //$NON-NLS-1$
+                    + ", width=" + mWidth //$NON-NLS-1$
+                    + "]"; //$NON-NLS-1$
         }
 
         private boolean isVertical() {
index 7ac8354..f88bd95 100755 (executable)
@@ -59,9 +59,8 @@ public class RelativeLayoutRule extends BaseLayout {
             INode p = topParent.getParent();
             if (p == null) {
                 break;
-            } else {
-                topParent = p;
             }
+            topParent = p;
         }
 
         Rect b = topParent.getBounds();
@@ -70,23 +69,23 @@ public class RelativeLayoutRule extends BaseLayout {
         }
 
         List<String> infos = new ArrayList<String>(18);
-        addAttr("above", childNode, infos);
-        addAttr("below", childNode, infos);
-        addAttr("toLeftOf", childNode, infos);
-        addAttr("toRightOf", childNode, infos);
-        addAttr("alignBaseline", childNode, infos);
-        addAttr("alignTop", childNode, infos);
-        addAttr("alignBottom", childNode, infos);
-        addAttr("alignLeft", childNode, infos);
-        addAttr("alignRight", childNode, infos);
-        addAttr("alignParentTop", childNode, infos);
-        addAttr("alignParentBottom", childNode, infos);
-        addAttr("alignParentLeft", childNode, infos);
-        addAttr("alignParentRight", childNode, infos);
-        addAttr("alignWithParentMissing", childNode, infos);
-        addAttr("centerHorizontal", childNode, infos);
-        addAttr("centerInParent", childNode, infos);
-        addAttr("centerVertical", childNode, infos);
+        addAttr("above", childNode, infos);                   //$NON-NLS-1$
+        addAttr("below", childNode, infos);                   //$NON-NLS-1$
+        addAttr("toLeftOf", childNode, infos);                //$NON-NLS-1$
+        addAttr("toRightOf", childNode, infos);               //$NON-NLS-1$
+        addAttr("alignBaseline", childNode, infos);           //$NON-NLS-1$
+        addAttr("alignTop", childNode, infos);                //$NON-NLS-1$
+        addAttr("alignBottom", childNode, infos);             //$NON-NLS-1$
+        addAttr("alignLeft", childNode, infos);               //$NON-NLS-1$
+        addAttr("alignRight", childNode, infos);              //$NON-NLS-1$
+        addAttr("alignParentTop", childNode, infos);          //$NON-NLS-1$
+        addAttr("alignParentBottom", childNode, infos);       //$NON-NLS-1$
+        addAttr("alignParentLeft", childNode, infos);         //$NON-NLS-1$
+        addAttr("alignParentRight", childNode, infos);        //$NON-NLS-1$
+        addAttr("alignWithParentMissing", childNode, infos);  //$NON-NLS-1$
+        addAttr("centerHorizontal", childNode, infos);        //$NON-NLS-1$
+        addAttr("centerInParent", childNode, infos);          //$NON-NLS-1$
+        addAttr("centerVertical", childNode, infos);          //$NON-NLS-1$
 
         if (infos.size() > 0) {
             gc.useStyle(DrawingStyle.HELP);
@@ -97,7 +96,7 @@ public class RelativeLayoutRule extends BaseLayout {
     }
 
     private void addAttr(String propertyName, INode childNode, List<String> infos) {
-        String a = childNode.getStringAttr(ANDROID_URI, "layout_" + propertyName);
+        String a = childNode.getStringAttr(ANDROID_URI, "layout_" + propertyName); //$NON-NLS-1$
         if (a != null && a.length() > 0) {
             String s = propertyName + ": " + a;
             infos.add(s);
@@ -173,7 +172,8 @@ public class RelativeLayoutRule extends BaseLayout {
                     // position is expressed directly or indirectly based on the
                     // element being moved.
                     if (!feedback.isCopy) {
-                        if (searchRelativeIds(child, data.getMovedIds(), data.getCachedLinkIds())) {
+                        if (searchRelativeIds(child, data.getMovedIds(),
+                                data.getCachedLinkIds())) {
                             data.setRejected(bc);
                             feedback.requestPaint = true;
                             continue nextChild;
@@ -328,21 +328,21 @@ public class RelativeLayoutRule extends BaseLayout {
 
         if (x <= x1 + n && y >= y1 && y <= y2) {
             r = new Rect(x1 - n, y1, n2, h);
-            attr = "alignParentLeft";
+            attr = "alignParentLeft";              //$NON-NLS-1$
             vertical = true;
 
         } else if (x >= x2 - n && y >= y1 && y <= y2) {
             r = new Rect(x2 - n, y1, n2, h);
-            attr = "alignParentRight";
+            attr = "alignParentRight";             //$NON-NLS-1$
             vertical = true;
 
         } else if (y <= y1 + n && x >= x1 && x <= x2) {
             r = new Rect(x1, y1 - n, w, n2);
-            attr = "alignParentTop";
+            attr = "alignParentTop";               //$NON-NLS-1$
 
         } else if (y >= y2 - n && x >= x1 && x <= x2) {
             r = new Rect(x1, y2 - n, w, n2);
-            attr = "alignParentBottom";
+            attr = "alignParentBottom";            //$NON-NLS-1$
 
         } else {
             // we're nowhere near a border
@@ -393,41 +393,41 @@ public class RelativeLayoutRule extends BaseLayout {
         Rect bounds = new Rect(x1, y1, wt, ht);
 
         List<DropZone> zones = new ArrayList<DropZone>(16);
-        String a = "above";
+        String a = "above"; //$NON-NLS-1$
         int x = x1;
         int y = y1;
 
-        x = addx(w1, a, x, y, h1, zones, "toLeftOf");
-        x = addx(w2, a, x, y, h1, zones, "alignLeft");
-        x = addx(w2, a, x, y, h1, zones, "alignLeft", "alignRight");
-        x = addx(w2, a, x, y, h1, zones, "alignRight");
-        x = addx(w1, a, x, y, h1, zones, "toRightOf");
+        x = addx(w1, a, x, y, h1, zones, "toLeftOf");   //$NON-NLS-1$
+        x = addx(w2, a, x, y, h1, zones, "alignLeft");  //$NON-NLS-1$
+        x = addx(w2, a, x, y, h1, zones, "alignLeft", "alignRight"); //$NON-NLS-1$ //$NON-NLS-2$
+        x = addx(w2, a, x, y, h1, zones, "alignRight"); //$NON-NLS-1$
+        x = addx(w1, a, x, y, h1, zones, "toRightOf");  //$NON-NLS-1$
 
-        a = "below";
+        a = "below"; //$NON-NLS-1$
         x = x1;
         y = y1 + ht - h1;
 
-        x = addx(w1, a, x, y, h1, zones, "toLeftOf");
-        x = addx(w2, a, x, y, h1, zones, "alignLeft");
-        x = addx(w2, a, x, y, h1, zones, "alignLeft", "alignRight");
-        x = addx(w2, a, x, y, h1, zones, "alignRight");
-        x = addx(w1, a, x, y, h1, zones, "toRightOf");
+        x = addx(w1, a, x, y, h1, zones, "toLeftOf");    //$NON-NLS-1$
+        x = addx(w2, a, x, y, h1, zones, "alignLeft");   //$NON-NLS-1$
+        x = addx(w2, a, x, y, h1, zones, "alignLeft", "alignRight"); //$NON-NLS-1$ //$NON-NLS-2$
+        x = addx(w2, a, x, y, h1, zones, "alignRight");  //$NON-NLS-1$
+        x = addx(w1, a, x, y, h1, zones, "toRightOf");   //$NON-NLS-1$
 
-        a = "toLeftOf";
+        a = "toLeftOf"; //$NON-NLS-1$
         x = x1;
         y = y1 + h1;
 
-        y = addy(h2, a, x, y, w1, zones, "alignTop");
-        y = addy(h2, a, x, y, w1, zones, "alignTop", "alignBottom");
-        y = addy(h2, a, x, y, w1, zones, "alignBottom");
+        y = addy(h2, a, x, y, w1, zones, "alignTop");    //$NON-NLS-1$
+        y = addy(h2, a, x, y, w1, zones, "alignTop", "alignBottom"); //$NON-NLS-1$ //$NON-NLS-2$
+        y = addy(h2, a, x, y, w1, zones, "alignBottom"); //$NON-NLS-1$
 
-        a = "toRightOf";
+        a = "toRightOf"; //$NON-NLS-1$
         x = x1 + wt - w1;
         y = y1 + h1;
 
-        y = addy(h2, a, x, y, w1, zones, "alignTop");
-        y = addy(h2, a, x, y, w1, zones, "alignTop", "alignBottom");
-        y = addy(h2, a, x, y, w1, zones, "alignBottom");
+        y = addy(h2, a, x, y, w1, zones, "alignTop");    //$NON-NLS-1$
+        y = addy(h2, a, x, y, w1, zones, "alignTop", "alignBottom"); //$NON-NLS-1$ //$NON-NLS-2$
+        y = addy(h2, a, x, y, w1, zones, "alignBottom"); //$NON-NLS-1$
 
         return Pair.of(bounds, zones);
     }
@@ -533,20 +533,20 @@ public class RelativeLayoutRule extends BaseLayout {
                 int offsetX = x - be.x;
                 int offsetY = y - be.y;
 
-                if (data.getCurr().getAttr().contains("alignTop")
-                        && data.getCurr().getAttr().contains("alignBottom")) {
+                if (data.getCurr().getAttr().contains("alignTop")                    //$NON-NLS-1$
+                        && data.getCurr().getAttr().contains("alignBottom")) {       //$NON-NLS-1$
                     offsetY -= be.h / 2;
-                } else if (data.getCurr().getAttr().contains("above")
-                        || data.getCurr().getAttr().contains("alignTop")
-                        || data.getCurr().getAttr().contains("alignParentBottom")) {
+                } else if (data.getCurr().getAttr().contains("above")                //$NON-NLS-1$
+                        || data.getCurr().getAttr().contains("alignTop")             //$NON-NLS-1$
+                        || data.getCurr().getAttr().contains("alignParentBottom")) { //$NON-NLS-1$
                     offsetY -= be.h;
                 }
-                if (data.getCurr().getAttr().contains("alignRight")
-                        && data.getCurr().getAttr().contains("alignLeft")) {
+                if (data.getCurr().getAttr().contains("alignRight")                  //$NON-NLS-1$
+                        && data.getCurr().getAttr().contains("alignLeft")) {         //$NON-NLS-1$
                     offsetX -= be.w / 2;
-                } else if (data.getCurr().getAttr().contains("toLeftOft")
-                        || data.getCurr().getAttr().contains("alignLeft")
-                        || data.getCurr().getAttr().contains("alignParentRight")) {
+                } else if (data.getCurr().getAttr().contains("toLeftOft")            //$NON-NLS-1$
+                        || data.getCurr().getAttr().contains("alignLeft")            //$NON-NLS-1$
+                        || data.getCurr().getAttr().contains("alignParentRight")) {  //$NON-NLS-1$
                     offsetX -= be.w;
                 }
 
@@ -610,7 +610,7 @@ public class RelativeLayoutRule extends BaseLayout {
 
                     for (String it : data.getCurr().getAttr()) {
                         newChild.setAttribute(ANDROID_URI,
-                                "layout_" + it, id != null ? id : "true");
+                             "layout_" + it, id != null ? id : "true"); //$NON-NLS-1$ //$NON-NLS-2$
                     }
 
                     addInnerElements(newChild, element, idMap);