From 84b16e70640b7c29179105898a45b168092cc87e Mon Sep 17 00:00:00 2001 From: Ray Cromwell Date: Tue, 3 Jun 2008 23:14:56 +0000 Subject: 0.2 release (breaks rc1 compiler?) --- .../src/main/java/gwtquery/client/Effects.java | 2 +- .../src/main/java/gwtquery/client/MySelectors.java | 130 --------------------- .../src/main/java/gwtquery/client/Selector.java | 2 +- .../gwtquery/rebind/SelectorGeneratorBase.java | 10 +- 4 files changed, 10 insertions(+), 134 deletions(-) delete mode 100644 gwtquery-core/src/main/java/gwtquery/client/MySelectors.java (limited to 'gwtquery-core/src/main/java/gwtquery') diff --git a/gwtquery-core/src/main/java/gwtquery/client/Effects.java b/gwtquery-core/src/main/java/gwtquery/client/Effects.java index abe6345c..d7c42b9d 100644 --- a/gwtquery-core/src/main/java/gwtquery/client/Effects.java +++ b/gwtquery-core/src/main/java/gwtquery/client/Effects.java @@ -2,7 +2,7 @@ package gwtquery.client; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.NodeList; -import com.google.gwt.user.client.animation.Animation; +import com.google.gwt.animation.client.Animation; public class Effects extends GQuery { diff --git a/gwtquery-core/src/main/java/gwtquery/client/MySelectors.java b/gwtquery-core/src/main/java/gwtquery/client/MySelectors.java deleted file mode 100644 index 5059893b..00000000 --- a/gwtquery-core/src/main/java/gwtquery/client/MySelectors.java +++ /dev/null @@ -1,130 +0,0 @@ -package gwtquery.client; - -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.NodeList; - -/** -*/ -public interface MySelectors extends Selectors { - - @Selector("#title,h1#title") - NodeList titleAndh1Title(); - - @Selector("body") - NodeList body(); - - @Selector("body div") - NodeList bodyDiv(); - - @Selector("div p") - NodeList divP(); - - @Selector("div > div") - NodeList divGtP(); - - @Selector("div + p") - NodeList divPlusP(); - - @Selector("div ~ p") - NodeList divTildeP(); - - @Selector("div[class^=exa][class$=mple]") - NodeList divPrefixExaSuffixMple(); - - @Selector("div p a") - NodeList divPA(); - -// @Selector("div, p a") -// NodeList divCommaPA(); - - @Selector(".note") - NodeList note(); - - @Selector("div .example") - NodeList divExample(); - - @Selector("ul .tocline2") - NodeList ulTocline2(); - - @Selector("#title") - NodeList title(); - - @Selector("h1#title") - NodeList h1Title(); - - @Selector("div #title") - NodeList divSpaceTitle(); - - @Selector("ui.toc li.tocline2") - NodeList ulTocLiTocLine2(); - - @Selector("h1#title + div > p") - NodeList h1TitlePlusDivGtP(); - -// @Selector("h1[id]:contains(Selectors)") -// NodeList h1IdContainsSelectors(); -// - @Selector("a[href][lang][class]") - NodeList aHrefLangClass(); - - @Selector("div[class]") - NodeList divWithClass(); - - @Selector("div[class=example]") - NodeList divWithClassExample(); - - @Selector("div[class^=exa]") - NodeList divWithClassPrefixExa(); - - @Selector("div[class$=mple]") - NodeList divWithClassSuffixMple(); - - @Selector("div[class~=dialog]") - NodeList divWithClassContainsDialog(); - - @Selector("div[class*=e]") - NodeList divWithClassContainsE(); - -// @Selector("div[class!=madeup]") -// NodeList divWithClassNotContainsMadeup(); -// - - @Selector("div[class~=dialog]") - NodeList divWithClassListContainsDialog(); - - @Selector("*:checked") - NodeList allChecked(); - -// @Selector("*:first") -// NodeList allFirst(); -// - @Selector("div:not(.example)") - NodeList divNotExample(); - -// @Selector("p:contains(selectors)") -// NodeList pContainsSelectors(); - - @Selector("p:nth-child(even)") - NodeList nThChildEven(); - - @Selector("p:nth-child(2n)") - NodeList nThChild2n(); - - @Selector("p:nth-child(odd)") - NodeList nThChildOdd(); - - @Selector("p:nth-child(2n+1)") - NodeList nThChild2nPlus1(); - - @Selector("p:nth-child(n)") - NodeList nthChild(); - - @Selector("p:only-child") - NodeList onlyChild(); - - @Selector("p:last-child") - NodeList lastChild(); - - @Selector("p:first-child") - NodeList firstChild(); -} diff --git a/gwtquery-core/src/main/java/gwtquery/client/Selector.java b/gwtquery-core/src/main/java/gwtquery/client/Selector.java index a137faa4..0ec58e5e 100644 --- a/gwtquery-core/src/main/java/gwtquery/client/Selector.java +++ b/gwtquery-core/src/main/java/gwtquery/client/Selector.java @@ -9,7 +9,7 @@ import static java.lang.annotation.ElementType.METHOD; * Used to pass a CSS Selector to a generator at compile time */ @Target({METHOD}) -@Retention(RetentionPolicy.SOURCE) +@Retention(RetentionPolicy.RUNTIME) public @interface Selector { String value(); } diff --git a/gwtquery-core/src/main/java/gwtquery/rebind/SelectorGeneratorBase.java b/gwtquery-core/src/main/java/gwtquery/rebind/SelectorGeneratorBase.java index 21630d1d..c511189e 100644 --- a/gwtquery-core/src/main/java/gwtquery/rebind/SelectorGeneratorBase.java +++ b/gwtquery-core/src/main/java/gwtquery/rebind/SelectorGeneratorBase.java @@ -60,7 +60,10 @@ public abstract class SelectorGeneratorBase extends Generator { "DeferredGQuery[] dg = new DeferredGQuery[" + (methods.length) + "];"); int i = 0; for (JMethod m : methods) { - String selector = m.getAnnotation(Selector.class).value(); + Selector selectorAnnotation = m.getAnnotation(Selector.class); + if(selectorAnnotation == null) continue; + String selector = selectorAnnotation.value(); + sw.println("dg[" + i + "]=new DeferredGQuery() {"); sw.indent(); sw.println( @@ -83,7 +86,10 @@ public abstract class SelectorGeneratorBase extends Generator { public void generateMethod(SourceWriter sw, JMethod method, TreeLogger logger) throws UnableToCompleteException { - String selector = method.getAnnotation(Selector.class).value(); + Selector selectorAnnotation = method.getAnnotation(Selector.class); + if(selectorAnnotation == null) return; + + String selector = selectorAnnotation.value(); JParameter[] params = method.getParameters(); sw.indent(); -- cgit v1.2.3