public class Navbar extends DivWidget
The Navbar can be fixed on the top or bottom of the site where it will stay
when the user scrolls the page. For proper rendering, a fixed Navbar cannot
be part of any container! It has to be attached directly to the
RootPanel.
<g:FlowPanel>
<b:Navbar>
<b:Brand>Bootstrap</b:Brand>
<b:Nav>
<b:NavLink>Link 1</b:NavLink>
<b:NavLink>Link 2</b:NavLink>
</b:Nav>
<b:NavForm size="1" />
<b:Nav alignment="RIGHT">
<b:NavLink>Link 3</b:NavLink>
</b:Nav>
</b:Navbar>
<b:Container>
[...]
</b:Container>
</g:FlowPanel>
NOTE: We assume that most people will use the ResponsiveNavbar, so, we automatically
add a padding-top: 50px in body.If you don't want this, you have to put
a padding-top: 0px; manually in your document body tag.ResponsiveNavbarcom.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled| Constructor and Description |
|---|
Navbar()
Creates an empty Navbar.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(com.google.gwt.user.client.ui.Widget child) |
protected void |
addWidget(com.google.gwt.user.client.ui.Widget widget)
Adds a widget to the Navbar element, not the container.
|
protected Container |
getContainer()
Defines the default container implementation.
|
String |
getId()
Get ID
|
Scrollspy |
getSpy() |
protected void |
onAttach() |
void |
setId(String id)
Set ID
|
void |
setInverse(boolean inverse)
Set inverse style.
|
void |
setPosition(NavbarPosition position)
Fix the Navbar at the top or bottom of the screen.
|
void |
setScrollspy(boolean scrollspy)
Defines whether the Navbar should contain a
Scrollspy. |
void |
setSpyElement(com.google.gwt.dom.client.Element spyElement)
Defines scrollspy target element.
|
addStyle, pullRight, removeStyle, setHideOn, setPullRight, setShowOn, setStyleadd, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, removeadd, adopt, adopt, disown, doAttachChildren, doDetachChildren, orphan, removeaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, setParent, sinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEventsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitprotected Container getContainer()
FluidContainer.public void setScrollspy(boolean scrollspy)
Scrollspy.scrollspy - true to include a Scrollspy. Default:
falsepublic void setSpyElement(com.google.gwt.dom.client.Element spyElement)
spyElement - target elementprotected void onAttach()
onAttach in class com.google.gwt.user.client.ui.Widgetpublic void setPosition(NavbarPosition position)
Container.position - the position of the Navbarpublic void add(com.google.gwt.user.client.ui.Widget child)
add in interface com.google.gwt.user.client.ui.HasWidgetsadd in interface com.google.gwt.user.client.ui.InsertPaneladd in class com.google.gwt.user.client.ui.FlowPanelprotected void addWidget(com.google.gwt.user.client.ui.Widget widget)
widget - widget to addpublic Scrollspy getSpy()
public void setInverse(boolean inverse)
inverse - true:set false:unsetCopyright © 2016. All rights reserved.