From: Manolo Carrasco Date: Tue, 5 Apr 2011 09:40:21 +0000 (+0000) Subject: update lazy widgets api X-Git-Tag: release-1.3.2~434 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9e589375d695e492c45004a5868163b97c741631;p=gwtquery.git update lazy widgets api --- diff --git a/devtest/pom.xml b/devtest/pom.xml index 2c69b0c4..add223c3 100644 --- a/devtest/pom.xml +++ b/devtest/pom.xml @@ -52,8 +52,7 @@ - - + org.codehaus.mojo gwt-maven-plugin ${gwtmaven} @@ -67,8 +66,23 @@ target/www true - - + + + org.apache.maven.plugins + maven-eclipse-plugin + + true + false + + + com.google.gwt.eclipse.core.gwtProjectValidator + + + + com.google.gwt.eclipse.core.gwtNature + + + diff --git a/devtest/src/main/java/com/google/gwt/query/client/DevTestRunner.java b/devtest/src/main/java/com/google/gwt/query/client/DevTestRunner.java index f8f56215..912e16d8 100644 --- a/devtest/src/main/java/com/google/gwt/query/client/DevTestRunner.java +++ b/devtest/src/main/java/com/google/gwt/query/client/DevTestRunner.java @@ -18,12 +18,15 @@ package com.google.gwt.query.client; import static com.google.gwt.query.client.GQuery.$; import com.google.gwt.core.client.EntryPoint; +import com.google.gwt.dom.client.Element; import com.google.gwt.event.dom.client.FocusHandler; import com.google.gwt.event.shared.GwtEvent; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.query.client.js.JsUtils; +import com.google.gwt.query.client.plugins.Events; import com.google.gwt.query.client.plugins.effects.PropertiesAnimation; import com.google.gwt.query.client.plugins.effects.PropertiesAnimation.Easing; +import com.google.gwt.user.client.Event; import com.google.gwt.user.client.Timer; /** @@ -46,13 +49,44 @@ public class DevTestRunner extends MyTestCase implements EntryPoint { public void onModuleLoad() { try { gwtSetUp(); - testPropertiesAnimationComputeEffects(); + testLive(); +// testPropertiesAnimationComputeEffects(); } catch (Exception ex) { ex.printStackTrace(); $(e).html("").after("
ERROR: " + ex.getMessage() + "
"); } } + public void testAttrSelectors() { + System.out.println($("script:not([src])")); +// System.out.println($("iframe:not([language])")); + + } + + public void testLive() { + $(e).html("
Content 1
"); + GQuery q = $(".clickMe").live(Event.ONCLICK, new Function(){ + public void f(Element e) { + $(e).css("color", "red"); + } + }); + $(e).append("
Content 2
"); + assertEquals("", $("#d1").css("color")); + + $(".clickMe", e).click(); + assertEquals("red", $("#d1").css("color")); + assertEquals("red", $("#d2").css("color")); + + $(".clickMe", e).css("color", "yellow"); + $(".clickMe").die(Event.ONCLICK); + $(e).append("
Content 3
"); + $(".clickMe", e).click(); + assertEquals("yellow", $("#d1").css("color")); + assertEquals("yellow", $("#d2").css("color")); + assertEquals("", $("#d3").css("color")); + } + + public void testPropertiesAnimationComputeEffects() { $(e) .html( diff --git a/devtest/src/main/java/com/google/gwt/query/public/test.html b/devtest/src/main/java/com/google/gwt/query/public/test.html index aa38d9c8..fded2886 100644 --- a/devtest/src/main/java/com/google/gwt/query/public/test.html +++ b/devtest/src/main/java/com/google/gwt/query/public/test.html @@ -4,6 +4,8 @@ + + diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyWidgets.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyWidgets.java index cbc1581e..21822380 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyWidgets.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyWidgets.java @@ -14,307 +14,18 @@ * the License. */ package com.google.gwt.query.client.plugins; +import java.util.ArrayList; +import java.util.List; import com.google.gwt.dom.client.Element; import com.google.gwt.query.client.GQuery; -import com.google.gwt.query.client.plugins.widgets.ButtonWidgetFactory; -import com.google.gwt.query.client.plugins.widgets.CheckBoxWidgetFactory; -import com.google.gwt.query.client.plugins.widgets.DateBoxWidgetFactory; -import com.google.gwt.query.client.plugins.widgets.DecoratorPanelWidgetFactory; -import com.google.gwt.query.client.plugins.widgets.DisclosurePanelWidgetFactory; -import com.google.gwt.query.client.plugins.widgets.ListBoxWidgetFactory; -import com.google.gwt.query.client.plugins.widgets.PasswordTextBoxWidgetFactory; -import com.google.gwt.query.client.plugins.widgets.RadioButtonWidgetFactory; -import com.google.gwt.query.client.plugins.widgets.StackPanelWidgetFactory; -import com.google.gwt.query.client.plugins.widgets.SuggestBoxWidgetFactory; -import com.google.gwt.query.client.plugins.widgets.TabPanelWidgetFactory; -import com.google.gwt.query.client.plugins.widgets.TextAreaWidgetFactory; -import com.google.gwt.query.client.plugins.widgets.TextBoxWidgetFactory; import com.google.gwt.query.client.plugins.widgets.WidgetFactory; import com.google.gwt.query.client.plugins.widgets.WidgetInitializer; import com.google.gwt.query.client.plugins.widgets.WidgetsUtils; -import com.google.gwt.query.client.plugins.widgets.DisclosurePanelWidgetFactory.DisclosurePanelOptions; -import com.google.gwt.query.client.plugins.widgets.ListBoxWidgetFactory.ListBoxOptions; -import com.google.gwt.query.client.plugins.widgets.RadioButtonWidgetFactory.RadioButtonOption; -import com.google.gwt.query.client.plugins.widgets.StackPanelWidgetFactory.StackPanelOptions; -import com.google.gwt.query.client.plugins.widgets.SuggestBoxWidgetFactory.SuggestBoxOptions; -import com.google.gwt.query.client.plugins.widgets.TabPanelWidgetFactory.TabPanelOptions; -import com.google.gwt.user.client.ui.Button; -import com.google.gwt.user.client.ui.CheckBox; -import com.google.gwt.user.client.ui.DecoratorPanel; -import com.google.gwt.user.client.ui.DisclosurePanel; -import com.google.gwt.user.client.ui.ListBox; -import com.google.gwt.user.client.ui.PasswordTextBox; -import com.google.gwt.user.client.ui.RadioButton; -import com.google.gwt.user.client.ui.StackPanel; -import com.google.gwt.user.client.ui.SuggestBox; -import com.google.gwt.user.client.ui.TabPanel; -import com.google.gwt.user.client.ui.TextArea; -import com.google.gwt.user.client.ui.TextBox; import com.google.gwt.user.client.ui.Widget; -import com.google.gwt.user.datepicker.client.DateBox; -import java.util.ArrayList; -import java.util.List; import com.google.gwt.query.client.LazyBase; public interface LazyWidgets extends LazyBase{ - /** - * Create a {@link Button} widget for each selected element. The - * initializers will be called on each new {@link Button} created - * by passing them in parameter. - * - */ - LazyWidgets button(); - - /** - * Create a {@link Button} widget for each selected element. The - * initializers will be called on each new {@link Button} created - * by passing them in parameter. - * - */ - LazyWidgets button(WidgetInitializer