diff options
author | Ray Cromwell <cromwellian@gmail.com> | 2008-06-03 23:14:56 +0000 |
---|---|---|
committer | Ray Cromwell <cromwellian@gmail.com> | 2008-06-03 23:14:56 +0000 |
commit | 84b16e70640b7c29179105898a45b168092cc87e (patch) | |
tree | 01d31fa01bdd81a09f166f0ff202ff6a68c014c0 /gwtquery-core/src/main/java/gwtquery | |
parent | e706b8b5da89557e0476b8e43300a59eeb98954d (diff) | |
download | gwtquery-84b16e70640b7c29179105898a45b168092cc87e.tar.gz gwtquery-84b16e70640b7c29179105898a45b168092cc87e.zip |
0.2 release (breaks rc1 compiler?)
Diffstat (limited to 'gwtquery-core/src/main/java/gwtquery')
4 files changed, 10 insertions, 134 deletions
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<Element> titleAndh1Title(); - - @Selector("body") - NodeList<Element> body(); - - @Selector("body div") - NodeList<Element> bodyDiv(); - - @Selector("div p") - NodeList<Element> divP(); - - @Selector("div > div") - NodeList<Element> divGtP(); - - @Selector("div + p") - NodeList<Element> divPlusP(); - - @Selector("div ~ p") - NodeList<Element> divTildeP(); - - @Selector("div[class^=exa][class$=mple]") - NodeList<Element> divPrefixExaSuffixMple(); - - @Selector("div p a") - NodeList<Element> divPA(); - -// @Selector("div, p a") -// NodeList<Element> divCommaPA(); - - @Selector(".note") - NodeList<Element> note(); - - @Selector("div .example") - NodeList<Element> divExample(); - - @Selector("ul .tocline2") - NodeList<Element> ulTocline2(); - - @Selector("#title") - NodeList<Element> title(); - - @Selector("h1#title") - NodeList<Element> h1Title(); - - @Selector("div #title") - NodeList<Element> divSpaceTitle(); - - @Selector("ui.toc li.tocline2") - NodeList<Element> ulTocLiTocLine2(); - - @Selector("h1#title + div > p") - NodeList<Element> h1TitlePlusDivGtP(); - -// @Selector("h1[id]:contains(Selectors)") -// NodeList<Element> h1IdContainsSelectors(); -// - @Selector("a[href][lang][class]") - NodeList<Element> aHrefLangClass(); - - @Selector("div[class]") - NodeList<Element> divWithClass(); - - @Selector("div[class=example]") - NodeList<Element> divWithClassExample(); - - @Selector("div[class^=exa]") - NodeList<Element> divWithClassPrefixExa(); - - @Selector("div[class$=mple]") - NodeList<Element> divWithClassSuffixMple(); - - @Selector("div[class~=dialog]") - NodeList<Element> divWithClassContainsDialog(); - - @Selector("div[class*=e]") - NodeList<Element> divWithClassContainsE(); - -// @Selector("div[class!=madeup]") -// NodeList<Element> divWithClassNotContainsMadeup(); -// - - @Selector("div[class~=dialog]") - NodeList<Element> divWithClassListContainsDialog(); - - @Selector("*:checked") - NodeList<Element> allChecked(); - -// @Selector("*:first") -// NodeList<Element> allFirst(); -// - @Selector("div:not(.example)") - NodeList<Element> divNotExample(); - -// @Selector("p:contains(selectors)") -// NodeList<Element> pContainsSelectors(); - - @Selector("p:nth-child(even)") - NodeList<Element> nThChildEven(); - - @Selector("p:nth-child(2n)") - NodeList<Element> nThChild2n(); - - @Selector("p:nth-child(odd)") - NodeList<Element> nThChildOdd(); - - @Selector("p:nth-child(2n+1)") - NodeList<Element> nThChild2nPlus1(); - - @Selector("p:nth-child(n)") - NodeList<Element> nthChild(); - - @Selector("p:only-child") - NodeList<Element> onlyChild(); - - @Selector("p:last-child") - NodeList<Element> lastChild(); - - @Selector("p:first-child") - NodeList<Element> 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();
|