[gwt-contrib] Add text-align support to Style (issue1686803)

2012-04-19 Thread tuckerpmt

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


[gwt-contrib] DockLayoutPanel.getWidgetSize(Widget) (issue1687803)

2012-04-19 Thread tuckerpmt

Reviewers: ,

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

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

Affected files:
  user/src/com/google/gwt/user/client/ui/DockLayoutPanel.java


Index: user/src/com/google/gwt/user/client/ui/DockLayoutPanel.java
===
--- user/src/com/google/gwt/user/client/ui/DockLayoutPanel.java	(revision  
10954)
+++ user/src/com/google/gwt/user/client/ui/DockLayoutPanel.java	(working  
copy)

@@ -293,6 +293,21 @@
   }

   /**
+   * Gets the layout size of the given child widget.
+   *
+   * @param child the widget to be queried
+   * @return the widget's layout size, or codenull/code if it is not a
+   * child of this panel
+   */
+  public Double getWidgetSize(Widget child) {
+assertIsChild(child);
+if (child.getParent() != this) {
+  return null;
+}
+return ((LayoutData) child.getLayoutData()).size;
+  }
+
+  /**
* Adds a widget to the east edge of the dock, inserting it before an  
existing

* widget.
*


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


[gwt-contrib] Incorrect doc for Style.Position (issue1688803)

2012-04-19 Thread tuckerpmt

Reviewers: ,

Description:
The java doc for the Position enum in Style states that the enum is for
the display CSS property when it is actually for the position CSS
property.

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

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)
@@ -522,7 +522,7 @@
   }

   /**
-   * Enum for the display property.
+   * Enum for the position property.
*/
   public enum Position implements HasCssName {
 STATIC {


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


[gwt-contrib] SplitLayoutPanel should use ScheduledCommand instead of Command (issue1689803)

2012-04-19 Thread tuckerpmt

Reviewers: ,

Description:
The class uses ScheduledCommand in all but 1 place, the import can be
removed all together if we construct a ScheduledCommand instead of a
Command.

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

Affected files:
  user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java


Index: user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java
===
--- user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java	(revision  
10954)
+++ user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java	(working  
copy)

@@ -22,7 +22,6 @@
 import com.google.gwt.dom.client.Element;
 import com.google.gwt.dom.client.Style.Position;
 import com.google.gwt.dom.client.Style.Unit;
-import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.Event;
 import com.google.gwt.user.client.Window;

@@ -252,7 +251,7 @@
   // Defer actually updating the layout, so that if we receive many
   // mouse events before layout/paint occurs, we'll only update once.
   if (layoutCommand == null) {
-layoutCommand = new Command() {
+layoutCommand = new ScheduledCommand() {
   @Override
   public void execute() {
 layoutCommand = null;


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