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 -
Field Summary
Fields inherited from class eu.webtoolkit.jwt.WWidget
WT_GETEXTRAMS_JS -
Constructor Summary
ConstructorsConstructorDescriptionWToolBar()Constructor.WToolBar(WContainerWidget parentContainer) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal WPushButtonaddButton(WPushButton button) Adds a button.addButton(WPushButton button, AlignmentFlag alignmentFlag) Adds a button.final WSplitButtonaddButton(WSplitButton button) Adds a split button.addButton(WSplitButton button, AlignmentFlag alignmentFlag) Adds a split button.voidAdds a separator.final voidAdds a widget.voidaddWidget(WWidget widget, AlignmentFlag alignmentFlag) Adds a widget.intgetCount()Returns the number of widgets.booleanReturns whether the toolbar was rendered compact.removeWidget(WWidget widget) Removes a child widget.protected voidrender(EnumSet<RenderFlag> flags) Renders the widget.voidsetCompact(boolean compact) Sets the toolbar to be rendered compact.voidsetOrientation(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, 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, setVerticalAlignmentMethods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addJSignal, addStyleClass, animateHide, animateShow, applyThemeStyles, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, isExposed, isGlobalWidget, isLayoutSizeAware, isRendered, layoutSizeChanged, needsRerender, positionAt, positionAt, positionAt, positionAt, removeFromParent, removeStyleClass, render, resize, scheduleRender, scheduleRender, scheduleRender, scheduleThemeStyleApply, setClearSides, setDeferredToolTip, setFocus, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, trMethods inherited from class eu.webtoolkit.jwt.WObject
resendFormData, 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:WWidgetRemoves a child widget.- Overrides:
removeWidgetin 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
WPushButtonorWSplitButtonadded byaddButton()or a widget added byaddWidget().- See Also:
-
widget
Returns a button.The returned widget is a
WPushButtonorWSplitButtonadded 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:
-
render
Description copied from class:WWidgetRenders the widget.This function renders the widget (or an update for the widget), after this has been scheduled using
scheduleRender().The default implementation will render the widget by serializing changes to JavaScript and HTML. You may want to reimplement this widget if you have been postponing some of the layout / rendering implementation until the latest moment possible. In that case you should make sure you call the base implementation however.
- Overrides:
renderin classWCompositeWidget
-