From 24e2433c7e70f4c2d1fb08dc47189cef32a54750 Mon Sep 17 00:00:00 2001 From: Julien Dramaix Date: Tue, 15 Feb 2011 22:06:07 +0000 Subject: [PATCH] add possibility to specify a shorthand css property taking 4 values --- .../com/google/gwt/query/client/GQuery.java | 18 ++++++++++++++++-- .../google/gwt/query/client/LazyGQuery.java | 12 ++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java index ce6dc7f3..5ea3f159 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java @@ -37,6 +37,7 @@ import com.google.gwt.dom.client.TextAreaElement; import com.google.gwt.dom.client.Style.Display; import com.google.gwt.query.client.css.CssProperty; import com.google.gwt.query.client.css.CssShorthandProperty3; +import com.google.gwt.query.client.css.CssShorthandProperty4; import com.google.gwt.query.client.css.CssShorthandProperty5; import com.google.gwt.query.client.css.Length; import com.google.gwt.query.client.css.TakeCssValue; @@ -1022,7 +1023,7 @@ public class GQuery implements Lazy { } /** - * Set a multiple style property on every matched element using type-safe + * Set a shorthand style property taking 3 values on every matched element using type-safe * enumerations. ex : $("#id").css(CSS.BORDER, BorderWidth.thick(), * BorderStyle.DASHED, RGBColor.BLACK); */ @@ -1033,9 +1034,22 @@ public class GQuery implements Lazy { } return this; } + + /** + * Set a shorthand style property taking 3 values on every matched element using type-safe + * enumerations. ex : $("#id").css(CSS.BORDER, BorderWidth.thick(), + * BorderStyle.DASHED, RGBColor.BLACK); + */ + public > GQuery css( + T cssProperty, W value0, X value1, Y value2, Z value3) { + for (Element e : elements()) { + cssProperty.set(e.getStyle(), value0, value1, value2, value3); + } + return this; + } /** - * Set a multiple style property on every matched element using type-safe + * Set a shorthand style property taking 5 values on every matched element using type-safe * enumerations. ex : $("#id").css(CSS.BACKGROUND, RGBColor.TRANSPARENT, * BackgroundImage.url("back.jpg"), BackgroundRepeat.NO_REPEAT, * BackgroundAttachment.SCROLL, BackgroundPosition.CENTER); diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java index 6a8599ba..4e62f506 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java @@ -35,6 +35,7 @@ import com.google.gwt.dom.client.TextAreaElement; import com.google.gwt.dom.client.Style.Display; import com.google.gwt.query.client.css.CssProperty; import com.google.gwt.query.client.css.CssShorthandProperty3; +import com.google.gwt.query.client.css.CssShorthandProperty4; import com.google.gwt.query.client.css.CssShorthandProperty5; import com.google.gwt.query.client.css.Length; import com.google.gwt.query.client.css.TakeCssValue; @@ -339,14 +340,21 @@ public interface LazyGQuery extends LazyBase{ LazyGQuery css(TakesLength cssProperty, Length value); /** - * Set a multiple style property on every matched element using type-safe + * Set a shorthand style property taking 3 values on every matched element using type-safe * enumerations. ex : $("#id").css(CSS.BORDER, BorderWidth.thick(), * BorderStyle.DASHED, RGBColor.BLACK); */ > LazyGQuery css( T cssProperty, X value1, Y value2, Z value3); /** - * Set a multiple style property on every matched element using type-safe + * Set a shorthand style property taking 3 values on every matched element using type-safe + * enumerations. ex : $("#id").css(CSS.BORDER, BorderWidth.thick(), + * BorderStyle.DASHED, RGBColor.BLACK); + */ + > LazyGQuery css( T cssProperty, W value0, X value1, Y value2, Z value3); + + /** + * Set a shorthand style property taking 5 values on every matched element using type-safe * enumerations. ex : $("#id").css(CSS.BACKGROUND, RGBColor.TRANSPARENT, * BackgroundImage.url("back.jpg"), BackgroundRepeat.NO_REPEAT, * BackgroundAttachment.SCROLL, BackgroundPosition.CENTER); -- 2.39.5