com.sksamuel.jqm4gwt.button.JQMButtonPanel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jqm4gwt-standalone Show documentation
Show all versions of jqm4gwt-standalone Show documentation
jqm4gwt bundled with all of its dependencies
The newest version!
package com.sksamuel.jqm4gwt.button;
import com.google.gwt.uibinder.client.UiChild;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Widget;
import com.sksamuel.jqm4gwt.html.CustomFlowPanel;
public class JQMButtonPanel extends JQMButton {
private CustomFlowPanel stage;
private FlowPanel flow;
public JQMButtonPanel() {
super("");
}
@UiChild(tagname = "widget")
public void add(Widget w) {
if (w == null) return;
if (flow == null) {
stage = new CustomFlowPanel(getElement());
flow = new FlowPanel();
stage.add(flow);
}
flow.add(w);
}
public void remove(Widget w) {
if (flow != null && w != null) flow.remove(w);
}
public int getWidgetCount() {
return flow != null ? flow.getWidgetCount() : 0;
}
public Widget[] getWidgets() {
Widget[] widgets = new Widget[flow != null ? flow.getWidgetCount() : 0];
if (flow != null) {
for (int k = 0; k < flow.getWidgetCount(); k++) {
widgets[k] = flow.getWidget(k);
}
}
return widgets;
}
}