Class WNavigationBar
Note: WNavigationBar is currently only styled in the Bootstrap themes.
Note: When using WBootstrap5Theme, no color schemes are applied by default.
You will have to add a "bg-" style class, and "navbar-light" or
"navbar-dark" yourself. See the Bootstrap documentation
on navbar color schemes for more info.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WTemplate
WTemplate.Function, WTemplate.FunctionsNested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData -
Field Summary
Fields inherited from class eu.webtoolkit.jwt.WInteractWidget
dragTouchEndSlot_, dragTouchSlot_, noDefault -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddFormField(WWidget widget) Adds a form field to the navigation bar.voidaddFormField(WWidget widget, AlignmentFlag alignment) Adds a form field to the navigation bar.final WMenuAdds a menu to the navigation bar.addMenu(WMenu menu, AlignmentFlag alignment) Adds a menu to the navigation bar.final voidAdds a search widget to the navigation bar.voidaddSearch(WLineEdit field, AlignmentFlag alignment) Adds a search widget to the navigation bar.final voidAdds a widget to the navigation bar.voidaddWidget(WWidget widget, AlignmentFlag alignment) Adds a widget to the navigation bar.protected WInteractWidgetprotected WInteractWidgetprotected voidrender(EnumSet<RenderFlag> flags) Renders the widget.voidsetResponsive(boolean responsive) Sets whether the navigation bar will respond to screen size.final voidsetTitle(CharSequence title) Sets a title.voidsetTitle(CharSequence title, WLink link) Sets a title.Methods inherited from class eu.webtoolkit.jwt.WTemplate
addFunction, applyArguments, bindEmpty, bindInt, bindString, bindString, bindWidget, clear, conditionValue, enableAjax, format, format, format, format, getConditionsSet, getErrorText, getTemplateText, getWidgetIdMode, getWidgets, handleUnresolvedVariable, hasInternalPathEncoding, isEncodeTemplateText, iterateChildren, refresh, remove, removeWidget, removeWidget, renderTemplate, renderTemplateText, reset, resolveFunction, resolveString, resolveStringValue, resolveWidget, setCondition, setEncodeTemplateText, setInternalPathEncoding, setTemplateText, setTemplateText, setWidgetIdMode, varNameMethods inherited from class eu.webtoolkit.jwt.WInteractWidget
clicked, doubleClicked, enterPressed, escapePressed, gestureChanged, gestureEnded, gestureStarted, getMouseOverDelay, isEnabled, keyPressed, keyWentDown, keyWentUp, load, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, propagateSetEnabled, setDraggable, setDraggable, setDraggable, setDraggable, setMouseOverDelay, setPopup, touchEnded, touchMoved, touchStarted, unsetDraggableMethods inherited from class eu.webtoolkit.jwt.WWebWidget
addStyleClass, beingDeleted, blurred, callJavaScriptMember, childrenChanged, createDomElement, doJavaScript, escapeText, escapeText, escapeText, escapeText, find, findById, focussed, getAttributeValue, getBaseZIndex, getChildren, getClearSides, getDecorationStyle, getDomChanges, getFloatSide, getHeight, getHtmlTagName, getId, getJavaScriptMember, getLineHeight, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getOffset, getPositionScheme, getScrollVisibilityMargin, getStyleClass, getTabIndex, getToolTip, getVerticalAlignment, getVerticalAlignmentLength, getWidth, hasFocus, hasStyleClass, hideToolTip, isCanReceiveFocus, isDisabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isRendered, isScrollVisibilityEnabled, isScrollVisible, isSetFirstFocus, isThemeStyleEnabled, isVisible, jsStringLiteral, jsStringLiteral, manageWidget, parentResized, parentResized, propagateSetVisible, removeScript, removeStyleClass, resize, scrollVisibilityChanged, setAttributeValue, setBaseZIndex, setCanReceiveFocus, setClearSides, setDecorationStyle, setDeferredToolTip, setDisabled, setFlexBox, setFloatSide, setFocus, setHidden, setHiddenKeepsGeometry, setHtmlTagName, setId, setInline, setJavaScriptMember, setLineHeight, setLoadLaterWhenInvisible, setMargin, setMaximumSize, setMinimumSize, setObjectName, setOffsets, setParentWidget, setPositionScheme, setScrollVisibilityEnabled, setScrollVisibilityMargin, setSelectable, setStyleClass, setTabIndex, setThemeStyleEnabled, setToolTip, setVerticalAlignment, showToolTip, showToolTipOnHover, unescapeText, updateSignalConnection, voidEventSignal, widgetAdded, widgetRemovedMethods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addJSignal, addStyleClass, animateHide, animateShow, applyThemeStyles, boxBorder, boxPadding, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, isExposed, isGlobalWidget, isLayoutSizeAware, 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
getObjectName, setFormData
-
Constructor Details
-
WNavigationBar
Constructor. -
WNavigationBar
public WNavigationBar()Constructor.
-
-
Method Details
-
setTitle
Sets a title.The title may optionally link to a 'homepage'.
-
setTitle
Sets a title. -
setResponsive
public void setResponsive(boolean responsive) Sets whether the navigation bar will respond to screen size.For screens that are less wide, the navigation bar can be rendered different (more compact and allowing for vertical menu layouts).
Note: When using
WBootstrap5Themethe navigation bar is responsive by default. Setting this to false has no effect. You can change the collapsing behavior by setting one of the ".navbar-expand-" style classes, see the Bootstrap documentation on navbars for more info. -
addMenu
Adds a menu to the navigation bar.Typically, a navigation bar will contain at least one menu which implements the top-level navigation options allowed by the navigation bar.
The menu may be aligned to the left or to the right of the navigation bar.
Note:
WBootstrap5Themeignores alignment. Use classes like "me-auto" and "ms-auto" for alignment instead. -
addMenu
Adds a menu to the navigation bar. -
addFormField
Adds a form field to the navigation bar.In some cases, one may want to add a few form fields to the navigation bar (e.g. for a compact login option).
Note:
WBootstrap5Themeignores alignment. Use classes like "me-auto" and "ms-auto" for alignment instead. -
addFormField
Adds a form field to the navigation bar. -
addSearch
Adds a search widget to the navigation bar.This is not so different from
addFormField(), except that the form field may be styled differently to indicate a search function.Note:
WBootstrap5Themeignores alignment. Use classes like "me-auto" and "ms-auto" for alignment instead. -
addSearch
Adds a search widget to the navigation bar. -
addWidget
Adds a widget to the navigation bar.Any other widget may be added to the navigation bar, although they may require special CSS style to blend well with the navigation bar style.
Note:
WBootstrap5Themeignores alignment. Use classes like "me-auto" and "ms-auto" for alignment instead. -
addWidget
Adds a widget to the navigation bar. -
getCreateCollapseButton
-
getCreateExpandButton
-
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 classWInteractWidget
-