Module wicket.bootstrap.core
Class Navbar
java.lang.Object
org.apache.wicket.Component
org.apache.wicket.MarkupContainer
org.apache.wicket.markup.html.WebMarkupContainer
org.apache.wicket.markup.html.panel.Panel
de.agilecoders.wicket.core.markup.html.bootstrap.navbar.Navbar
- All Implemented Interfaces:
Invertible<Navbar>,Serializable,Iterable<Component>,IEventSink,IEventSource,IFeedbackContributor,IConverterLocator,IMetadataContext<Serializable,,Component> IQueueRegion,IHeaderContributor,IRequestableComponent,IHierarchical<Component>,IClusterable
A
Navbar is a navigation component that holds a list of elements,
mostly Links/MenuButtons/Dropdowns.
<div wicket:id="navbar" class="navbar"></div>- Author:
- miha
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumindicates the breakpoint for collapsing navigation bar.static enumindicates the position of a button inside the navigation bar.static enumindicates the position of the navigation bar itself -
Field Summary
Fields inherited from class org.apache.wicket.Component
ENABLE, FLAG_INITIALIZED, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING, RFLAG_CONTAINER_HAS_REMOVALS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal NavbaraddComponents(INavbarComponent... components) adds a component to the given position inside the navbarfinal NavbaraddComponents(NavbarText component) adds a component to the given position inside the navbarfinal NavbaraddComponents(List<INavbarComponent> components) adds a component to the given position inside the navbarstatic Stringprotected voidfluid(boolean fluid) marks the navigation to be rendered inside a fluid page layout.booleanisFluid()protected ImagenewBrandImage(String markupId) protected LabelnewBrandLabel(String markupId) protected ComponentnewBrandNameLink(String componentId) creates a new brand name button.protected TransparentWebMarkupContainernewCollapseButton(String componentId, String selector) creates a new transparent container which is used to append the "data-bs-target" attribute to the collapse button.protected TransparentWebMarkupContainernewCollapseContainer(String componentId) creates a new transparent inner container which is used to append some css classes.protected TransparentWebMarkupContainernewContainer(String componentId) creates a new transparent inner container which is used to append some css classes.final Stringprotected ComponentnewNavigation(String componentId, IModel<List<Component>> listModel) creates a new navigation listprotected LabelnewToggleNavigationLabel(String componentId) creates a new button labelprotected voidprotected voidSets background color of navbar.setBrandImage(ResourceReference imageResourceReference, IModel<String> imageAltAttrModel) sets an image in the brand buttonsetBrandName(IModel<String> brandName) sets the label of the brand name buttonsetCollapseBreakdown(Navbar.CollapseBreakpoint breakpoint) Sets the preferred responsive collapsing of navigation bar.setInverted(boolean invert) inverts the navbar backgorund colorsetPosition(Navbar.Position position) Sets the preferred position of the navigation bar on the screen.Methods inherited from class org.apache.wicket.markup.html.panel.Panel
getRegionMarkup, newMarkupSourcingStrategyMethods inherited from class org.apache.wicket.markup.html.WebMarkupContainer
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSessionMethods inherited from class org.apache.wicket.MarkupContainer
add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findChildComponent, findComponentToDequeue, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onComponentTagBody, onDetach, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, stream, streamChildren, toString, toString, visitChildren, visitChildrenMethods inherited from class org.apache.wicket.Component
add, addStateChange, beforeRender, canCallListener, canCallListenerAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, createConverter, debug, detach, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMarkupTag, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnModelChanged, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isInitialized, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderPart, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlForListener, urlForListener, visitParents, visitParents, warn, wrapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.wicket.IQueueRegion
dequeue, newDequeueContextMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Navbar
Construct.- Parameters:
componentId- The non-null id of this component
-
Navbar
Construct.- Parameters:
componentId- The non-null id of this componentmodel- The component's model
-
-
Method Details
-
componentId
- Returns:
- the component id that is used for all navbar components.
-
onInitialize
protected void onInitialize()- Overrides:
onInitializein classMarkupContainer
-
newContainer
creates a new transparent inner container which is used to append some css classes.- Parameters:
componentId- The non-null id of a new navigation component- Returns:
- a new inner container of the navigation bar.
-
isFluid
public boolean isFluid()- Returns:
- true, if the navigation is rendered for a fluid page layout.
-
fluid
marks the navigation to be rendered inside a fluid page layout.- Returns:
- the component's current instance.
-
onComponentTag
- Overrides:
onComponentTagin classComponent
-
newBrandNameLink
creates a new brand name button.- Parameters:
componentId- The non-null id of a new navigation component- Returns:
- a new brand name page link instance
-
newBrandLabel
- Parameters:
markupId- The component's markup id- Returns:
- a new brand name label.
-
newBrandImage
- Parameters:
markupId- The component's markup id- Returns:
- a new
Image
-
getHomePage
- Returns:
- the page class which is used for the brand name link. The application's homepage is used by default.
-
getPosition
- Returns:
- true, if the navigation is fixed on the top of the screen.
-
getBackgroundColor
- Returns:
- background color of navbar
-
getCollapseBreakpoint
- Returns:
- the breakpoint when navigation bar is collapsed
-
newExtraItemId
-
addComponents
adds a component to the given position inside the navbar- Parameters:
components- the components to add- Returns:
- this component instance for chaining
-
newCollapseButton
creates a new transparent container which is used to append the "data-bs-target" attribute to the collapse button.- Parameters:
componentId- The non-null id of collapse buttonselector- non-null jquery selector to collapse- Returns:
- a button container.
-
newCollapseContainer
creates a new transparent inner container which is used to append some css classes.- Parameters:
componentId- The non-null id of a new navigation component- Returns:
- a new inner container of the navigation bar.
-
setBrandName
sets the label of the brand name button- Parameters:
brandName- the brand name label- Returns:
- the component's current instance
-
setBrandImage
public Navbar setBrandImage(ResourceReference imageResourceReference, IModel<String> imageAltAttrModel) sets an image in the brand button- Parameters:
imageResourceReference- requiredimageAltAttrModel- optional, but should be provided- Returns:
- this instance for chaining
-
setInverted
inverts the navbar backgorund color- Specified by:
setInvertedin interfaceInvertible<Navbar>- Parameters:
invert- whether to invert the color or not- Returns:
- the component's current instance
-
setBackgroundColor
Sets background color of navbar.- Parameters:
color- the background color- Returns:
- the component's current instace
-
detachModel
protected void detachModel()- Overrides:
detachModelin classComponent
-