public abstract class DropdownBase extends ComplexWidget implements HasChangeHandlers, HasClickHandlers, HasWidgets, HasText, HasIcon
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
HasWidgets.ForIsWidget
IndexedPanel.ForIsWidget
Modifier and Type | Field and Description |
---|---|
protected IconAnchor |
trigger |
DEBUG_ID_PREFIX
Constructor and Description |
---|
DropdownBase(String type)
Creates a new widget of the given type.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Widget widget)
Adds a widget to the dropdown menu.
|
HandlerRegistration |
addChangeHandler(ChangeHandler handler) |
HandlerRegistration |
addClickHandler(ClickHandler handler) |
void |
addCustomTrigger(Widget w)
Add widget to trigger anchodr
|
protected void |
addWidget(Widget widget)
Adds a widget to the the dropdown widget, not to the dropdown
menu.
|
void |
clear() |
protected abstract IconAnchor |
createTrigger()
Implement this method to create the trigger appropriate for your widget.
|
NavLink |
getLastSelectedNavLink()
Method to get the
NavLink that has been clicked most recently. |
UnorderedList |
getMenuWiget()
Get menu unordered list widget
|
String |
getText() |
IconAnchor |
getTriggerWidget()
Get trigger wiget
|
boolean |
isDropup()
Is widget dropup?
|
protected void |
onLoad() |
void |
setDropup(boolean dropup)
Set dropup style.
|
void |
setRightDropdown(boolean rightDropdown)
Pull the dropdown menu to right
|
void |
setText(String text)
Sets the text of the dropdown trigger.
|
addStyle, insert, removeStyle, setHideOn, setShowOn, setStyle
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
add, adopt, adopt, disown, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onUnload, removeFromParent, setLayoutData, sinkEvents
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
fireEvent
iterator, remove
setBaseIcon, setCustomIconStyle, setIcon, setIconPosition, setIconSize
protected IconAnchor trigger
public DropdownBase(String type)
type
- the HTML tag to be used for the widgetpublic IconAnchor getTriggerWidget()
public UnorderedList getMenuWiget()
protected abstract IconAnchor createTrigger()
IconAnchor
or a subtype.public void setDropup(boolean dropup)
dropup
- true:Set Dropup false:Un-set Dropuppublic boolean isDropup()
public void add(Widget widget)
add
in interface HasWidgets
add
in class ComplexWidget
widget
- the widget that will be added to the menuaddWidget(Widget)
public HandlerRegistration addChangeHandler(ChangeHandler handler)
addChangeHandler
in interface HasChangeHandlers
protected void addWidget(Widget widget)
Use add(Widget)
if you want to add a widget to the dropdown
menu.
widget
- the widget to be added.public void setRightDropdown(boolean rightDropdown)
rightDropdown
- true
pull to right, otherwise to left. Default is
false
public NavLink getLastSelectedNavLink()
NavLink
that has been clicked most recently.null
if none have been
clicked.public void clear()
clear
in interface HasWidgets
clear
in class Panel
public HandlerRegistration addClickHandler(ClickHandler handler)
addClickHandler
in interface HasClickHandlers
@UiChild(tagname="customTrigger", limit=1) public void addCustomTrigger(Widget w)
w
- added widgetCopyright © 2012-2014 gwtbootstrap. All Rights Reserved.