]> source.dussan.org Git - gwtquery.git/commitdiff
implement Manolo's idea : use with() method to facilitate eclipse auto-completion
authorJulien Dramaix <julien.dramaix@gmail.com>
Thu, 24 Feb 2011 21:46:35 +0000 (21:46 +0000)
committerJulien Dramaix <julien.dramaix@gmail.com>
Thu, 24 Feb 2011 21:46:35 +0000 (21:46 +0000)
samples/src/main/java/gwtquery/samples/client/GwtQueryWidgetModule.java

index 3ce6f9b342d0733879ff059c8a28e3031cc3ac0c..7ef2ce0398e715d5df161ee91f45591b4059a63b 100644 (file)
@@ -86,16 +86,15 @@ public class GwtQueryWidgetModule implements EntryPoint {
     \r
     $("#tabs").as(Widgets).tabPanel();\r
     \r
-    // IDE suggestions are not available with this syntax. \r
+    // IDE suggestions are not available with this syntax. -> I agree\r
     // Also it implies that the css method in GQuery needs more overloads\r
-    $("#aaa").css(CSS.POSITION, Position.ABSOLUTE);\r
-    $("#aaa").css(CSS.TOP, Length.cm(15));\r
-    $("#aaa").css(CSS.BACKGROUND, RGBColor.RED, ImageValue.url(""), BackgroundRepeat.NO_REPEAT, BackgroundAttachment.FIXED, BackgroundPosition.CENTER);\r
+    // $("#aaa").css(CSS.POSITION, Position.ABSOLUTE);\r
+    // $("#aaa").css(CSS.TOP, Length.cm(15));\r
+    // $("#aaa").css(CSS.BACKGROUND, RGBColor.RED, ImageValue.url(""), BackgroundRepeat.NO_REPEAT, BackgroundAttachment.FIXED, BackgroundPosition.CENTER);\r
     \r
-    // With this syntax IDE gives more help\r
-    // We could overload the with method in each CssProperty without adding more methods to GQuery\r
-    $("#aaa").css(CSS.TOP.with(Length.cm(15)));\r
-    $("#aaa").css(CSS.BACKGROUND.with(RGBColor.SILVER, ImageValue.url(""), BackgroundRepeat.NO_REPEAT, BackgroundAttachment.FIXED, BackgroundPosition.CENTER)); \r
+    $("#aaa").setCss(CSS.TOP.with(Length.cm(15)));\r
+    $("#aaa").setCss(CSS.BACKGROUND.with(RGBColor.SILVER, ImageValue.url(""), BackgroundRepeat.NO_REPEAT, BackgroundAttachment.FIXED, BackgroundPosition.CENTER)); \r
+    $("#aaa").setCss(CSS.BACKGROUND_ATTACHMENT.with(BackgroundAttachment.FIXED));\r
   }\r
   \r
   private ButtonOptions createButtonOptions(){\r