*/\r
package com.google.gwt.query.client.plugins;\r
\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
import com.google.gwt.dom.client.Element;\r
import com.google.gwt.query.client.Function;\r
import com.google.gwt.query.client.GQuery;\r
import com.google.gwt.query.client.plugins.widgets.DateBoxWidgetFactory;\r
import com.google.gwt.query.client.plugins.widgets.RichTextWidgetFactory;\r
import com.google.gwt.query.client.plugins.widgets.TabPanelWidgetFactory;\r
-import com.google.gwt.query.client.plugins.widgets.TabPanelWidgetFactory.TabPanelOptions;\r
import com.google.gwt.query.client.plugins.widgets.TextBoxWidgetFactory;\r
import com.google.gwt.query.client.plugins.widgets.WidgetFactory;\r
-import com.google.gwt.query.client.plugins.widgets.WidgetOptions;\r
+import com.google.gwt.query.client.plugins.widgets.TabPanelWidgetFactory.TabPanelOptions;\r
import com.google.gwt.user.client.ui.Button;\r
import com.google.gwt.user.client.ui.TabPanel;\r
import com.google.gwt.user.client.ui.TextBox;\r
import com.google.gwt.user.client.ui.Widget;\r
import com.google.gwt.user.datepicker.client.DateBox;\r
\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
/**\r
* Widgets plugin for Gwt Query. Be careful, this plugin is still experimental.\r
* The api can change in next releases.\r
super(gq);\r
}\r
\r
- /**\r
- * Create an return a {@link TabPanel} widget with the first selected\r
- * elements. Each div element will create a tab and the first h3 element\r
- * inside the div will be used as title. The <code>initFunctions</code> will\r
- * be called on the new {@link TabPanel} created by passing it in parameter.\r
- * \r
- */\r
- public TabPanel tabPanel(Function... initFunctions) {\r
- return tabPanel(new TabPanelOptions());\r
- }\r
-\r
- /**\r
- * Create an return a {@link TabPanel} widget with the first selected elements\r
- * by using a {@link TabPanelOptions}. The <code>initFunctions</code> will be\r
- * called on each new {@link Button} created by passing them in parameter.\r
- */\r
- public TabPanel tabPanel(TabPanelOptions o, Function... initFunctions) {\r
- return widget(new TabPanelWidgetFactory(o), initFunctions);\r
- }\r
\r
/**\r
* Create {@link TabPanel} widget for each selected elements. Each div element\r
* will create a tab and the first h3 element inside the div will be used as\r
* title\r
*/\r
- public Widgets tabPanels(Function... initFunctions) {\r
- return tabPanels(new TabPanelOptions(), initFunctions);\r
+ public Widgets tabPanel(Function... initFunctions) {\r
+ return tabPanel(new TabPanelOptions(), initFunctions);\r
}\r
\r
/**\r
* element inside a selected element will create a tab and the first h3\r
* element inside the div will be used as title\r
*/\r
- public Widgets tabPanels(TabPanelOptions o, Function... initFunctions) {\r
+ public Widgets tabPanel(TabPanelOptions o, Function... initFunctions) {\r
return widgets(new TabPanelWidgetFactory(o), initFunctions);\r
}\r
\r
- /**\r
- * Create an return a {@link Button} widget with the first element of the\r
- * query.The <code>initFunctions</code> will be called on the new\r
- * {@link Button} created by passing it in parameter.\r
- * \r
- */\r
- public Button button(Function... initFunctions) {\r
- return widget(new ButtonWidgetFactory(), initFunctions);\r
- }\r
\r
/**\r
* Create a {@link Button} widget for each selected element. The\r
* created by passing them in parameter.\r
* \r
*/\r
- public Widgets buttons(Function... initFunctions) {\r
+ public Widgets button(Function... initFunctions) {\r
return widgets(new ButtonWidgetFactory(), initFunctions);\r
}\r
\r
public Widgets richtext(Function... initFunctions) {\r
return widgets(new RichTextWidgetFactory(), initFunctions);\r
}\r
-\r
-\r
- /**\r
- * Create an return a {@link TextBox} widget with the first element of the\r
- * query.The <code>initFunctions</code> will be called on the new\r
- * {@link TextBox} created by passing it in parameter.\r
- * \r
- * A {@link TextBox} is created if the element is a <i>input</i> with type\r
- * text, a <i>div</i> or a<i>span</i> element.\r
- */\r
- public TextBox textBox(Function... initFunctions) {\r
- return widget(new TextBoxWidgetFactory(), initFunctions);\r
- }\r
-\r
+ \r
/**\r
* Create a {@link TextBox} widget for each selected element. The\r
* <code>initFunctions</code> will be called on each new {@link TextBox}\r
* A {@link TextBox} is created if the element is a <i>input</i> with type\r
* text, a <i>div</i> or a<i>span</i> element.\r
*/\r
- public Widgets textBoxes(Function... initFunctions) {\r
+ public Widgets textBox(Function... initFunctions) {\r
return widgets(new TextBoxWidgetFactory(), initFunctions);\r
}\r
\r
/**\r
* Create and return a widget using the given factory and the given options\r
*/\r
- public <W extends Widget> W widget(WidgetFactory<W> factory,\r
+ protected <W extends Widget> W widget(WidgetFactory<W> factory,\r
Function... initFunctions) {\r
\r
return widget(get(0), factory, initFunctions);\r
/**\r
* Create and return a widget using the given factory and the given options\r
*/\r
- protected <W extends Widget, O extends WidgetOptions> W widget(Element e,\r
+ protected <W extends Widget> W widget(Element e,\r
WidgetFactory<W> factory, Function... initFunctions) {\r
\r
W widget = factory.create(e);\r