From 45de0912002973a5ba43baf88abd5cb042017bb2 Mon Sep 17 00:00:00 2001 From: Julien Dramaix Date: Thu, 24 Feb 2011 21:46:35 +0000 Subject: implement Manolo's idea : use with() method to facilitate eclipse auto-completion --- .../gwtquery/samples/client/GwtQueryWidgetModule.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'samples/src/main') diff --git a/samples/src/main/java/gwtquery/samples/client/GwtQueryWidgetModule.java b/samples/src/main/java/gwtquery/samples/client/GwtQueryWidgetModule.java index 3ce6f9b3..7ef2ce03 100644 --- a/samples/src/main/java/gwtquery/samples/client/GwtQueryWidgetModule.java +++ b/samples/src/main/java/gwtquery/samples/client/GwtQueryWidgetModule.java @@ -86,16 +86,15 @@ public class GwtQueryWidgetModule implements EntryPoint { $("#tabs").as(Widgets).tabPanel(); - // IDE suggestions are not available with this syntax. + // IDE suggestions are not available with this syntax. -> I agree // Also it implies that the css method in GQuery needs more overloads - $("#aaa").css(CSS.POSITION, Position.ABSOLUTE); - $("#aaa").css(CSS.TOP, Length.cm(15)); - $("#aaa").css(CSS.BACKGROUND, RGBColor.RED, ImageValue.url(""), BackgroundRepeat.NO_REPEAT, BackgroundAttachment.FIXED, BackgroundPosition.CENTER); + // $("#aaa").css(CSS.POSITION, Position.ABSOLUTE); + // $("#aaa").css(CSS.TOP, Length.cm(15)); + // $("#aaa").css(CSS.BACKGROUND, RGBColor.RED, ImageValue.url(""), BackgroundRepeat.NO_REPEAT, BackgroundAttachment.FIXED, BackgroundPosition.CENTER); - // With this syntax IDE gives more help - // We could overload the with method in each CssProperty without adding more methods to GQuery - $("#aaa").css(CSS.TOP.with(Length.cm(15))); - $("#aaa").css(CSS.BACKGROUND.with(RGBColor.SILVER, ImageValue.url(""), BackgroundRepeat.NO_REPEAT, BackgroundAttachment.FIXED, BackgroundPosition.CENTER)); + $("#aaa").setCss(CSS.TOP.with(Length.cm(15))); + $("#aaa").setCss(CSS.BACKGROUND.with(RGBColor.SILVER, ImageValue.url(""), BackgroundRepeat.NO_REPEAT, BackgroundAttachment.FIXED, BackgroundPosition.CENTER)); + $("#aaa").setCss(CSS.BACKGROUND_ATTACHMENT.with(BackgroundAttachment.FIXED)); } private ButtonOptions createButtonOptions(){ -- cgit v1.2.3