Package eu.webtoolkit.jwt
Class WToolBar
java.lang.Object
eu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WWidget
eu.webtoolkit.jwt.WCompositeWidget
eu.webtoolkit.jwt.WToolBar
public class WToolBar extends WCompositeWidget
A toolbar.
By default, a toolbar is rendered as "compact" leaving no margin between buttons. By adding a separator or a split button, the toolbar also supports separation between buttons.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Constructor Summary
Constructors Constructor Description WToolBar()
Constructor.WToolBar(WContainerWidget parent)
Constructor. -
Method Summary
Modifier and Type Method Description void
addButton(WPushButton button)
Adds a button.void
addButton(WPushButton button, AlignmentFlag alignmentFlag)
Adds a button.void
addButton(WSplitButton button)
Adds a split button.void
addButton(WSplitButton button, AlignmentFlag alignmentFlag)
Adds a split button.void
addSeparator()
Adds a separator.void
addWidget(WWidget widget)
Adds a widget.void
addWidget(WWidget widget, AlignmentFlag alignmentFlag)
Adds a widget.int
getCount()
Returns the number of buttons.boolean
isCompact()
Returns whether the toolbar was rendered compact.void
removeWidget(WWidget widget)
void
setCompact(boolean compact)
Sets the toolbar to be rendered compact.void
setOrientation(Orientation orientation)
Set vertical or horizontal orientation.WWidget
widget(int index)
Returns a button.Methods inherited from class eu.webtoolkit.jwt.WCompositeWidget
addStyleClass, boxBorder, boxPadding, callJavaScriptMember, doJavaScript, enableAjax, find, findById, getAttributeValue, getBaseZIndex, getClearSides, getDecorationStyle, getFloatSide, getHeight, getId, getImplementation, getJavaScriptMember, getLineHeight, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getObjectName, getOffset, getPositionScheme, getScrollVisibilityMargin, getStyleClass, getTabIndex, getTakeImplementation, getToolTip, getVerticalAlignment, getVerticalAlignmentLength, getWidth, hasFocus, hasStyleClass, isCanReceiveFocus, isDisabled, isEnabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isScrollVisibilityEnabled, isScrollVisible, isSetFirstFocus, isThemeStyleEnabled, isVisible, load, propagateSetEnabled, propagateSetVisible, refresh, remove, removeStyleClass, render, resize, scrollVisibilityChanged, setAttributeValue, setCanReceiveFocus, setClearSides, setDecorationStyle, setDeferredToolTip, setDisabled, setFloatSide, setFocus, setHidden, setHiddenKeepsGeometry, setId, setImplementation, setInline, setJavaScriptMember, setLineHeight, setMargin, setMaximumSize, setMinimumSize, setObjectName, setOffsets, setPopup, setPositionScheme, setScrollVisibilityEnabled, setScrollVisibilityMargin, setSelectable, setStyleClass, setTabIndex, setThemeStyleEnabled, setToolTip, setVerticalAlignment
Methods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addJSignal, addStyleClass, animateHide, animateShow, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, isExposed, isLayoutSizeAware, isRendered, layoutSizeChanged, needsRerender, positionAt, positionAt, removeChild, removeStyleClass, render, resize, scheduleRender, scheduleRender, scheduleRender, setClearSides, setDeferredToolTip, setFocus, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr
Methods inherited from class eu.webtoolkit.jwt.WObject
addChild, setFormData
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
WToolBar
Constructor. -
WToolBar
public WToolBar()Constructor.
-
-
Method Details
-
setOrientation
Set vertical or horizontal orientation.Use bootstrap btn-group-vertical style for vertical orientation.
-
addButton
Adds a button. -
addButton
Adds a button. -
addButton
Adds a split button.When adding a split button, the toolbar automatically becomes non-compact, since otherwise the split button functionality cannot be distinguished from other buttons.
- See Also:
setCompact(boolean compact)
-
addButton
Adds a split button. -
addWidget
Adds a widget.The toolbar automatically becomes non-compact.
-
addWidget
Adds a widget. -
removeWidget
-
addSeparator
public void addSeparator()Adds a separator.The toolbar automatically becomes non-compact.
- See Also:
setCompact(boolean compact)
-
getCount
public int getCount()Returns the number of buttons.- See Also:
widget(int index)
-
widget
Returns a button.The returned widget is a
WPushButton
orWSplitButton
added byaddButton()
or a widget added byaddWidget()
. -
setCompact
public void setCompact(boolean compact)Sets the toolbar to be rendered compact.The default value is
true
, butsetCompact(true)
is called automatically when calling addButton(WSplitButton *) oraddSeparator()
. -
isCompact
public boolean isCompact()Returns whether the toolbar was rendered compact.- See Also:
setCompact(boolean compact)
-