Class ContextMenuCheckBoxItem
- All Implemented Interfaces:
IsEditor<LeafValueEditor<String>>, ClickHandler, ContextMenuHandler, HasAllDragAndDropHandlers, HasAllGestureHandlers, HasAllMouseHandlers, HasAllTouchHandlers, HasClickHandlers, HasDoubleClickHandlers, HasDragEndHandlers, HasDragEnterHandlers, HasDragHandlers, HasDragLeaveHandlers, HasDragOverHandlers, HasDragStartHandlers, HasDropHandlers, HasGestureChangeHandlers, HasGestureEndHandlers, HasGestureStartHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasTouchCancelHandlers, HasTouchEndHandlers, HasTouchMoveHandlers, HasTouchStartHandlers, MouseOutHandler, MouseOverHandler, HasAttachHandlers, EventHandler, HasHandlers, HasDirection, HasDirectionEstimator, EventListener, HasAutoHorizontalAlignment, HasDirectionalText, HasEnabled, HasHorizontalAlignment, HasText, HasVisibility, HasWordWrap, IsWidget, SourcesClickEvents, SourcesMouseEvents
Component of the context menu extension to GWT's user interface.
Implements context menu items with a check box to indicate whether the menu
item is active (checked) or not. The layout is controlled via CSS by adding
(or removing) the class name checked if menu item is active (or
not).
CSS Style Rules
Same as for ContextMenuItem plus
- .gwt-ContextMenuItem-checked
- if the context menu item is checked.
but cannot control a submenu.
- Author:
- Christoph Hauert
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabledNested classes/interfaces inherited from interface HasDirection
HasDirection.DirectionNested classes/interfaces inherited from interface HasHorizontalAlignment
HasHorizontalAlignment.AutoHorizontalAlignmentConstant, HasHorizontalAlignment.HorizontalAlignmentConstant -
Field Summary
FieldsFields inherited from class ContextMenuItem
clickHandler, cmd, contextMenuHandler, mouseOutHandler, mouseOverHandlerFields inherited from class Label
DEFAULT_DIRECTION_ESTIMATORFields inherited from class UIObject
DEBUG_ID_PREFIXFields inherited from interface HasAutoHorizontalAlignment
ALIGN_CONTENT_END, ALIGN_CONTENT_STARTFields inherited from interface HasHorizontalAlignment
ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_LOCALE_END, ALIGN_LOCALE_START, ALIGN_RIGHT -
Constructor Summary
ConstructorsConstructorDescriptionContextMenuCheckBoxItem(String text, boolean isChecked, Scheduler.ScheduledCommand cmd) Create new menu item with check box and the titletext.ContextMenuCheckBoxItem(String text, boolean isChecked, Scheduler.ScheduledCommand cmd, String key) Create new menu item with check box and the titletext.Create new menu item with check box and the titletext.ContextMenuCheckBoxItem(String text, Scheduler.ScheduledCommand cmd, String key) Create new menu item with check box and the titletext. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if menu item is active (checked).protected voidonLoad()voidsetChecked(boolean checked) Set state of check box in menu item tochecked.Methods inherited from class ContextMenuItem
action, close, closeNow, handlesKey, hasSubmenu, isEnabled, normalizeKey, onClick, onContextMenu, onMouseOut, onMouseOver, onUnload, open, setEnabled, setKeyMethods inherited from class Label
addClickHandler, addClickListener, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragHandler, addDragLeaveHandler, addDragOverHandler, addDragStartHandler, addDropHandler, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, asEditor, getDirection, getText, getTextDirection, removeClickListener, removeMouseListener, removeMouseWheelListener, setDirection, setText, setText, wrapMethods inherited from class LabelBase
getAutoHorizontalAlignment, getDirectionEstimator, getHorizontalAlignment, getWordWrap, setAutoHorizontalAlignment, setDirectionEstimator, setDirectionEstimator, setHorizontalAlignment, setWordWrap, updateHorizontalAlignmentMethods inherited from class Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, removeFromParent, setLayoutData, sinkEvents, unsinkEventsMethods inherited from class 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, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface HasHandlers
fireEvent
-
Field Details
-
isChecked
private boolean isCheckedtrueif context menu item is checked.
-
-
Constructor Details
-
ContextMenuCheckBoxItem
Create new menu item with check box and the titletext. Initially the menu item is not checked. Clicking the menu item executescmd.- Parameters:
text- title of menu itemcmd- command to execute when clicked
-
ContextMenuCheckBoxItem
Create new menu item with check box and the titletext. Initially the menu item is not checked. Clicking the menu item executescmd.- Parameters:
text- title of menu itemisChecked-truefor checked menu itemcmd- command to execute when clicked
-
ContextMenuCheckBoxItem
Create new menu item with check box and the titletext. Initially the menu item is not checked. Clicking the menu item executescmdand showskeyas the keyboard hint.- Parameters:
text- title of menu itemcmd- command to execute when clickedkey- keyboard key label shown in the trailing column
-
ContextMenuCheckBoxItem
public ContextMenuCheckBoxItem(String text, boolean isChecked, Scheduler.ScheduledCommand cmd, String key) Create new menu item with check box and the titletext. Initially the menu item is not checked. Clicking the menu item executescmdand showskeyas the keyboard hint.- Parameters:
text- title of menu itemisChecked-truefor checked menu itemcmd- command to execute when clickedkey- keyboard key label shown in the trailing column
-
-
Method Details
-
onLoad
protected void onLoad()- Overrides:
onLoadin classContextMenuItem
-
setChecked
public void setChecked(boolean checked) Set state of check box in menu item tochecked.- Parameters:
checked-trueto mark menu item as active (checked)
-
isChecked
public boolean isChecked()Check if menu item is active (checked).- Returns:
trueif active (checked)
-