com.github.gwtbootstrap.client.ui
Class Navbar
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Panel
com.google.gwt.user.client.ui.ComplexPanel
com.google.gwt.user.client.ui.FlowPanel
com.github.gwtbootstrap.client.ui.base.DivWidget
com.github.gwtbootstrap.client.ui.Navbar
- All Implemented Interfaces:
- HasStyle, IsResponsive, HasAttachHandlers, HasHandlers, EventListener, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IndexedPanel, IndexedPanel.ForIsWidget, InsertPanel, InsertPanel.ForIsWidget, IsWidget, Iterable<Widget>
- Direct Known Subclasses:
- ResponsiveNavbar
public class Navbar
- extends DivWidget
Navbar with optional text, links and forms.
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
.
UiBinder Usage:
<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.
- Since:
- 2.0.4.0
- Author:
- Dominik Mayer, Carlos Alexandro Becker
- See Also:
- Bootstrap documentation,
ResponsiveNavbar
Constructor Summary |
Navbar()
Creates an empty Navbar. |
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel |
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents |
Navbar
public Navbar()
- Creates an empty Navbar.
setId
public void setId(String id)
getId
public String getId()
getContainer
protected Container getContainer()
- Defines the default container implementation. You can override this in a
extended class if you want another implementation, like a
FluidContainer
.
setScrollspy
public void setScrollspy(boolean scrollspy)
- Defines whether the Navbar should contain a
Scrollspy
.
- Parameters:
scrollspy
- true
to include a Scrollspy. Default:
false
setSpyElement
public void setSpyElement(Element spyElement)
- Defines scrollspy target element.
- Parameters:
spyElement
- target element
onAttach
protected void onAttach()
- Overrides:
onAttach
in class Widget
setPosition
public void setPosition(NavbarPosition position)
- Fix the Navbar at the top or bottom of the screen.
For this to work properly, the Navbar must not be a child of a
Container
.
- Parameters:
position
- the position of the Navbar
add
public void add(Widget child)
-
- Specified by:
add
in interface HasWidgets
- Specified by:
add
in interface InsertPanel
- Overrides:
add
in class FlowPanel
addWidget
protected void addWidget(Widget widget)
- Adds a widget to the Navbar element, not the container.
- Parameters:
widget
- widget to add
getSpy
public Scrollspy getSpy()
Copyright © 2012 gwtbootstrap. All Rights Reserved.