public class ButtonGroup extends DivWidget
<b:ButtonGroup>
<b:Button>First Button</b:Button>
<b:Button>Second Button</b:Button>
<b:Button>Third Button</b:Button>
</b:ButtonGroup>
You can also use the buttons as checkboxes or radio buttons:
<b:ButtonGroup toggle="radio">
<b:Button text="1" />
<b:Button text="2" />
<b:Button text="3" />
<b:Button text="4" />
</b:ButtonGroup>
Button,
ButtonToolbarcom.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled| Constructor and Description |
|---|
ButtonGroup()
Creates an empty ButtonGroup.
|
ButtonGroup(Button... buttons)
Creates a ButtonGroup containing the provided Buttons.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(com.google.gwt.user.client.ui.IsWidget child) |
void |
add(com.google.gwt.user.client.ui.Widget widget)
Adds a new
Button to the group. |
boolean |
remove(com.google.gwt.user.client.ui.Widget w) |
void |
setToggle(String toggle)
Set/unset the data-toggle behavior.
|
void |
setToggle(ToggleType type)
Set/unset the data-toggle behavior.
|
void |
setVertical(boolean vertical)
Set vertical style
|
addStyle, getId, pullRight, removeStyle, setHideOn, setId, setPullRight, setShowOn, setStyleadd, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, removeadopt, adopt, disown, doAttachChildren, doDetachChildren, orphan, removeaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, setParent, sinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEventsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic ButtonGroup()
public ButtonGroup(Button... buttons)
buttons - the widgets to be added to the ButtonGrouppublic void add(com.google.gwt.user.client.ui.IsWidget child)
add in interface com.google.gwt.user.client.ui.HasWidgets.ForIsWidgetadd in interface com.google.gwt.user.client.ui.InsertPanel.ForIsWidgetadd in class com.google.gwt.user.client.ui.Panelpublic void add(com.google.gwt.user.client.ui.Widget widget)
Button to the group.add in interface com.google.gwt.user.client.ui.HasWidgetsadd in interface com.google.gwt.user.client.ui.InsertPaneladd in class com.google.gwt.user.client.ui.FlowPanelwidget - the Button to be added.public boolean remove(com.google.gwt.user.client.ui.Widget w)
remove in interface com.google.gwt.user.client.ui.HasWidgetsremove in class com.google.gwt.user.client.ui.ComplexPanelpublic void setToggle(ToggleType type)
type - public void setToggle(String toggle)
toggle - public void setVertical(boolean vertical)
vertical - true:Set , false:UnsetCopyright © 2016. All rights reserved.