* </pre>\r
* \r
*/\r
- public GQuery css(CssSetter cssSetter) {\r
+ public GQuery css(CssSetter... cssSetter) {\r
for (Element e : elements()) {\r
- cssSetter.applyCss(e);\r
+ for (CssSetter s : cssSetter) {\r
+ s.applyCss(e);\r
+ }\r
}\r
return this;\r
}\r
* if there isn't any.\r
*/\r
public <W extends Widget> W widget() {\r
+ return widget(0);\r
+ }\r
+\r
+ /**\r
+ * Return the nth non null attached widget from the matched elements or null\r
+ * if there isn't any.\r
+ */\r
+ public <W extends Widget> W widget(int n) {\r
for (Element e : elements()) {\r
@SuppressWarnings("unchecked")\r
W w = (W) getAssociatedWidget(e);\r
if (w != null) {\r
- return w;\r
+ if (n == 0) {\r
+ return w;\r
+ }\r
+ n--;\r
}\r
}\r
return null;\r