* Return a lazy version of the GQuery interface. Lazy function calls are\r
* simply queued up and not executed immediately.\r
*/\r
- public static LazyGQuery lazy() {\r
+ public static LazyGQuery<?> lazy() {\r
return GQuery.$().createLazy();\r
}\r
\r
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Node;
+import com.google.gwt.query.client.css.CssProperty;
/**
* Created by IntelliJ IDEA. User: ray Date: May 2, 2009 Time: 10:48:07 PM To
* inferred from the CSS property type
* @return
*/
- // <T> LazyGQuery<T> css(CssProperty<T> property, T value);
+ <S, P extends CssProperty<S>> LazyGQuery<T> css(P cssProperty, S value);
+
/**
* Set a key/value object as style properties to all matched elements. This
import com.google.gwt.junit.DoNotRunWith;
import com.google.gwt.junit.Platform;
import com.google.gwt.junit.client.GWTTestCase;
+import com.google.gwt.query.client.css.CSS;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HTML;
RootPanel.get().add(testPanel);
e = testPanel.getElement();
e.setId("evnt-tst");
+
+ CSS.init();
} else {
e.setInnerHTML("");
}
$("p", e).dblclick();
assertEquals("yellow", $("p", e).css("color"));
}
+
+ public void testLazyMethods() {
+ $(e).css("color", "white");
+ assertEquals("white", $(e).css("color"));
+
+ $(e).one(Event.ONCLICK, null, lazy().css("color", "red").done());
+ $(e).click();
+ assertEquals("red", $(e).css("color"));
+
+ $(e).click(lazy().css(CSS.COLOR, CSS.BLACK).done());
+ $(e).click();
+ assertEquals("black", $(e).css("color"));
+ }
public void testWidgetEvents() {
final Button b = new Button("click-me");