com.vaadin.client.ui.
Class VMenuBar.CustomMenuItem
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.vaadin.client.ui.VMenuBar.CustomMenuItem
-
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers
,com.google.gwt.event.shared.HasHandlers
,com.google.gwt.user.client.EventListener
,com.google.gwt.user.client.ui.HasHTML
,com.google.gwt.user.client.ui.HasText
,com.google.gwt.user.client.ui.HasVisibility
,com.google.gwt.user.client.ui.IsWidget
,SubPartAware
Enclosing class:
public static class VMenuBar.CustomMenuItem extends com.google.gwt.user.client.ui.Widget implements com.google.gwt.user.client.ui.HasHTML, SubPartAware
A class to hold information on menu items.
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor 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 andsetHTML(String)
andsetCommand(Command)
instead
-
Method Summary
All Methods Modifier and Type Method 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()
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
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, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
-
-
-
Field Detail
-
html
protected String html
-
command
protected com.google.gwt.user.client.Command command
-
subMenu
protected VMenuBar subMenu
-
parentMenu
protected VMenuBar parentMenu
-
enabled
protected boolean enabled
-
isSeparator
protected boolean isSeparator
-
checkable
protected boolean checkable
-
checked
protected boolean checked
-
selected
protected boolean selected
-
description
protected String description
-
descriptionContentMode
protected ContentMode descriptionContentMode
-
-
Constructor Detail
-
CustomMenuItem
public CustomMenuItem()
Default menu item
Widget
constructor for GWT.create(). UsesetHTML(String)
andsetCommand(Command)
after constructing a menu item.
-
CustomMenuItem
@Deprecated public CustomMenuItem(String html, com.google.gwt.user.client.Command cmd)
Deprecated.use the default constructor andsetHTML(String)
andsetCommand(Command)
insteadCreates a menu item
Widget
.Parameters:
html
-cmd
-
-
-
Method Detail
-
onBrowserEvent
public void onBrowserEvent(com.google.gwt.user.client.Event event)
Specified by:
onBrowserEvent
in interfacecom.google.gwt.user.client.EventListener
Overrides:
onBrowserEvent
in classcom.google.gwt.user.client.ui.Widget
-
onLoad
protected void onLoad()
Overrides:
onLoad
in classcom.google.gwt.user.client.ui.Widget
-
setStyleName
public void setStyleName(String style)
Overrides:
setStyleName
in classcom.google.gwt.user.client.ui.UIObject
-
setSelected
public void setSelected(boolean selected)
-
setChecked
public void setChecked(boolean checked)
-
isChecked
public boolean isChecked()
-
setCheckable
public void setCheckable(boolean checkable)
-
isCheckable
public boolean isCheckable()
-
setSubMenu
public void setSubMenu(VMenuBar subMenu)
-
getSubMenu
public VMenuBar getSubMenu()
-
setParentMenu
public void setParentMenu(VMenuBar parentMenu)
-
updateStyleNames
public void updateStyleNames()
-
getParentMenu
public VMenuBar getParentMenu()
-
setCommand
public void setCommand(com.google.gwt.user.client.Command command)
-
getCommand
public com.google.gwt.user.client.Command getCommand()
-
getHTML
public String getHTML()
Specified by:
getHTML
in interfacecom.google.gwt.user.client.ui.HasHTML
-
setHTML
public void setHTML(String html)
Specified by:
setHTML
in interfacecom.google.gwt.user.client.ui.HasHTML
-
getText
public String getText()
Specified by:
getText
in interfacecom.google.gwt.user.client.ui.HasText
-
setText
public void setText(String text)
Specified by:
setText
in interfacecom.google.gwt.user.client.ui.HasText
-
setEnabled
public void setEnabled(boolean enabled)
-
isEnabled
public boolean isEnabled()
-
setSeparator
public void setSeparator(boolean separator)
-
isSeparator
public boolean isSeparator()
-
updateFromUIDL
public void updateFromUIDL(UIDL uidl, ApplicationConnection client)
-
getTooltip
public TooltipInfo getTooltip()
-
isSelectable
public boolean isSelectable()
Checks if the item can be selected.
Returns:
true if it is possible to select this item, false otherwise
-
getSubPartElement
public com.google.gwt.user.client.Element getSubPartElement(String subPart)
Description copied from interface:
SubPartAware
Locates an element inside a component using the identifier provided in
subPart
. ThesubPart
identifier is component specific and may be any string of characters, numbers, space characters and brackets.Specified by:
getSubPartElement
in interfaceSubPartAware
Parameters:
subPart
- The identifier for the element inside the componentReturns:
The element identified by subPart or null if the element could not be found.
-
getSubPartName
public String getSubPartName(com.google.gwt.user.client.Element subElement)
Description copied from interface:
SubPartAware
Provides an identifier that identifies the element within the component. The
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 withsubElement
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 assubElement
because interactions with the DIV and the root button element produce the same result.Specified by:
getSubPartName
in interfaceSubPartAware
Parameters:
subElement
- The element the identifier string should uniquely identifyReturns:
An identifier that uniquely identifies
subElement
or null if no identifier could be provided.
-
getId
public String getId()
-
setId
public void setId(String id)
-
setDescription
public void setDescription(String description)
-
setDescriptionContentMode
public void setDescriptionContentMode(ContentMode descriptionContentMode)
-
-