]> source.dussan.org Git - gwtquery.git/commitdiff
continue type safe css implementation
authorJulien Dramaix <julien.dramaix@gmail.com>
Tue, 8 Feb 2011 23:32:17 +0000 (23:32 +0000)
committerJulien Dramaix <julien.dramaix@gmail.com>
Tue, 8 Feb 2011 23:32:17 +0000 (23:32 +0000)
51 files changed:
gwtquery-core/src/main/java/com/google/gwt/query/client/css/AbstractCssProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/BackgroundAttachmentProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/BackgroundColorProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/BackgroundImageProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/BackgroundPositionProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/BackgroundRepeatProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/BorderCollapseProperty.java [new file with mode: 0644]
gwtquery-core/src/main/java/com/google/gwt/query/client/css/BorderColorProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/BorderProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/BorderSpacingProperty.java [new file with mode: 0644]
gwtquery-core/src/main/java/com/google/gwt/query/client/css/BorderStyleProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/BorderWidthProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/CSS.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/CaptionSideProperty.java [new file with mode: 0644]
gwtquery-core/src/main/java/com/google/gwt/query/client/css/ClearProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/ClipProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/ColorProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/CssNumber.java [new file with mode: 0644]
gwtquery-core/src/main/java/com/google/gwt/query/client/css/CursorProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/DirectionProperty.java [new file with mode: 0644]
gwtquery-core/src/main/java/com/google/gwt/query/client/css/DisplayProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/EdgePositionProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/FloatProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/FontSizeProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/FontStyleProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/FontVariantProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/FontWeightProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/HeightProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/LetterSpacingProperty.java [new file with mode: 0644]
gwtquery-core/src/main/java/com/google/gwt/query/client/css/LineHeightProperty.java [new file with mode: 0644]
gwtquery-core/src/main/java/com/google/gwt/query/client/css/ListStyleImageProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/ListStylePositionProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/ListStyleTypeProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/MarginProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/OutlineColorProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/OutlineStyleProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/OutlineWidthProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/OverflowProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/PaddingProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/PositionProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/TextAlignProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/TextDecorationProperty.java [new file with mode: 0644]
gwtquery-core/src/main/java/com/google/gwt/query/client/css/TextIdentProperty.java [new file with mode: 0644]
gwtquery-core/src/main/java/com/google/gwt/query/client/css/TextTransformProperty.java [new file with mode: 0644]
gwtquery-core/src/main/java/com/google/gwt/query/client/css/VerticalAlignProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/VisibilityProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/WhiteSpaceProperty.java [new file with mode: 0644]
gwtquery-core/src/main/java/com/google/gwt/query/client/css/WidthProperty.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/WordSpacingProperty.java [new file with mode: 0644]
gwtquery-core/src/main/java/com/google/gwt/query/client/css/ZIndexProperty.java [new file with mode: 0644]
gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCssTest.java

index 06e79fa4996d1af036e9cf07dfb8ffa7425c9fb2..609ed483d5c82e49c56c9fee361eb9b991b8880b 100644 (file)
@@ -25,12 +25,19 @@ import com.google.gwt.dom.client.Style.HasCssName;
  */
 public abstract class AbstractCssProperty<T extends HasCssName> implements
     TakeCssValue<T> {
+  private String cssName;
+  
+  protected AbstractCssProperty(String cssName){
+    this.cssName = cssName;
+  }
 
   public String get(Style s) {
     return s.getProperty(getCssName());
   }
 
-  public abstract String getCssName();
+  public String getCssName(){
+    return cssName;
+  }
 
   public void set(Style s, T value) {
     s.setProperty(getCssName(), value.getCssName());
index 7974efe2759c235206dc832feaa52a5969c9a3c8..9ea1864624201e755e4157dd0c3316f826610d73 100644 (file)
@@ -47,6 +47,7 @@ public class BackgroundAttachmentProperty extends
     public abstract String getCssName();
 
   }
+
   private static final String CSS_PROPERTY = "backgroundAttachment";
   private static final String FIXED_VALUE = "fixed";
 
@@ -56,9 +57,8 @@ public class BackgroundAttachmentProperty extends
     CSS.BACKGROUND_ATTACHMENT = new BackgroundAttachmentProperty();
   }
 
-  private BackgroundAttachmentProperty() {}
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+  private BackgroundAttachmentProperty() {
+    super(CSS_PROPERTY);
   }
+
 }
index e93595060f6f7e25377fe61e61b1af7f1672e3e4..b343e0f4976447b2dfd6a4da1acb500d66fa8892 100644 (file)
@@ -28,9 +28,6 @@ public class BackgroundColorProperty extends AbstractCssProperty<RGBColor> {
   }
 
   private BackgroundColorProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 }
index 11c972632159dd5b085a122c5043a3bba5da16a1..155b404dcc8356d60844a0dd02761444324e549b 100644 (file)
@@ -27,10 +27,7 @@ public class BackgroundImageProperty extends AbstractCssProperty<ImageValue> {
   }
 
   private BackgroundImageProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 
 }
index b57331606480d63fd830329273af19f7c791d4e5..b613da37b8ff8ec115f94d91cb3dd764f028f780 100644 (file)
@@ -91,9 +91,6 @@ public class BackgroundPositionProperty extends
   }
 
   private BackgroundPositionProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 }
index d3810e17a8a6367ee025c26aed3c5869cf7b729d..6eef8eeca92dcdd1d7a2e4d8e558b4bdf3e6ac09 100644 (file)
@@ -89,9 +89,6 @@ public class BackgroundRepeatProperty extends
   }
 
   private BackgroundRepeatProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 }
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/css/BorderCollapseProperty.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/css/BorderCollapseProperty.java
new file mode 100644 (file)
index 0000000..96257bc
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2011, The gwtquery team.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.query.client.css;
+
+import com.google.gwt.dom.client.Style.HasCssName;
+
+/**
+ * This property describes the color of a border.
+ */
+public class BorderCollapseProperty extends
+    AbstractCssProperty<BorderCollapseProperty.BorderCollapse> {
+
+  public static enum BorderCollapse implements HasCssName {
+    /**
+     * Borders are collapsed into a single border when possible (border-spacing
+     * and empty-cells properties will be ignored)
+     */
+    COLLAPSE,
+    /**
+     * Borders are detached (border-spacing and empty-cells properties will not
+     * be ignored).
+     */
+    SEPARATE;
+    
+    public String getCssName() {
+      return name().toLowerCase();
+    }
+  }
+
+  private static final String CSS_PROPERTY = "borderCollapse";
+
+  public static void init() {
+    CSS.BORDER_COLLAPSE = new BorderCollapseProperty();
+
+  }
+
+  private BorderCollapseProperty() {
+    super(CSS_PROPERTY);
+  }
+}
index 5785e1420cf3003cf5c2688d06d8efa2c405dfa6..18adefe1e1225f615b0a6618821f0bf7e53a65ed 100644 (file)
@@ -16,7 +16,7 @@
 package com.google.gwt.query.client.css;
 
 /**
- * This property describes the foreground color of an element's text content.
+ * This property describes the color of a border.
  */
 public class BorderColorProperty extends AbstractCssProperty<RGBColor> {
 
@@ -35,14 +35,8 @@ public class BorderColorProperty extends AbstractCssProperty<RGBColor> {
         BORDER_RIGHT_COLOR_PROPERTY);
     CSS.BORDER_TOP_COLOR = new BorderColorProperty(BORDER_TOP_COLOR_PROPERTY);
   }
-
-  private String cssName;
-
+  
   private BorderColorProperty(String value) {
-    this.cssName = value;
-  }
-
-  public String getCssName() {
-    return cssName;
+   super(value);
   }
 }
index 56b8aa5f5818aab7826937ea1a83b0cbbc97d4d9..76767182344d62cd20434c9b95eaea4aefd91093 100644 (file)
@@ -21,37 +21,50 @@ import com.google.gwt.query.client.css.BorderStyleProperty.LineStyle;
 import com.google.gwt.query.client.css.BorderWidthProperty.LineWidth;
 
 /**
+ * The border shorthand property sets all the border properties in one
+ * declaration.
  * 
- *
  */
 public class BorderProperty implements
     CssShorthandProperty3<LineWidth, LineStyle, RGBColor> {
 
-  private static final String CSS_PROPERTY = "border";
+  private static final String BORDER_BOTTOM_PROPERTY = "borderBottom";
+  private static final String BORDER_PROPERTY = "border";
+  private static final String BORDER_LEFT_PROPERTY = "borderLeft";
+  private static final String BORDER_RIGHT_PROPERTY = "borderRight";
+  private static final String BORDER_TOP_PROPERTY = "borderTop";
 
   static void init() {
-    CSS.BORDER = new BorderProperty();
+    CSS.BORDER = new BorderProperty(BORDER_PROPERTY);
+    CSS.BORDER_BOTTOM = new BorderProperty(BORDER_BOTTOM_PROPERTY);
+    CSS.BORDER_TOP = new BorderProperty(BORDER_TOP_PROPERTY);
+    CSS.BORDER_RIGHT = new BorderProperty(BORDER_RIGHT_PROPERTY);
+    CSS.BORDER_LEFT = new BorderProperty(BORDER_LEFT_PROPERTY);
+
     BorderColorProperty.init();
     BorderStyleProperty.init();
     BorderWidthProperty.init();
   }
 
-  private BorderProperty() {
+  private String cssProperty;
+
+  private BorderProperty(String property) {
+    cssProperty = property;
   }
 
   public String get(Style s) {
-    return s.getProperty(CSS_PROPERTY);
+    return s.getProperty(cssProperty);
   }
 
   public String getCssName() {
-    return CSS_PROPERTY;
+    return cssProperty;
   }
 
   public void set(Style s, LineWidth borderWidth, LineStyle borderStyle,
       RGBColor borderColor) {
     String value = notNull(borderWidth) + notNull(borderStyle)
         + notNull(borderColor).trim();
-    s.setProperty(CSS_PROPERTY, value);
+    s.setProperty(cssProperty, value);
   }
 
   private String notNull(HasCssName value) {
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/css/BorderSpacingProperty.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/css/BorderSpacingProperty.java
new file mode 100644 (file)
index 0000000..542add3
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2011, The gwtquery team.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.query.client.css;
+
+import com.google.gwt.dom.client.Style.HasCssName;
+
+/**
+ * This property describes the color of a border.
+ */
+public class BorderSpacingProperty extends
+    AbstractCssProperty<BorderSpacingProperty.BorderSpacing> {
+
+  public static class BorderSpacing implements HasCssName {
+    
+    private Length verticalSpacing;
+    private Length horizontalSpacing;
+    
+    public BorderSpacing(Length spacing) {
+      this(spacing, spacing);
+    }
+    
+    public BorderSpacing(Length horizontalSpacing, Length verticalSpacing) {
+      assert horizontalSpacing != null : "horizontal spacing cannot be null";
+      assert verticalSpacing != null : "vertical spacing cannot be null";
+      
+      this.verticalSpacing = verticalSpacing;
+      this.horizontalSpacing = horizontalSpacing;
+    }
+    
+    
+    public String getCssName() {
+      return horizontalSpacing.getCssName()+" "+verticalSpacing.getCssName();
+    }
+  }
+
+  private static final String CSS_PROPERTY = "borderSpacing";
+
+  public static void init() {
+    CSS.BORDER_SPACING = new BorderSpacingProperty();
+
+  }
+
+  private BorderSpacingProperty() {
+    super(CSS_PROPERTY);
+  }
+}
index c5fb22398559996e5ccceb961129f6ec02c51c18..340deb54aab57752b558c86ba45ad6c8c571f635 100644 (file)
@@ -111,13 +111,8 @@ public class BorderStyleProperty extends
     CSS.BORDER_TOP_STYLE = new BorderStyleProperty(BORDER_TOP_STYLE_PROPERTY);
   }
 
-  private String cssName;
-
   private BorderStyleProperty(String value) {
-    this.cssName = value;
+    super(value);
   }
 
-  public String getCssName() {
-    return cssName;
-  }
 }
index 5d76c234a1acb52c13a75452ad0fa34b406ce2f3..ef9f17917478ddcd3ac9a578a784cdc849339ddd 100644 (file)
@@ -76,18 +76,12 @@ public class BorderWidthProperty extends
     CSS.BORDER_TOP_WIDTH = new BorderWidthProperty(BORDER_TOP_WIDTH_PROPERTY);
   }
 
-  private String cssName;
-
   private BorderWidthProperty(String value) {
-    this.cssName = value;
-  }
-
-  public String getCssName() {
-    return cssName;
+   super(value);
   }
 
   public void set(Style s, Length p) {
-    s.setProperty(cssName, p.getCssName());
+    s.setProperty(getCssName(), p.getCssName());
 
   }
 }
index 0f67220ebdc0c9646d050d498118ee55dbaeebd4..fddd291d1cc362e66f8d56f1a4a142e9b9d70465 100644 (file)
@@ -39,29 +39,41 @@ public class CSS {
   public static BackgroundRepeatProperty BACKGROUND_REPEAT;
 
   public static BorderProperty BORDER;
-
+  
+  public static BorderProperty BORDER_BOTTOM;
+  
   public static BorderColorProperty BORDER_BOTTOM_COLOR;
-
+  
   public static BorderStyleProperty BORDER_BOTTOM_STYLE;
-
+  
   public static BorderWidthProperty BORDER_BOTTOM_WIDTH;
 
+  public static BorderCollapseProperty BORDER_COLLAPSE;
+
   public static BorderColorProperty BORDER_COLOR;
 
+  public static BorderProperty BORDER_LEFT;
+
   public static BorderColorProperty BORDER_LEFT_COLOR;
 
   public static BorderStyleProperty BORDER_LEFT_STYLE;
 
   public static BorderWidthProperty BORDER_LEFT_WIDTH;
 
+  public static BorderProperty BORDER_RIGHT;
+
   public static BorderColorProperty BORDER_RIGHT_COLOR;
 
   public static BorderStyleProperty BORDER_RIGHT_STYLE;
 
   public static BorderWidthProperty BORDER_RIGHT_WIDTH;
 
+  public static BorderSpacingProperty BORDER_SPACING;
+
   public static BorderStyleProperty BORDER_STYLE;
 
+  public static BorderProperty BORDER_TOP;
+
   public static BorderColorProperty BORDER_TOP_COLOR;
 
   public static BorderStyleProperty BORDER_TOP_STYLE;
@@ -69,7 +81,6 @@ public class CSS {
   public static BorderWidthProperty BORDER_TOP_WIDTH;
 
   public static BorderWidthProperty BORDER_WIDTH;
-
   /**
    * For absolutely positioned elements, the bottom property sets the bottom
    * edge of an element to a unit above/below the bottom edge of its containing
@@ -81,12 +92,14 @@ public class CSS {
    * For static positioned elements, the bottom property has no effect.
    */
   public static EdgePositionProperty BOTTOM;
+  public static CaptionSideProperty CAPTION_SIDE;
 
   /**
    * The clear property specifies which sides of an element where other floating
    * elements are not allowed.
    */
   public static ClearProperty CLEAR;
+
   /**
    * The clip property lets you specify the dimensions of an absolutely
    * positioned element that should be visible, and the element is clipped into
@@ -95,6 +108,7 @@ public class CSS {
    * The clip property does not work if the overflow property is set to visible.
    */
   public static ClipProperty CLIP;
+
   /**
    * This property describes the foreground color of an element's text content.
    */
@@ -106,6 +120,8 @@ public class CSS {
    */
   public static CursorProperty CURSOR;
 
+  public static DirectionProperty DIRECTION;
+
   /**
    * This property specifies the mechanism by which elements are rendered.
    */
@@ -150,6 +166,10 @@ public class CSS {
    */
   public static EdgePositionProperty LEFT;
 
+  public static LetterSpacingProperty LETTER_SPACING;
+
+  public static LineHeightProperty LINE_HEIGHT;
+
   public static ListStyleProperty LIST_STYLE;
 
   public static ListStyleImageProperty LIST_STYLE_IMAGE;
@@ -168,6 +188,14 @@ public class CSS {
 
   public static MarginProperty MARGIN_TOP;
 
+  public static HeightProperty MAX_HEIGHT;
+
+  public static WidthProperty MAX_WIDTH;
+
+  public static HeightProperty MIN_HEIGHT;
+
+  public static WidthProperty MIN_WIDTH;
+
   /**
    * An outline is a line that is drawn around elements (outside the borders) to
    * make the element "stand out".
@@ -236,6 +264,12 @@ public class CSS {
    */
   public static TextAlignProperty TEXT_ALIGN;
 
+  public static TextDecorationProperty TEXT_DECORATION;
+
+  public static TextIdentProperty TEXT_IDENT;
+
+  public static TextTransformProperty TEXT_TRANSFORM;
+
   /**
    * For absolutely positioned elements, the top property sets the top edge of
    * an element to a unit above/below the top edge of its containing element.
@@ -260,6 +294,8 @@ public class CSS {
    */
   public static VisibilityProperty VISIBILITY;
 
+  public static WhiteSpaceProperty WHITE_SPACE;
+
   /**
    * This property specifies the content width of boxes generated by block-level
    * and replaced elements.
@@ -276,9 +312,16 @@ public class CSS {
    */
   public static WidthProperty WIDTH;
 
+  public static WordSpacingProperty WORD_SPACING;
+
+  public static ZIndexProperty ZINDEX;
+
   static {
     BackgroundProperty.init();
     BorderProperty.init();
+    BorderCollapseProperty.init();
+    BorderSpacingProperty.init();
+    CaptionSideProperty.init();
     ColorProperty.init();
     CursorProperty.init();
     ClearProperty.init();
@@ -291,6 +334,8 @@ public class CSS {
     FontWeightProperty.init();
     FontSizeProperty.init();
     HeightProperty.init();
+    LetterSpacingProperty.init();
+    LineHeightProperty.init();
     ListStyleProperty.init();
     MarginProperty.init();
     OutlineProperty.init();
@@ -298,9 +343,15 @@ public class CSS {
     PaddingProperty.init();
     PositionProperty.init();
     TextAlignProperty.init();
+    TextDecorationProperty.init();
+    TextIdentProperty.init();
+    TextTransformProperty.init();
     VerticalAlignProperty.init();
     VisibilityProperty.init();
     WidthProperty.init();
+    WhiteSpaceProperty.init();
+    WordSpacingProperty.init();
+    ZIndexProperty.init();
 
   }
 
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/css/CaptionSideProperty.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/css/CaptionSideProperty.java
new file mode 100644 (file)
index 0000000..03bbc55
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2011, The gwtquery team.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.query.client.css;
+
+import com.google.gwt.dom.client.Style.HasCssName;
+
+/**
+ * This property describes how inline content of a block is aligned.
+ */
+public class CaptionSideProperty extends
+    AbstractCssProperty<CaptionSideProperty.CaptionSide> {
+
+  public enum CaptionSide implements HasCssName {
+    /**
+     * Puts the caption above the table
+     */
+    TOP,
+    /**
+     *  Puts the caption below the table
+     */
+    BOTTOM;
+
+    public String getCssName() {
+      return name().toLowerCase();
+    };
+  }
+
+  private static final String CSS_PROPERTY = "captionSide";
+
+  public static void init() {
+    CSS.CAPTION_SIDE = new CaptionSideProperty();
+  }
+
+  private CaptionSideProperty() {
+    super(CSS_PROPERTY);
+  }
+
+}
index f825db0511f4067e05d55f1115883cce93c8bf51..50efa05096a3ce0feea567f6fb58df0cfbb1d232 100644 (file)
@@ -87,9 +87,6 @@ public class ClearProperty extends AbstractCssProperty<ClearProperty.Clear> {
   }
 
   private ClearProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 }
index c92909471e2acb791c6e9fef26acd3e8e6369840..8c820bc6fa8f5a8820c96b9365820f8585a4df00 100644 (file)
@@ -52,9 +52,6 @@ public class ClipProperty extends AbstractCssProperty<ClipProperty.Shape> {
   }
 
   private ClipProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 }
index 5df4daa9c1912e6434b3d6d38bd4b6a2e1fd7855..2a4b7566279c5496a214f773a42f7132b39ad215 100644 (file)
@@ -27,9 +27,6 @@ public class ColorProperty extends AbstractCssProperty<RGBColor> {
   }
 
   private ColorProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 }
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/css/CssNumber.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/css/CssNumber.java
new file mode 100644 (file)
index 0000000..74e6939
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2011, The gwtquery team.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.query.client.css;
+
+import com.google.gwt.dom.client.Style.HasCssName;
+
+/**
+ * Some css property take simply number as value.
+ */
+public class CssNumber implements HasCssName {
+
+  private String value;
+
+  public CssNumber(String value) {
+    this.value = value;
+  }
+  
+  public CssNumber(int value) {
+    this(""+value);
+  }
+
+  public String getCssName() {
+    return value;
+  }
+
+}
index 8bc13746c2c5637edfa9a61603e024d6b13ecd8d..0d3671d9c9dad2597fe23eb1cff9b50f5271dc1c 100644 (file)
@@ -29,9 +29,6 @@ public class CursorProperty extends AbstractCssProperty<Cursor> {
   }
 
   private CursorProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 }
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/css/DirectionProperty.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/css/DirectionProperty.java
new file mode 100644 (file)
index 0000000..ce25983
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2011, The gwtquery team.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.query.client.css;
+
+import com.google.gwt.dom.client.Style.HasCssName;
+
+/**
+ * This property defines the text direction/writing direction
+ */
+public class DirectionProperty extends
+    AbstractCssProperty<DirectionProperty.Direction> {
+
+  public static enum Direction implements HasCssName {
+
+    LTR {
+      public String getCssName() {
+        return "ltr";
+      };
+    },
+    RTL {
+      public String getCssName() {
+        return "rtl";
+      };
+    },
+    INHERIT {
+      public String getCssName() {
+        return "inherit";
+      };
+    };
+
+    public abstract String getCssName();
+
+  }
+
+  private static final String CSS_PROPERTY = "direction";
+
+  public static void init() {
+    CSS.DIRECTION = new DirectionProperty();
+  }
+
+  private DirectionProperty() {
+    super(CSS_PROPERTY);
+  }
+}
index 6b2ddf373160ea16e19dc697bb69c722dcaae15c..0c7457e50b69604eaf603f364acc698b0965deda 100644 (file)
@@ -29,9 +29,6 @@ public class DisplayProperty extends AbstractCssProperty<Display> {
   }
 
   private DisplayProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 }
index f8d3f1044709f1910e1a6053edcda80c2dd4ec79..392e9d4c95e2aada5e70a3154520759b348b1fce 100644 (file)
@@ -27,13 +27,7 @@ public class EdgePositionProperty extends AbstractCssProperty<Length> {
     CSS.TOP = new EdgePositionProperty("top");
   }
 
-  private String cssName;
-
   private EdgePositionProperty(String value) {
-    this.cssName = value;
-  }
-
-  public String getCssName() {
-    return cssName;
+    super(value);
   }
 }
index adf03062489b06e8620e689da1a604e763d9c4b0..84d2f58507614d6e4f1182c8aff96f3728e00dc7 100644 (file)
@@ -32,10 +32,7 @@ public class FloatProperty extends AbstractCssProperty<Float> {
   }
 
   private FloatProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 
   @Override
index 2c498554ce9f59b2b53e474fd6e741ba11a7cb16..537cb259cc9f89cb4fdafefea4797bd6aca8664b 100644 (file)
@@ -128,10 +128,7 @@ public class FontSizeProperty extends
   }
 
   private FontSizeProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 
   /**
index 2bcc2b83ed3d74585c6361d2246908f470699899..9276ebefcb2c1b89574ab81e35dc97bee440095a 100644 (file)
@@ -29,9 +29,6 @@ public class FontStyleProperty extends AbstractCssProperty<FontStyle> {
   }
 
   private FontStyleProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 }
index eb409b563dc1d7306430e2a9e8202ab66a343cd5..756a651915d5441d16983fd2ae7c3cadeacb41b1 100644 (file)
@@ -65,9 +65,6 @@ public class FontVariantProperty extends
   }
 
   private FontVariantProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 }
index 788e8aaee985bf7af5079313718c3e5b52e6493a..6169a911fdbf7395771b55cebe5eefc4fdf91f46 100644 (file)
@@ -29,9 +29,6 @@ public class FontWeightProperty extends AbstractCssProperty<FontWeight> {
   }
 
   private FontWeightProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 }
index 6f23b41968c35604d88631c9d9a08da4d33e9ce5..11541e0d37ea7e72ffa163d37e9486e4deb2c3db 100644 (file)
 package com.google.gwt.query.client.css;
 
 /**
- * This property specifies the content height of boxes generated by block-level,
- * inline-block and replaced elements.
- * 
- * This property does not apply to non-replaced inline-level elements. See the
- * section on computing heights and margins for non-replaced inline elements for
- * the rules used instead.
+ * all height css properties : max-height, min-height, height
  */
 public class HeightProperty extends AbstractCssProperty<Length> {
 
-  private static final String CSS_PROPERTY = "height";
+  private static final String HEIGHT_PROPERTY = "height";
+  private static final String MAX_HEIGHT_PROPERTY = "maxHeight";
+  private static final String MIN_HEIGHT_PROPERTY = "minHeight";
 
   public static void init() {
-    CSS.HEIGHT = new HeightProperty();
+    CSS.HEIGHT = new HeightProperty(HEIGHT_PROPERTY);
+    CSS.MAX_HEIGHT = new HeightProperty(MAX_HEIGHT_PROPERTY);
+    CSS.MIN_HEIGHT = new HeightProperty(MIN_HEIGHT_PROPERTY);
   }
 
-  private HeightProperty() {
+  
+  private HeightProperty(String cssName) {
+    super(cssName);
   }
 
-  public String getCssName() {
-    return CSS_PROPERTY;
-  }
 }
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/css/LetterSpacingProperty.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/css/LetterSpacingProperty.java
new file mode 100644 (file)
index 0000000..7cb62b9
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2011, The gwtquery team.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.query.client.css;
+
+/**
+ * all height css properties : max-height, min-height, height
+ */
+public class LetterSpacingProperty extends AbstractCssProperty<Length> {
+
+  private static final String CSS_PROPERTY = "letterSpacing";
+
+  public static void init() {
+    CSS.LETTER_SPACING = new LetterSpacingProperty();
+  }
+
+  private LetterSpacingProperty() {
+    super(CSS_PROPERTY);
+  }
+
+}
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/css/LineHeightProperty.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/css/LineHeightProperty.java
new file mode 100644 (file)
index 0000000..f2396ab
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2011, The gwtquery team.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.query.client.css;
+
+import com.google.gwt.dom.client.Style;
+
+/**
+ * all height css properties : max-height, min-height, height
+ */
+public class LineHeightProperty extends AbstractCssProperty<CssNumber> implements TakesLength {
+
+  private static final String CSS_PROPERTY = "lineHeight";
+
+  public static void init() {
+    CSS.LINE_HEIGHT = new LineHeightProperty();
+  }
+
+  private LineHeightProperty() {
+    super(CSS_PROPERTY);
+  }
+
+  public void set(Style s, Length p) {
+    s.setProperty(CSS_PROPERTY, p.getCssName());
+    
+  }
+
+}
index 564f4b7f053a13997653e43cdea309f20191e1a4..b4e8f600079cb0ac99984807d56efaacd7c9e275 100644 (file)
@@ -27,9 +27,6 @@ public class ListStyleImageProperty extends AbstractCssProperty<ImageValue> {
   }
 
   private ListStyleImageProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 }
index a3934efada02c3ca229854f0f4ce59dcdd5ae180..765515d19001d9b1f2f253160fb0bb378b3d6328 100644 (file)
@@ -68,9 +68,6 @@ public class ListStylePositionProperty extends
   }
 
   private ListStylePositionProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 }
index c1c6ece58d64940a09884ab3612b64615da9a23b..3dde51110087aa96fbc48ae8d66e1ccf4b7d9336 100644 (file)
@@ -29,9 +29,6 @@ public class ListStyleTypeProperty extends AbstractCssProperty<ListStyleType> {
   }
 
   private ListStyleTypeProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 }
index f9054f4cd8f4dccfc3094104edb0a958aa3e0a96..e9a71bf47dd9d2b9a66347252d172a200f5d4c4f 100644 (file)
@@ -34,14 +34,8 @@ public class MarginProperty extends AbstractCssProperty<Length> {
     CSS.MARGIN_BOTTOM = new MarginProperty(MARGIN_BOTTOM_PROPERTY);
   }
 
-  private String cssName;
-
   private MarginProperty(String cssName) {
-    this.cssName = cssName;
-  }
-
-  public String getCssName() {
-    return cssName;
+    super(cssName);
   }
 
 }
index e2a664b48a8a55cd602bf15292825716287232e3..72314142382b815fac53d614159a70834218ccae 100644 (file)
@@ -30,9 +30,6 @@ public class OutlineColorProperty extends AbstractCssProperty<RGBColor> {
 
 
   private OutlineColorProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 }
index 7d408f4ef87d4ef7da1635612ba2c0781ab87faa..402cf398ad6aa366508538660647002b70517802 100644 (file)
@@ -32,9 +32,6 @@ public class OutlineStyleProperty extends AbstractCssProperty<LineStyle> {
 
 
   private OutlineStyleProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 }
index 5510be390f07f06a8fcfbca17f1a17c4ba0cb2a8..5fbbc402a94c87d09e103967d7bbdca76aa2f131 100644 (file)
@@ -33,10 +33,7 @@ public class OutlineWidthProperty extends AbstractCssProperty<LineWidth>
   }
 
   private OutlineWidthProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 
   public void set(Style s, Length p) {
index 1eda4cc2d53a095b7dcf981dd74f36a733669c3c..363ca541f3e7684bc8cb4a650707a5cfbd558c1b 100644 (file)
@@ -30,9 +30,6 @@ public class OverflowProperty extends
   }
 
   private OverflowProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 }
index 085f5c57ccaf1a78457ee929971571f084609f60..7782ae28d31d8116132e1613750839c6a2a35563 100644 (file)
@@ -35,14 +35,8 @@ public class PaddingProperty extends AbstractCssProperty<Length> {
     CSS.PADDING_BOTTOM = new PaddingProperty(PADDING_BOTTOM_PROPERTY);
   }
 
-  private String cssName;
-
   private PaddingProperty(String cssName) {
-    this.cssName = cssName;
-  }
-
-  public String getCssName() {
-    return cssName;
+    super(cssName);
   }
 
 }
index f68e99c35150559d1c7d4d31ab35834ebd99c9ad..a5c54a6366c884d3f43d54ad2ed8ea083d743612 100644 (file)
@@ -29,9 +29,7 @@ public class PositionProperty extends AbstractCssProperty<Position> {
   }
 
   private PositionProperty() {
+    super(CSS_PROPERTY);
   }
 
-  public String getCssName() {
-    return CSS_PROPERTY;
-  }
 }
index 52fa3fe2e19936d57186e0b387a2f4231a38c5f0..9e43846683a8818731a301dd94d48c4eca30c407 100644 (file)
@@ -78,10 +78,7 @@ public class TextAlignProperty extends
   }
 
   private TextAlignProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 
 }
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/css/TextDecorationProperty.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/css/TextDecorationProperty.java
new file mode 100644 (file)
index 0000000..9466225
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2011, The gwtquery team.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.query.client.css;
+
+import com.google.gwt.dom.client.Style.TextDecoration;
+
+/**
+ * This property describes how inline content of a block is aligned.
+ */
+public class TextDecorationProperty extends
+    AbstractCssProperty<TextDecoration> {
+
+  
+  private static final String CSS_PROPERTY = "textDecoration";
+
+  public static void init() {
+    CSS.TEXT_DECORATION= new TextDecorationProperty();
+  }
+
+  private TextDecorationProperty() {
+    super(CSS_PROPERTY);
+  }
+
+}
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/css/TextIdentProperty.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/css/TextIdentProperty.java
new file mode 100644 (file)
index 0000000..641a24b
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2011, The gwtquery team.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.query.client.css;
+
+
+/**
+ * This property describes how inline content of a block is aligned.
+ */
+public class TextIdentProperty extends
+    AbstractCssProperty<Length> {
+
+  
+  private static final String CSS_PROPERTY = "textIdent";
+
+  public static void init() {
+    CSS.TEXT_IDENT= new TextIdentProperty();
+  }
+
+  private TextIdentProperty() {
+    super(CSS_PROPERTY);
+  }
+
+}
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/css/TextTransformProperty.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/css/TextTransformProperty.java
new file mode 100644 (file)
index 0000000..bf0c073
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2011, The gwtquery team.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.query.client.css;
+
+import com.google.gwt.dom.client.Style.HasCssName;
+
+/**
+ * This property describes how inline content of a block is aligned.
+ */
+public class TextTransformProperty extends
+    AbstractCssProperty<TextTransformProperty.TextTransform> {
+
+  public enum TextTransform implements HasCssName{
+    /**
+     * Transforms the first character of each word to uppercase
+     */
+    CAPITALIZE,
+    /**
+     * Transforms all characters to uppercase
+     */
+    UPPERCASE,
+    /**
+     *  Transforms all characters to lowercase
+     */
+    LOWERCASE;
+    
+    public String getCssName() {
+      return name().toLowerCase();
+    };
+  }
+  
+  private static final String CSS_PROPERTY = "textTransform";
+
+  public static void init() {
+    CSS.TEXT_TRANSFORM= new TextTransformProperty();
+  }
+
+  private TextTransformProperty() {
+    super(CSS_PROPERTY);
+  }
+
+}
index 3ace339cb744338a18a03bc86a9a44d261c2525b..317812047416a7498fbb69678c09b04cf1930690 100644 (file)
@@ -32,10 +32,7 @@ public class VerticalAlignProperty extends AbstractCssProperty<VerticalAlign>
   }
 
   private VerticalAlignProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+    super(CSS_PROPERTY);
   }
 
   public void set(Style s, Length p) {
index 97cdaa4ff330eed682642c48adcf52aae62521fb..dcc0b848898f656057377fc8c628e16c2ecfed1c 100644 (file)
@@ -32,9 +32,7 @@ public class VisibilityProperty extends AbstractCssProperty<Visibility> {
   }
 
   private VisibilityProperty() {
+    super(CSS_PROPERTY);
   }
 
-  public String getCssName() {
-    return CSS_PROPERTY;
-  }
 }
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/css/WhiteSpaceProperty.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/css/WhiteSpaceProperty.java
new file mode 100644 (file)
index 0000000..32d4967
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2011, The gwtquery team.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.query.client.css;
+
+import com.google.gwt.dom.client.Style.HasCssName;
+
+/**
+ * This property describes how inline content of a block is aligned.
+ */
+public class WhiteSpaceProperty extends
+    AbstractCssProperty<WhiteSpaceProperty.WhiteSpace> {
+
+  public enum WhiteSpace implements HasCssName {
+    /**
+     * Sequences of whitespace will collapse into a single whitespace. Text will
+     * wrap when necessary.
+     */
+    NORMAL,
+    /**
+     * Sequences of whitespace will collapse into a single whitespace. Text will
+     * never wrap to the next line. The text continues on the same line until a <br />
+     * tag is encountered
+     */
+    NOWRAP,
+    /**
+     * Whitespace is preserved by the browser. Text will only wrap on line
+     * breaks Acts like the
+     * 
+     * <pre> tag in HTML
+     */
+    PRE,
+    /**
+     * Sequences of whitespace will collapse into a single whitespace. Text will
+     * wrap when necessary, and on line breaks
+     */
+    PRE_LINE,
+    /**
+     * Whitespace is preserved by the browser. Text will wrap when necessary,
+     * and on line breaks
+     */
+    PRE_WRAP;
+
+    public String getCssName() {
+      return name().toLowerCase().replace('_', '-');
+    };
+  }
+
+  private static final String CSS_PROPERTY = "whiteSpace";
+
+  public static void init() {
+    CSS.WHITE_SPACE = new WhiteSpaceProperty();
+  }
+
+  private WhiteSpaceProperty() {
+    super(CSS_PROPERTY);
+  }
+
+}
index a3c52cb4490f652b4100b76a296e8f0bd8506dfd..6cb6cacfe7ff233f4832c0d3bee91283948e1b2d 100644 (file)
@@ -30,17 +30,18 @@ package com.google.gwt.query.client.css;
  */
 public class WidthProperty extends AbstractCssProperty<Length> {
 
-  private static final String CSS_PROPERTY = "width";
+  private static final String WIDTH_PROPERTY = "width";
+  private static final String MAX_WIDTH_PROPERTY = "maxWidth";
+  private static final String MIN_WIDTH_PROPERTY = "minWidth";
 
   public static void init() {
-    CSS.WIDTH = new WidthProperty();
+    CSS.WIDTH = new WidthProperty(WIDTH_PROPERTY);
+    CSS.MAX_WIDTH = new WidthProperty(MAX_WIDTH_PROPERTY);
+    CSS.MIN_WIDTH = new WidthProperty(MIN_WIDTH_PROPERTY);
   }
-
-  private WidthProperty() {
-  }
-
-  public String getCssName() {
-    return CSS_PROPERTY;
+  
+  private WidthProperty(String cssName) {
+    super(cssName);
   }
 
 }
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/css/WordSpacingProperty.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/css/WordSpacingProperty.java
new file mode 100644 (file)
index 0000000..20f4cbd
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2011, The gwtquery team.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.query.client.css;
+
+/**
+ * all height css properties : max-height, min-height, height
+ */
+public class WordSpacingProperty extends AbstractCssProperty<Length> {
+
+  private static final String CSS_PROPERTY = "wordSpacing";
+
+  public static void init() {
+    CSS.WORD_SPACING = new WordSpacingProperty();
+  }
+
+  private WordSpacingProperty() {
+    super(CSS_PROPERTY);
+  }
+
+}
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/css/ZIndexProperty.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/css/ZIndexProperty.java
new file mode 100644 (file)
index 0000000..d5e9540
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2011, The gwtquery team.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.query.client.css;
+
+import com.google.gwt.dom.client.Style;
+
+/**
+ * The z-index property specifies the stack order of an element.
+ * 
+ * An element with greater stack order is always in front of an element with a
+ * lower stack order.
+ * 
+ * The z-index property only works on positioned elements (position:absolute,
+ * position:relative, or position:fixed).
+ */
+public class ZIndexProperty extends AbstractCssProperty<CssNumber> {
+
+  private static final String CSS_PROPERTY = "zIndex";
+
+  public static void init() {
+    CSS.ZINDEX = new ZIndexProperty();
+  }
+
+  private ZIndexProperty() {
+    super(CSS_PROPERTY);
+  }
+
+  @Override
+  public String get(Style s) {
+    return getZIndex(s);
+  }
+
+  /**
+   * See GWT issue 5548
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=5548
+   */
+  private native String getZIndex(Style s) /*-{
+    //force to return a string
+    return ""+s["zIndex"];
+  }-*/;
+
+}
index 846279bd4923dd4863d3d8486c09a6f0a0daeb5c..8cb98138e4d99f390a0b952efcece8c65cb655e2 100644 (file)
@@ -25,25 +25,32 @@ import com.google.gwt.dom.client.Style.FontStyle;
 import com.google.gwt.dom.client.Style.ListStyleType;
 import com.google.gwt.dom.client.Style.Overflow;
 import com.google.gwt.dom.client.Style.Position;
+import com.google.gwt.dom.client.Style.TextDecoration;
 import com.google.gwt.dom.client.Style.Unit;
 import com.google.gwt.dom.client.Style.VerticalAlign;
 import com.google.gwt.dom.client.Style.Visibility;
 import com.google.gwt.junit.client.GWTTestCase;
 import com.google.gwt.query.client.css.CSS;
+import com.google.gwt.query.client.css.CssNumber;
 import com.google.gwt.query.client.css.ImageValue;
 import com.google.gwt.query.client.css.Length;
 import com.google.gwt.query.client.css.RGBColor;
 import com.google.gwt.query.client.css.BackgroundAttachmentProperty.BackgroundAttachment;
 import com.google.gwt.query.client.css.BackgroundPositionProperty.BackgroundPosition;
 import com.google.gwt.query.client.css.BackgroundRepeatProperty.BackgroundRepeat;
+import com.google.gwt.query.client.css.BorderCollapseProperty.BorderCollapse;
+import com.google.gwt.query.client.css.BorderSpacingProperty.BorderSpacing;
 import com.google.gwt.query.client.css.BorderStyleProperty.LineStyle;
 import com.google.gwt.query.client.css.BorderWidthProperty.LineWidth;
+import com.google.gwt.query.client.css.CaptionSideProperty.CaptionSide;
 import com.google.gwt.query.client.css.ClearProperty.Clear;
 import com.google.gwt.query.client.css.ClipProperty.Shape;
 import com.google.gwt.query.client.css.FontSizeProperty.FontSize;
 import com.google.gwt.query.client.css.FontVariantProperty.FontVariant;
 import com.google.gwt.query.client.css.ListStylePositionProperty.ListStylePosition;
 import com.google.gwt.query.client.css.TextAlignProperty.TextAlign;
+import com.google.gwt.query.client.css.TextTransformProperty.TextTransform;
+import com.google.gwt.query.client.css.WhiteSpaceProperty.WhiteSpace;
 import com.google.gwt.user.client.ui.HTML;
 import com.google.gwt.user.client.ui.RootPanel;
 
@@ -191,7 +198,46 @@ public class GQueryCssTest extends GWTTestCase {
     assertEquals("repeat-x", $("#test").css("backgroundRepeat"));
     assertEquals("repeat-x", $("#test").css(CSS.BACKGROUND_REPEAT));
   }
+  
+  public void testBorderCollapseProperty() {
+
+    $(e).html("<table id='test'><tr><td>Content<td></tr></table>");
+
+    $("#test").css(CSS.BORDER_COLLAPSE, BorderCollapse.COLLAPSE);
 
+    assertEquals("collapse", $("#test").css("borderCollapse"));
+    assertEquals("collapse", $("#test").css(CSS.BORDER_COLLAPSE));
+    
+    $("#test").css(CSS.BORDER_COLLAPSE, BorderCollapse.SEPARATE);
+
+    assertEquals("separate", $("#test").css("borderCollapse"));
+    assertEquals("separate", $("#test").css(CSS.BORDER_COLLAPSE));
+  }
+  
+  public void testCaptionSideProperty() {
+
+    $(e).html("<table id='test'><tr><td>Content<td></tr></table>");
+
+    $("#test").css(CSS.CAPTION_SIDE, CaptionSide.BOTTOM);
+    assertEquals("bottom", $("#test").css("captionSide"));
+    assertEquals("bottom", $("#test").css(CSS.CAPTION_SIDE));
+    
+  }
+
+  public void testBorderSpacingProperty() {
+
+    $(e).html("<table id='test'><tr><td>Content<td></tr></table>");
+
+    $("#test").css(CSS.BORDER_SPACING, new BorderSpacing(Length.px(15)));
+
+    assertEquals("15px 15px", $("#test").css("borderSpacing"));
+    assertEquals("15px 15px", $("#test").css(CSS.BORDER_SPACING));
+    
+    $("#test").css(CSS.BORDER_SPACING, new BorderSpacing(Length.px(10), Length.em(20)));
+
+    assertEquals("10px 20em", $("#test").css("borderSpacing"));
+    assertEquals("10px 20em", $("#test").css(CSS.BORDER_SPACING));
+  }
   public void testBorderColorProperty() {
 
     $(e).html("<div id='test'>Content</div>");
@@ -231,6 +277,26 @@ public class GQueryCssTest extends GWTTestCase {
         LineStyle.SOLID, RGBColor.rgb("#000000"));
     assertEquals("15px solid #000000", $("#test").css("border"));
     assertEquals("15px solid #000000", $("#test").css(CSS.BORDER));
+    
+    $("#test").css(CSS.BORDER_TOP, LineWidth.MEDIUM, LineStyle.SOLID,
+        RGBColor.GRAY);
+    assertEquals("medium solid gray", $("#test").css("borderTop"));
+    assertEquals("medium solid gray", $("#test").css(CSS.BORDER_TOP));
+    
+    $("#test").css(CSS.BORDER_BOTTOM, LineWidth.THIN, LineStyle.DOUBLE,
+        RGBColor.FUSCHIA);
+    assertEquals("thin double fuschia", $("#test").css("borderBottom"));
+    assertEquals("thin double fuschia", $("#test").css(CSS.BORDER_BOTTOM));
+    
+    $("#test").css(CSS.BORDER_LEFT, LineWidth.THIN, LineStyle.SOLID,
+        RGBColor.BLACK);
+    assertEquals("thin solid black", $("#test").css("borderLeft"));
+    assertEquals("thin solid black", $("#test").css(CSS.BORDER_LEFT));
+    
+    $("#test").css(CSS.BORDER_RIGHT, LineWidth.MEDIUM, LineStyle.DASHED,
+        RGBColor.GRAY);
+    assertEquals("medium dashed gray", $("#test").css("borderRight"));
+    assertEquals("medium dashed gray", $("#test").css(CSS.BORDER_RIGHT));
 
   }
 
@@ -295,6 +361,34 @@ public class GQueryCssTest extends GWTTestCase {
 
   }
 
+  public void testClearProperty() {
+
+    $(e).html("<div id='test'>Content</div>");
+
+    $("#test").css(CSS.CLEAR, Clear.BOTH);
+    assertEquals("both", $("#test").css("clear"));
+    assertEquals("both", $("#test").css(CSS.CLEAR));
+    
+    $("#test").css(CSS.CLEAR, Clear.LEFT);
+    assertEquals("left", $("#test").css(CSS.CLEAR));
+    
+    $("#test").css(CSS.CLEAR, Clear.RIGHT);
+    assertEquals("right", $("#test").css(CSS.CLEAR));
+    
+    $("#test").css(CSS.CLEAR, Clear.NONE);
+    assertEquals("none", $("#test").css(CSS.CLEAR));
+
+  }
+
+  public void testClipProperty() {
+
+    $(e).html("<div id='test'>Content</div>");
+
+    $("#test").css(CSS.CLIP, Shape.rect(0, 10, 10, 0));
+    assertEquals("rect(0px,10px,10px,0px)", $("#test").css("clip"));
+    assertEquals("rect(0px,10px,10px,0px)", $("#test").css(CSS.CLIP));
+  }
+
   public void testColorProperty() {
 
     $(e).html("<div id='test'>Content</div>");
@@ -314,7 +408,7 @@ public class GQueryCssTest extends GWTTestCase {
     assertEquals("rgb(35,45,55)", $("#test").css(CSS.COLOR));
 
   }
-
+  
   public void testColorValue() {
 
     $(e).html("<div id='test'>Content</div>");
@@ -380,7 +474,7 @@ public class GQueryCssTest extends GWTTestCase {
     assertEquals("rgb(35,45,55)", $("#test").css(CSS.COLOR));
 
   }
-
+  
   public void testCursorProperty() {
 
     $(e).html("<div id='test'>Content</div>");
@@ -391,34 +485,6 @@ public class GQueryCssTest extends GWTTestCase {
     assertEquals("wait", $("#test").css(CSS.CURSOR));
 
   }
-  
-  public void testClearProperty() {
-
-    $(e).html("<div id='test'>Content</div>");
-
-    $("#test").css(CSS.CLEAR, Clear.BOTH);
-    assertEquals("both", $("#test").css("clear"));
-    assertEquals("both", $("#test").css(CSS.CLEAR));
-    
-    $("#test").css(CSS.CLEAR, Clear.LEFT);
-    assertEquals("left", $("#test").css(CSS.CLEAR));
-    
-    $("#test").css(CSS.CLEAR, Clear.RIGHT);
-    assertEquals("right", $("#test").css(CSS.CLEAR));
-    
-    $("#test").css(CSS.CLEAR, Clear.NONE);
-    assertEquals("none", $("#test").css(CSS.CLEAR));
-
-  }
-  
-  public void testClipProperty() {
-
-    $(e).html("<div id='test'>Content</div>");
-
-    $("#test").css(CSS.CLIP, Shape.rect(0, 10, 10, 0));
-    assertEquals("rect(0px,10px,10px,0px)", $("#test").css("clip"));
-    assertEquals("rect(0px,10px,10px,0px)", $("#test").css(CSS.CLIP));
-  }
 
   public void testDisplayProperty() {
 
@@ -521,7 +587,7 @@ public class GQueryCssTest extends GWTTestCase {
 
   }
 
-  public void testHeightProperty() {
+  public void testHeightProperties() {
 
     $(e).html("<div id='test'>Content</div>");
 
@@ -529,6 +595,16 @@ public class GQueryCssTest extends GWTTestCase {
 
     assertEquals("10px", $("#test").css("height"));
     assertEquals("10px", $("#test").css(CSS.HEIGHT));
+    
+    $("#test").css(CSS.MAX_HEIGHT, Length.px(15));
+
+    assertEquals("15px", $("#test").css("maxHeight"));
+    assertEquals("15px", $("#test").css(CSS.MAX_HEIGHT));
+    
+    $("#test").css(CSS.MIN_HEIGHT, Length.px(5));
+
+    assertEquals("5px", $("#test").css("minHeight"));
+    assertEquals("5px", $("#test").css(CSS.MIN_HEIGHT));
   }
 
   public void testLengthValue() {
@@ -564,6 +640,31 @@ public class GQueryCssTest extends GWTTestCase {
 
   }
 
+  public void testLetterSpacingProperty() {
+
+    $(e).html("<div id='test'>Content</div>");
+
+    $("#test").css(CSS.LETTER_SPACING, Length.px(15));
+    assertEquals("15px", $("#test").css("letterSpacing"));
+    assertEquals("15px", $("#test").css(CSS.LETTER_SPACING));
+
+  }
+
+  public void testLineHeightProperty() {
+
+    $(e).html("<div id='test'>Content</div>");
+
+    $("#test").css(CSS.LINE_HEIGHT, Length.px(15));
+    assertEquals("15px", $("#test").css("lineHeight"));
+    assertEquals("15px", $("#test").css(CSS.LINE_HEIGHT));
+    
+    $("#test").css(CSS.LINE_HEIGHT, new CssNumber(2));
+    assertEquals("2", $("#test").css("lineHeight"));
+    assertEquals("2", $("#test").css(CSS.LINE_HEIGHT));
+    
+
+  }
+
   public void testListStyleImageProperty() {
 
     $(e).html("<ul id='test'><li>Content</li></ul>");
@@ -573,7 +674,7 @@ public class GQueryCssTest extends GWTTestCase {
     assertEquals("url('arrow.jpg')", $("#test").css(CSS.LIST_STYLE_IMAGE));
 
   }
-
+  
   public void testListStylePositionProperty() {
 
     $(e).html("<ul id='test'><li>Content</li></ul>");
@@ -587,16 +688,6 @@ public class GQueryCssTest extends GWTTestCase {
     assertEquals("outside", $("#test").css(CSS.LIST_STYLE_POSITION));
 
   }
-
-  public void testListStyleTypeProperty() {
-
-    $(e).html("<ul id='test'><li>Content</li></ul>");
-
-    $("#test").css(CSS.LIST_STYLE_TYPE, ListStyleType.DISC);
-    assertEquals("disc", $("#test").css("listStyleType"));
-    assertEquals("disc", $("#test").css(CSS.LIST_STYLE_TYPE));
-
-  }
   
   public void testListStyleProperty() {
 
@@ -616,6 +707,16 @@ public class GQueryCssTest extends GWTTestCase {
 
   }
   
+  public void testListStyleTypeProperty() {
+
+    $(e).html("<ul id='test'><li>Content</li></ul>");
+
+    $("#test").css(CSS.LIST_STYLE_TYPE, ListStyleType.DISC);
+    assertEquals("disc", $("#test").css("listStyleType"));
+    assertEquals("disc", $("#test").css(CSS.LIST_STYLE_TYPE));
+
+  }
+  
   public void testMarginProperty() {
 
     $(e).html("<div id='test'>Content</div>");
@@ -646,6 +747,7 @@ public class GQueryCssTest extends GWTTestCase {
     assertEquals("50px", $("#test").css(CSS.MARGIN_RIGHT));
   }
   
+  
   public void testOutlineProperty(){
     $(e).html("<div id='test'>Content</div>");
     
@@ -688,7 +790,6 @@ public class GQueryCssTest extends GWTTestCase {
     
   }
   
-  
   public void testPaddingProperty() {
 
     $(e).html("<div id='test'>Content</div>");
@@ -763,6 +864,41 @@ public class GQueryCssTest extends GWTTestCase {
 
   }
   
+  public void testTextDecorationProperty() {
+
+    $(e).html("<div id='test'>Content</div>");
+
+    $("#test").css(CSS.TEXT_DECORATION, TextDecoration.LINE_THROUGH);
+    assertEquals("line-through", $("#test").css("textDecoration"));
+    assertEquals("line-through", $("#test").css(CSS.TEXT_DECORATION));
+   
+  }
+
+  public void testTextIdentProperty() {
+
+    $(e).html("<div id='test'>Content</div>");
+
+    $("#test").css(CSS.TEXT_IDENT, Length.px(15));
+    assertEquals("15px", $("#test").css("textIdent"));
+    assertEquals("15px", $("#test").css(CSS.TEXT_IDENT));
+   
+  }
+  
+  public void testTextTransformProperty() {
+
+    $(e).html("<div id='test'>Content</div>");
+
+    $("#test").css(CSS.TEXT_TRANSFORM, TextTransform.UPPERCASE);
+    assertEquals("uppercase", $("#test").css("textTransform"));
+    assertEquals("uppercase", $("#test").css(CSS.TEXT_TRANSFORM));
+   
+    $("#test").css(CSS.TEXT_TRANSFORM, TextTransform.LOWERCASE);
+    assertEquals("lowercase", $("#test").css("textTransform"));
+    
+    $("#test").css(CSS.TEXT_TRANSFORM, TextTransform.CAPITALIZE);
+    assertEquals("capitalize", $("#test").css("textTransform"));
+  }
+  
   public void testVerticalAlignProperty() {
 
     $(e).html("<div id='test'>Content</div>");
@@ -815,6 +951,29 @@ public class GQueryCssTest extends GWTTestCase {
 
   }
   
+  public void testWhiteSpaceProperty() {
+
+    $(e).html("<div id='test'>Content</div>");
+
+    $("#test").css(CSS.WHITE_SPACE, WhiteSpace.NORMAL);
+    assertEquals("normal", $("#test").css("whiteSpace"));
+    assertEquals("normal", $("#test").css(CSS.WHITE_SPACE));
+    
+    $("#test").css(CSS.WHITE_SPACE, WhiteSpace.NOWRAP);
+    assertEquals("nowrap", $("#test").css(CSS.WHITE_SPACE));
+    
+    $("#test").css(CSS.WHITE_SPACE, WhiteSpace.PRE);
+    assertEquals("pre", $("#test").css(CSS.WHITE_SPACE));
+    
+    $("#test").css(CSS.WHITE_SPACE, WhiteSpace.PRE_LINE);
+    assertEquals("pre-line", $("#test").css(CSS.WHITE_SPACE));
+    
+    $("#test").css(CSS.WHITE_SPACE, WhiteSpace.PRE_WRAP);
+    assertEquals("pre-wrap", $("#test").css(CSS.WHITE_SPACE));
+   
+  
+  }
+  
   public void testWidthProperty() {
 
     $(e).html("<div id='test'>Content</div>");
@@ -822,7 +981,36 @@ public class GQueryCssTest extends GWTTestCase {
     $("#test").css(CSS.WIDTH, Length.px(20));
     assertEquals("20px", $("#test").css("width"));
     assertEquals("20px", $("#test").css(CSS.WIDTH));
+    
+    $("#test").css(CSS.MIN_WIDTH, Length.px(10));
+    assertEquals("10px", $("#test").css("minWidth"));
+    assertEquals("10px", $("#test").css(CSS.MIN_WIDTH));
+    
+    $("#test").css(CSS.MAX_WIDTH, Length.px(30));
+    assertEquals("30px", $("#test").css("maxWidth"));
+    assertEquals("30px", $("#test").css(CSS.MAX_WIDTH));
+
+  }
+  
+  public void testWordSpacingProperty() {
+
+    $(e).html("<div id='test'>Content</div>");
+
+    $("#test").css(CSS.WORD_SPACING, Length.pt(2));
+    assertEquals("2pt", $("#test").css("wordSpacing"));
+    assertEquals("2pt", $("#test").css(CSS.WORD_SPACING));
+  
+  }
+  
+  public void testZIndexProperty() {
+
+    $(e).html("<div id='test'>Content</div>");
+
+    $("#test").css(CSS.ZINDEX, new CssNumber(1000));
+    assertEquals("1000", $("#test").css("zIndex"));
+    assertEquals("1000", $("#test").css(CSS.ZINDEX));
 
   }
 
+  
 }