]> source.dussan.org Git - gwtquery.git/commitdiff
Fixed issue with native compiled selectors.
authorRay Cromwell <cromwellian@gmail.com>
Mon, 11 May 2009 21:22:08 +0000 (21:22 +0000)
committerRay Cromwell <cromwellian@gmail.com>
Mon, 11 May 2009 21:22:08 +0000 (21:22 +0000)
Change initialization pattern for CSS enums to allow better compiler pruning.

gwtquery-core/src/main/java/com/google/gwt/query/Query.gwt.xml
gwtquery-core/src/main/java/com/google/gwt/query/client/css/BackgroundAttachment.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/BackgroundColor.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/Cursor.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/Display.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/Float.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/TextAlign.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/VerticalAlign.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/Visibility.java
gwtquery-core/src/main/java/com/google/gwt/query/client/css/Width.java
gwtquery-core/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorNative.java

index 0e4bf13ab9f7a188da2fdb42d721571209f1cd29..55107c2951713e574aa1ac4866ff312bf51a5abc 100644 (file)
@@ -26,7 +26,6 @@
             <when-property-is name="user.agent" value="gecko"/>\r
             <when-property-is name="user.agent" value="ie6"/>\r
         </any>\r
-\r
     </generate-with>\r
 \r
     <generate-with class="com.google.gwt.query.rebind.SelectorGeneratorXPath">\r
         </any>\r
     </generate-with>\r
 \r
+    <generate-with class="com.google.gwt.query.rebind.SelectorGeneratorNative">\r
+        <when-type-assignable class="com.google.gwt.query.client.Selectors"/>\r
+        <all>\r
+          <when-property-is name="selectorCapability" value="native"/>\r
+          <when-property-is name="user.agent" value="safari"/>\r
+        </all>\r
+    </generate-with>\r
+\r
   \r
     <replace-with class="com.google.gwt.query.client.impl.DocumentStyleImpl">\r
         <when-type-assignable class="com.google.gwt.query.client.impl.DocumentStyleImpl"/>\r
index 49d16a5f7410184b4d866b1eddd800812d4725b6..80ca08cefd70b23f8cde889db8cf7aa15c91a81b 100644 (file)
@@ -1,8 +1,8 @@
 package com.google.gwt.query.client.css;
 
-import com.google.gwt.dom.client.Style;
-import com.google.gwt.core.client.JavaScriptObject;
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.dom.client.Style;
 
 /**
  * This property affects the vertical positioning inside a line box of the boxes
@@ -11,13 +11,10 @@ import com.google.gwt.core.client.GWT;
 public class BackgroundAttachment
     implements CssProperty<BackgroundAttachment.AttachValue> {
 
-  public BackgroundAttachment() {
-    CSS.FIXED = AttachValue.create("fixed");
-    CSS.SCROLL = AttachValue.create("scroll");
-  }
-
   public static void init() {
     CSS.BACKGROUND_ATTACHMENT = new BackgroundAttachment();
+    CSS.FIXED = AttachValue.create("fixed");
+    CSS.SCROLL = AttachValue.create("scroll");
   }
 
   public void set(Style s, AttachValue value) {
index 8f7a62dc938233b463d675c544903f6ea22cb984..288f2c8e2701987dd7594aea8682018c22446722 100644 (file)
@@ -11,9 +11,6 @@ import com.google.gwt.core.client.GWT;
 public class BackgroundColor
     implements CssProperty<RGBColor> {
 
-  public BackgroundColor() {
-  }
-
   public static void init() {
     CSS.BACKGROUND_COLOR = new BackgroundColor();
   }
index 93ad3f46f70b7011c109a9a0ce8a1559518d1f7a..3c3a83c9dade3cc0a97e5cc0eae313df290da37d 100644 (file)
@@ -1,8 +1,8 @@
 package com.google.gwt.query.client.css;
 
-import com.google.gwt.dom.client.Style;
-import com.google.gwt.core.client.JavaScriptObject;
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.dom.client.Style;
 
 /**
  * This property specifies whether a box should float to the left, right, or not
@@ -11,7 +11,8 @@ import com.google.gwt.core.client.GWT;
  */
 public class Cursor implements CssProperty<Cursor.CursorValue> {
 
-  public Cursor() {
+  public static void init() {
+    CSS.CURSOR = new Cursor();
     CSS.CURSOR_AUTO = CursorValue.create("auto");
     CSS.CURSOR_CROSSHAIR = CursorValue.create("crosshair");
     CSS.CURSOR_DEFAULT = CursorValue.create("default");
@@ -31,10 +32,6 @@ public class Cursor implements CssProperty<Cursor.CursorValue> {
     CSS.CURSOR_W_RESIZE = CursorValue.create("w-resize");
   }
 
-  public static void init() {
-    CSS.CURSOR = new Cursor();
-  }
-
   public void set(Style s, CursorValue value) {
     s.setProperty("float", value.value());
   }
index 732d04c016c9bc942862470cc5e64942cf578360..f8f654570fc624c6097a34f54f8ee42bec31ea41 100644 (file)
@@ -1,8 +1,8 @@
 package com.google.gwt.query.client.css;
 
-import com.google.gwt.dom.client.Style;
-import com.google.gwt.core.client.JavaScriptObject;
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.dom.client.Style;
 
 /**
  * This property specifies the mechanism by which elements are rendered.
@@ -41,9 +41,6 @@ public class Display implements CssProperty<Display.DisplayValue> {
 
   public static void init() {
     CSS.DISPLAY = new Display();
-  }
-
-  public Display() {
     CSS.BLOCK = DisplayValue.create("block");
     CSS.INLINE = DisplayValue.create("inline");
     CSS.INLINE_BLOCK = DisplayValue.create("inline-block");
index ad28549e33a2b65325bdbbe4c11acdac7f5f06cc..e9bd45e50bdd9046a6ea203fca85f56e71d9bd31 100644 (file)
@@ -1,8 +1,8 @@
 package com.google.gwt.query.client.css;
 
-import com.google.gwt.dom.client.Style;
-import com.google.gwt.core.client.JavaScriptObject;
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.dom.client.Style;
 
 /**
  * This property specifies whether a box should float to the left, right, or not
@@ -11,16 +11,13 @@ import com.google.gwt.core.client.GWT;
  */
 public class Float implements CssProperty<Float.FloatValue> {
 
-  public Float() {
+  public static void init() {
+    CSS.FLOAT = new Float();
     CSS.FLOAT_LEFT = FloatValue.create("left");
     CSS.FLOAT_RIGHT = FloatValue.create("right");
     CSS.FLOAT_NONE = FloatValue.create("none");
   }
 
-  public static void init() {
-    CSS.FLOAT = new Float();
-  }
-
   public void set(Style s, FloatValue value) {
     s.setProperty("float", value.value());
   }
index 0936050d35d0deeaa352609e6d600f614caa416c..b3c4689792063c4fee966772f4afa3e42d986a97 100644 (file)
@@ -1,25 +1,22 @@
 package com.google.gwt.query.client.css;
 
-import com.google.gwt.dom.client.Style;
-import com.google.gwt.core.client.JavaScriptObject;
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.dom.client.Style;
 
 /**
  * This property describes how inline content of a block is aligned.
  */
 public class TextAlign implements CssProperty<TextAlign.TAlignValue> {
 
-  public TextAlign() {
+  public static void init() {
+    CSS.TEXT_ALIGN = new TextAlign();
     CSS.LEFT = TAlignValue.create("left");
     CSS.RIGHT = TAlignValue.create("right");
     CSS.CENTER = TAlignValue.create("center");
     CSS.JUSTIFY = TAlignValue.create("justify");
   }
 
-  public static void init() {
-    CSS.TEXT_ALIGN = new TextAlign();
-  }
-
   public void set(Style s, TAlignValue value) {
     s.setProperty("textAlign", value.value());
   }
index fbd1c8430fa7c253828f1ce4c26ebc3f2ae3a476..358b070503279150cde69e1ffef7a726dbb80429 100644 (file)
@@ -1,9 +1,8 @@
 package com.google.gwt.query.client.css;
 
-import com.google.gwt.dom.client.Style;
-import com.google.gwt.core.client.JavaScriptObject;
 import com.google.gwt.core.client.GWT;
-
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.dom.client.Style;
 import static com.google.gwt.query.client.css.VerticalAlign.VAlignValue.create;
 
 /**
@@ -14,7 +13,8 @@ public class VerticalAlign
     implements CssProperty<VerticalAlign.VAlignValue>, TakesPercentage,
     TakesLength {
 
-  public VerticalAlign() {
+  public static void init() {
+    CSS.VERTICAL_ALIGN = new VerticalAlign();
     CSS.TOP = create("top");
     CSS.BOTTOM = create("bottom");
     CSS.BASELINE = create("baseline");
@@ -25,10 +25,6 @@ public class VerticalAlign
     CSS.TEXT_BOTTOM = create("text-bottom");
   }
 
-  public static void init() {
-    CSS.VERTICAL_ALIGN = new VerticalAlign();
-  }
-
   public void set(Style s, VAlignValue value) {
     s.setProperty("verticalAlign", value.value());
   }
index 4e684915f8abf75d9585056df3ff7286fd59566d..f90a7e4d3d2ac04ac12686f77f7ca0605e1354d8 100644 (file)
@@ -1,8 +1,8 @@
 package com.google.gwt.query.client.css;
 
-import com.google.gwt.dom.client.Style;
-import com.google.gwt.core.client.JavaScriptObject;
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.dom.client.Style;
 
 /**
  * The 'visibility' property specifies whether the boxes generated by an element
@@ -12,16 +12,13 @@ import com.google.gwt.core.client.GWT;
  */
 public class Visibility implements CssProperty<Visibility.VisibilityValue> {
 
-  public Visibility() {
+  public static void init() {
+    CSS.VISIBILITY = new Visibility();
     CSS.VISIBLE = VisibilityValue.create("visible");
     CSS.HIDDEN = VisibilityValue.create("hidden");
     CSS.COLLAPSE = VisibilityValue.create("collapse");
   }
 
-  public static void init() {
-    CSS.VISIBILITY = new Visibility();
-  }
-
   public void set(Style s, VisibilityValue value) {
     s.setProperty("visibility", value.value());
   }
index 5a585050b46e50ffbf5af8b270115a848a97baa5..d6b29b5456ded630fef4934aa45d96371b301be6 100644 (file)
@@ -19,9 +19,6 @@ import com.google.gwt.core.client.GWT;
  */
 public class Width implements TakesLength, TakesPercentage {
 
-  public Width() {
-  }
-
   public static void init() {
     CSS.WIDTH = new Width();
   }
index 5ca3934b6e13997a1015e2834cace850a027b031..f0ef1ae9501455cd85ea5171c5c4e4e9ae9f576d 100644 (file)
@@ -31,6 +31,11 @@ public class SelectorGeneratorNative extends SelectorGeneratorBase {
     return "Native" + super.getImplSuffix();\r
   }\r
 \r
+  @Override\r
+  protected boolean hasGetElementsByClassName() {\r
+    return true;\r
+  }\r
+\r
   protected void generateMethodBody(SourceWriter sw, JMethod method,\r
       TreeLogger treeLogger, boolean hasContext)\r
       throws UnableToCompleteException {\r