import com.google.gwt.user.client.EventListener;\r
import com.google.gwt.user.client.Window;\r
import com.google.gwt.user.client.ui.GqUi;\r
+import com.google.gwt.user.client.ui.IsWidget;\r
import com.google.gwt.user.client.ui.Widget;\r
\r
/**\r
if (o instanceof JavaScriptObject) {\r
return $((JavaScriptObject)o);\r
}\r
- if (o instanceof Widget) {\r
- return $(new Widget[]{(Widget)o});\r
+ if (o instanceof IsWidget) {\r
+ return $(Arrays.asList(o));\r
}\r
System.err.println("GQuery.$(Object o) could not wrap the type : " + o.getClass());\r
}\r
for (Object o : nodesOrWidgets) {\r
if (o instanceof Node) {\r
elms.addNode((Node) o);\r
- } else if (o instanceof Widget) {\r
- elms.addNode(((Widget) o).getElement());\r
+ } else if (o instanceof IsWidget) {\r
+ elms.addNode(((IsWidget)o).asWidget().getElement());\r
}\r
}\r
}\r
}\r
} catch (Exception e2) {\r
// Some times this code could raise an exception.\r
- // We do not want GQuery to fail, but in dev-move we log the error.\r
+ // We do not want GQuery to fail, but in dev-mode we log the error.\r
e2.printStackTrace();\r
}\r
return null;\r