Package org.evoludo.ui
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.DebugIdImplEnabled
Nested classes/interfaces inherited from interface HasDirection
HasDirection.Direction
Nested classes/interfaces inherited from interface HasHorizontalAlignment
HasHorizontalAlignment.AutoHorizontalAlignmentConstant, HasHorizontalAlignment.HorizontalAlignmentConstant
-
Field Summary
FieldsFields inherited from class ContextMenuItem
cmd
Fields inherited from class Label
DEFAULT_DIRECTION_ESTIMATOR
Fields inherited from class UIObject
DEBUG_ID_PREFIX
Fields inherited from interface HasAutoHorizontalAlignment
ALIGN_CONTENT_END, ALIGN_CONTENT_START
Fields 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 checked, Scheduler.ScheduledCommand cmd) Create new menu item with check box and the titletext
.Create new menu item with check box and the titletext
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Check if menu item is active (checked).void
setChecked
(boolean checked) Set state of check box in menu item tochecked
.Methods inherited from class ContextMenuItem
action, close, closeNow, hasSubmenu, isEnabled, onClick, onContextMenu, onMouseOut, onMouseOver, open, setEnabled
Methods 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, wrap
Methods inherited from class LabelBase
getAutoHorizontalAlignment, getDirectionEstimator, getHorizontalAlignment, getWordWrap, setAutoHorizontalAlignment, setDirectionEstimator, setDirectionEstimator, setHorizontalAlignment, setWordWrap, updateHorizontalAlignment
Methods inherited from class Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
Methods 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, toString
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface HasHandlers
fireEvent
-
Field Details
-
isChecked
private boolean isCheckedtrue
if context menu item is checked.
-
-
Constructor Details
-
ContextMenuCheckBoxItem
Create new menu item with check box and the titletext
. Initially the menu item is not active (unchecked). 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 active ifchecked==true
. Clicking the menu item executescmd
.- Parameters:
text
- title of menu itemchecked
-true
if initial state is active (checked)cmd
- command to execute when clicked
-
-
Method Details
-
setChecked
public void setChecked(boolean checked) Set state of check box in menu item tochecked
.- Parameters:
checked
-true
to mark menu item as active (checked)
-
isChecked
public boolean isChecked()Check if menu item is active (checked).- Returns:
true
if active (checked)
-