Reviewers: ,

Description:
http://code.google.com/p/google-web-toolkit/issues/detail?id=6493

Please review this at http://gwt-code-reviews.appspot.com/1686803/

Affected files:
  user/src/com/google/gwt/dom/client/Style.java


Index: user/src/com/google/gwt/dom/client/Style.java
===================================================================
--- user/src/com/google/gwt/dom/client/Style.java       (revision 10954)
+++ user/src/com/google/gwt/dom/client/Style.java       (working copy)
@@ -574,6 +574,38 @@
   }

   /**
+   * Enum for the text-align property.
+   */
+  public enum TextAlign implements HasCssName {
+    CENTER {
+      @Override
+      public String getCssName() {
+        return TEXT_ALIGN_CENTER;
+      }
+    },
+    JUSTIFY {
+      @Override
+      public String getCssName() {
+        return TEXT_ALIGN_JUSTIFY;
+      }
+    },
+    LEFT {
+      @Override
+      public String getCssName() {
+        return TEXT_ALIGN_LEFT;
+      }
+    },
+    RIGHT {
+      @Override
+      public String getCssName() {
+        return TEXT_ALIGN_RIGHT;
+      }
+    };
+    @Override
+    public abstract String getCssName();
+  }
+
+  /**
    * Enum for the text-decoration property.
    */
   public enum TextDecoration implements HasCssName {
@@ -792,6 +824,7 @@
   private static final String STYLE_BACKGROUND_COLOR = "backgroundColor";
   private static final String STYLE_VERTICAL_ALIGN = "verticalAlign";
   private static final String STYLE_TABLE_LAYOUT = "tableLayout";
+  private static final String STYLE_TEXT_ALIGN = "textAlign";
   private static final String STYLE_OUTLINE_WIDTH = "outlineWidth";
   private static final String STYLE_OUTLINE_STYLE = "outlineStyle";
   private static final String STYLE_OUTLINE_COLOR = "outlineColor";
@@ -800,6 +833,11 @@
   private static final String TABLE_LAYOUT_AUTO = "auto";
   private static final String TABLE_LAYOUT_FIXED = "fixed";

+  private static final String TEXT_ALIGN_CENTER = "center";
+  private static final String TEXT_ALIGN_JUSTIFY = "justify";
+  private static final String TEXT_ALIGN_LEFT = "left";
+  private static final String TEXT_ALIGN_RIGHT = "right";
+
private static final String TEXT_DECORATION_LINE_THROUGH = "line-through";
   private static final String TEXT_DECORATION_OVERLINE = "overline";
   private static final String TEXT_DECORATION_UNDERLINE = "underline";
@@ -1097,6 +1135,13 @@
   }

   /**
+   * Clear the 'text-align' css property.
+   */
+  public final void clearTextAlign() {
+    clearProperty(STYLE_TEXT_ALIGN);
+  }
+
+  /**
    * Clears the text-decoration CSS property.
    */
   public final void clearTextDecoration() {
@@ -1371,6 +1416,13 @@
   }

   /**
+   * Get the 'text-align' css property.
+   */
+  public final String getTextAlign() {
+    return getProperty(STYLE_TEXT_ALIGN);
+  }
+
+  /**
    * Gets the text-decoration CSS property.
    */
   public final String getTextDecoration() {
@@ -1697,6 +1749,13 @@
   }

   /**
+   * Set the 'text-align' CSS property.
+   */
+  public final void setTextAlign(TextAlign value) {
+    setProperty(STYLE_TEXT_ALIGN, value.getCssName());
+  }
+
+  /**
    * Sets the text-decoration CSS property.
    */
   public final void setTextDecoration(TextDecoration value) {


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to