public class MenuItem
extends com.google.gwt.user.client.ui.HTMLPanel
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
Constructor and Description |
---|
MenuItem(String inputValue,
String text)
Create an item and set its label.
|
Modifier and Type | Method and Description |
---|---|
String |
getText()
Returns the displayed text of the item.
|
String |
getValue()
Returns the value of the item.
|
boolean |
isEnabled()
If an item is set to be disabled, it will be grayed and won't dispatch an
ItemClickEvent when clicked. |
boolean |
setEnabled(boolean enabled)
Sets the state of the item.
|
add, add, add, addAndReplaceElement, addAndReplaceElement, addAndReplaceElement, addAndReplaceElement, addAndReplaceElement, addAndReplaceElement, createUniqueId, getElementById, wrap
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
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
public final boolean setEnabled(boolean enabled)
enabled
- if true responds to click events, otherwise it is grayed and will
not respond to click events.true
to indicate that the input state was applied,
false
meaning that the input state is the same as the
current state, therefore nothing was changed.isEnabled()
public final boolean isEnabled()
ItemClickEvent
when clicked. Besides, clicking on the item still
closes the menu.true
if the item is enabled, false
otherwise.public final String getValue()
public final String getText()
Copyright © 2016 com.github.ilyes4j. All rights reserved.