public static class VMenuBar.CustomMenuItem extends com.google.gwt.user.client.ui.Widget implements com.google.gwt.user.client.ui.HasHTML, SubPartAware
Modifier and Type | Field and Description |
---|---|
protected boolean |
checkable |
protected boolean |
checked |
protected com.google.gwt.user.client.Command |
command |
protected String |
description |
protected ContentMode |
descriptionContentMode |
protected boolean |
enabled |
protected String |
html |
protected boolean |
isSeparator |
protected VMenuBar |
parentMenu |
protected boolean |
selected |
protected VMenuBar |
subMenu |
Constructor and Description |
---|
CustomMenuItem()
Default menu item
Widget constructor for GWT.create(). |
CustomMenuItem(String html,
com.google.gwt.user.client.Command cmd)
Deprecated.
use the default constructor and
setHTML(String)
and setCommand(Command) instead |
Modifier and Type | Method and Description |
---|---|
com.google.gwt.user.client.Command |
getCommand() |
String |
getHTML() |
String |
getId() |
VMenuBar |
getParentMenu() |
VMenuBar |
getSubMenu() |
com.google.gwt.user.client.Element |
getSubPartElement(String subPart)
Locates an element inside a component using the identifier provided in
subPart . |
String |
getSubPartName(com.google.gwt.user.client.Element subElement)
Provides an identifier that identifies the element within the component.
|
String |
getText() |
TooltipInfo |
getTooltip() |
boolean |
isCheckable() |
boolean |
isChecked() |
boolean |
isEnabled() |
boolean |
isSelectable()
Checks if the item can be selected.
|
boolean |
isSeparator() |
void |
onBrowserEvent(com.google.gwt.user.client.Event event) |
protected void |
onLoad() |
void |
setCheckable(boolean checkable) |
void |
setChecked(boolean checked) |
void |
setCommand(com.google.gwt.user.client.Command command) |
void |
setDescription(String description) |
void |
setDescriptionContentMode(ContentMode descriptionContentMode) |
void |
setEnabled(boolean enabled) |
void |
setHTML(String html) |
void |
setId(String id) |
void |
setParentMenu(VMenuBar parentMenu) |
void |
setSelected(boolean selected) |
void |
setSeparator(boolean separator) |
void |
setStyleName(String style) |
void |
setSubMenu(VMenuBar subMenu) |
void |
setText(String text) |
void |
updateFromUIDL(UIDL uidl,
ApplicationConnection client) |
void |
updateStyleNames() |
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, 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, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
protected String html
protected com.google.gwt.user.client.Command command
protected VMenuBar subMenu
protected VMenuBar parentMenu
protected boolean enabled
protected boolean isSeparator
protected boolean checkable
protected boolean checked
protected boolean selected
protected String description
protected ContentMode descriptionContentMode
public CustomMenuItem()
Widget
constructor for GWT.create().
Use setHTML(String)
and setCommand(Command)
after
constructing a menu item.@Deprecated public CustomMenuItem(String html, com.google.gwt.user.client.Command cmd)
setHTML(String)
and setCommand(Command)
insteadWidget
.html
- cmd
- public void onBrowserEvent(com.google.gwt.user.client.Event event)
onBrowserEvent
in interface com.google.gwt.user.client.EventListener
onBrowserEvent
in class com.google.gwt.user.client.ui.Widget
protected void onLoad()
onLoad
in class com.google.gwt.user.client.ui.Widget
public void setStyleName(String style)
setStyleName
in class com.google.gwt.user.client.ui.UIObject
public void setSelected(boolean selected)
public void setChecked(boolean checked)
public boolean isChecked()
public void setCheckable(boolean checkable)
public boolean isCheckable()
public void setSubMenu(VMenuBar subMenu)
public VMenuBar getSubMenu()
public void setParentMenu(VMenuBar parentMenu)
public void updateStyleNames()
public VMenuBar getParentMenu()
public void setCommand(com.google.gwt.user.client.Command command)
public com.google.gwt.user.client.Command getCommand()
public String getHTML()
getHTML
in interface com.google.gwt.user.client.ui.HasHTML
public void setHTML(String html)
setHTML
in interface com.google.gwt.user.client.ui.HasHTML
public String getText()
getText
in interface com.google.gwt.user.client.ui.HasText
public void setText(String text)
setText
in interface com.google.gwt.user.client.ui.HasText
public void setEnabled(boolean enabled)
public boolean isEnabled()
public void setSeparator(boolean separator)
public boolean isSeparator()
public void updateFromUIDL(UIDL uidl, ApplicationConnection client)
public TooltipInfo getTooltip()
public boolean isSelectable()
public com.google.gwt.user.client.Element getSubPartElement(String subPart)
SubPartAware
subPart
. The subPart
identifier is component specific and
may be any string of characters, numbers, space characters and brackets.getSubPartElement
in interface SubPartAware
subPart
- The identifier for the element inside the componentpublic String getSubPartName(com.google.gwt.user.client.Element subElement)
SubPartAware
subElement
is a part of the component and must never be null.
Note!
getSubPartElement(getSubPartName(element)) == element
is not
always true. A component can choose to provide a more generic
identifier for any given element if the results of all interactions with
subElement
are the same as interactions with the element
identified by the return value. For example a button can return an
identifier for the root element even though a DIV inside the button was
passed as subElement
because interactions with the DIV and the
root button element produce the same result.
getSubPartName
in interface SubPartAware
subElement
- The element the identifier string should uniquely identifysubElement
or null
if no identifier could be provided.public String getId()
public void setId(String id)
public void setDescription(String description)
public void setDescriptionContentMode(ContentMode descriptionContentMode)
Copyright © 2018 Vaadin Ltd. All rights reserved.