Class WToolBar
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
ConstructorsConstructorDescriptionWToolBar()
Constructor.WToolBar
(WContainerWidget parentContainer) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal WPushButton
addButton
(WPushButton button) Adds a button.addButton
(WPushButton button, AlignmentFlag alignmentFlag) Adds a button.final WSplitButton
addButton
(WSplitButton button) Adds a split button.addButton
(WSplitButton button, AlignmentFlag alignmentFlag) Adds a split button.void
Adds a separator.final void
Adds a widget.void
addWidget
(WWidget widget, AlignmentFlag alignmentFlag) Adds a widget.int
getCount()
Returns the number of widgets.boolean
Returns whether the toolbar was rendered compact.removeWidget
(WWidget widget) Removes a child widget.void
setCompact
(boolean compact) Sets the toolbar to be rendered compact.void
setOrientation
(Orientation orientation) Set vertical or horizontal orientation.widget
(int index) Returns a button.Methods inherited from class eu.webtoolkit.jwt.WCompositeWidget
addStyleClass, boxBorder, boxPadding, callJavaScriptMember, doJavaScript, enableAjax, find, findById, getAttributeValue, getBaseZIndex, getChildren, 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, setParentWidget, 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, isGlobalWidget, isLayoutSizeAware, isRendered, layoutSizeChanged, needsRerender, positionAt, positionAt, removeFromParent, 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
setFormData
-
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:
-
addButton
Adds a split button. -
addWidget
Adds a widget.The toolbar automatically becomes non-compact.
-
addWidget
Adds a widget. -
removeWidget
Description copied from class:WWidget
Removes a child widget.- Overrides:
removeWidget
in classWCompositeWidget
-
addSeparator
public void addSeparator()Adds a separator.The toolbar automatically becomes non-compact.
- See Also:
-
getCount
public int getCount()Returns the number of widgets.The counted widgets are either a
WPushButton
orWSplitButton
added byaddButton()
or a widget added byaddWidget()
.- See Also:
-
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:
-