com.github.gwtbootstrap.client.ui.base
Class DropdownBase
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.github.gwtbootstrap.client.ui.base.ComplexWidget
com.github.gwtbootstrap.client.ui.base.DropdownBase
- All Implemented Interfaces:
- HasStyle, IsResponsive, HasChangeHandlers, HasClickHandlers, HasAttachHandlers, HasHandlers, EventListener, HasText, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IndexedPanel, IndexedPanel.ForIsWidget, IsWidget, Iterable<Widget>
- Direct Known Subclasses:
- Dropdown, DropdownButton, SplitDropdownButton
public abstract class DropdownBase
- extends ComplexWidget
- implements HasChangeHandlers, HasClickHandlers, HasWidgets, HasText
Base class for dropdown widgets.
- Since:
- 2.0.4.0
- Author:
- Carlos A Becker, Dominik Mayer
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, onAttach, onBrowserEvent, onDetach, 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 |
DropdownBase
public DropdownBase(String type)
- Creates a new widget of the given type.
- Parameters:
type
- the HTML tag to be used for the widget
setText
public void setText(String text)
- Sets the text of the dropdown trigger.
- Specified by:
setText
in interface HasText
- Parameters:
text
-
getText
public String getText()
- Specified by:
getText
in interface HasText
- Returns:
- the text of the dropdown trigger.
createTrigger
protected abstract IconAnchor createTrigger()
- Implement this method to create the trigger appropriate for your widget.
It has to be an
IconAnchor
or a subtype.
- Returns:
- the created trigger
setDropup
public void setDropup(boolean dropup)
- Set dropup style.
- Parameters:
dropup
- true:Set Dropup false:Un-set Dropup
onLoad
protected void onLoad()
-
- Overrides:
onLoad
in class Widget
add
public void add(Widget widget)
- Adds a widget to the dropdown menu.
- Specified by:
add
in interface HasWidgets
- Overrides:
add
in class ComplexWidget
- Parameters:
widget
- the widget that will be added to the menu- See Also:
addWidget(Widget)
addChangeHandler
public HandlerRegistration addChangeHandler(ChangeHandler handler)
- Specified by:
addChangeHandler
in interface HasChangeHandlers
addWidget
protected void addWidget(Widget widget)
- Adds a widget to the the dropdown widget, not to the dropdown
menu.
Use
add(Widget)
if you want to add a widget to the dropdown
menu.
- Parameters:
widget
- the widget to be added.
setRightDropdown
public void setRightDropdown(boolean rightDropdown)
- Pull the dropdown menu to right
- Parameters:
rightDropdown
- true
pull to right, otherwise to left. Default is
false
getLastSelectedNavLink
public NavLink getLastSelectedNavLink()
- Method to get the
NavLink
that has been clicked most recently.
- Returns:
- Last clicked NavLink or
null
if none have been
clicked.
clear
public void clear()
- Specified by:
clear
in interface HasWidgets
- Overrides:
clear
in class Panel
addClickHandler
public HandlerRegistration addClickHandler(ClickHandler handler)
- Specified by:
addClickHandler
in interface HasClickHandlers
Copyright © 2012 gwtbootstrap. All Rights Reserved.