public abstract class MenuItem<O extends OutputManager<?>> extends AbstractWidget<O> implements WidgetWithConfig<MenuItemConfig>, MenuElement<O>
MenuItem client abstract implementation class.| Modifier and Type | Field and Description |
|---|---|
protected MenuItemConfig |
config
Frame attribute container.
|
private MnemonicInfo |
label
Label with mnemonic info
|
insets, listeners, location, LOG, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
MenuItem(WidgetId id,
MenuItemConfig cfg)
Special constructor used to restore component using given configuration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterConfigUpdate(MenuItemConfig beforeUpdate)
The method is called after the configuration associated with
the implementor changes.
|
MenuItemConfig |
config()
Provide access to the attributes stored in the widget.
|
protected MnemonicInfo |
createLabelInfo()
Creates new MnemonicInfo instance.
|
boolean |
forceCursorOnFocus()
Check if widget needs in cursor to be on when having the input focus.
|
MnemonicInfo |
getPreparedLabel()
Get MENU-ITEM prepared label.
|
java.lang.String |
getPreparedTitle()
Get MENU-ITEM prepared label.
|
void |
initialize(WidgetId id,
MenuItemConfig cfg)
Replacement API for the logic which should exist in the widget's c'tor, but the logic
can't be executed as it depends on the widget being registered into the official registry.
|
boolean |
isEnabled()
Check if this menu-item is enabled.
|
boolean |
isInitDisabled()
Check if menu-item was defined in menu definition class as disabled initially.
|
boolean |
isNormal()
Check sub-type attribute if it is NORMAL or not (RULE or SKIP)
|
boolean |
isRule()
Check sub-type attribute if it is RULE or not.
|
boolean |
isSkip()
Check sub-type attribute if it is SKIP or not.
|
void |
processKeyEvent(KeyInput event)
Process key event.
|
protected void |
selectMenuItem()
Process an event which trigger selection of this menu-item, depending if the item is a
toggle-box or not.
|
void |
setTitle(java.lang.String title)
Set item title and actualize mnemonic info.
|
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, copyColors, copyState, createMouseHoverAction, deactivateDirectManipulation, debug, destroy, dimension, disable, disableTooltip, displayPhysicalLocation, draw, drawCaret, enable, enableTooltip, enclosingFrame, findMouseSource, focusTraversable, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hasTooltip, height, hidden, hide, highlighted, ignoreAction, initialHeight, initialWidth, insets, isCurrent, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, minimumSize, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, oleDoDrop, oleDrag, oleDragging, oleStartDragging, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectAncestorChange, reflectLocationChanged, reflectSizeChanged, refresh, registerWidgetListener, repaint, repaint, repaint, requestFocus, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalDimensionInt, setPhysicalLocation, setSensitiveForUIB, setState, setVisible, setWindow, show, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, triggerLocationChanged, unrealize, unregisterWidgetListener, updateSizeWorker, updateSystemParent, widgetRealized, widgetStateChanged, width, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetParentMenu, getParentMenuContainer, getParentSubMenu, getParentSubMenuBody, getRootSubMenuacceptsEscAsAnyKey, acceptTrigger, addFocusListener, addKeyListener, ancestor, ancestorId, bounds, canMovetoTop, clearWidget, completeTrigger, defaultMousePtr, destroy, dimension, displayPhysicalLocation, draw, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, focusTraversable, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getIdForTrigger, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getSelectedText, getState, getTriggerWidget, getTriggerWidget, getVisiblePart, getZOrderClass, hasFocus, hasFocus, hasTooltip, height, hidden, hide, highlighted, ignoreEnable, initialHeight, initialWidth, insets, isCurrent, isCurrent, isDirectManipulable, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDisplayed, isDroppable, isFocusable, isHeader, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, minimumSize, moveToBottom, moveToTop, name, navigable, oleDrag, parent, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, refreshWidget, registerWidgetListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setVisible, setWindow, show, startTrigger, supportsCustomMousePointer, systemFocusGrabbed, topLevelWindow, unrealize, unregisterWidgetListener, validateDisplayValue, widgetStateChanged, width, windowprotected MenuItemConfig config
private MnemonicInfo label
public MenuItem(WidgetId id, MenuItemConfig cfg)
id - The widget's ID.cfg - Configuration data.public void initialize(WidgetId id, MenuItemConfig cfg)
This API is called after the widget is created and added to the registry.
initialize in interface WidgetWithConfig<MenuItemConfig>id - The widget's ID.cfg - The config used to initialize this widget.public MenuItemConfig config()
config in interface Widget<O extends OutputManager<?>>config in interface ConfigOwner<MenuItemConfig>config in class AbstractWidget<O extends OutputManager<?>>public void afterConfigUpdate(MenuItemConfig beforeUpdate)
afterConfigUpdate in interface ConfigOwner<MenuItemConfig>beforeUpdate - Config reference capturing the config state before
the owner's config was modified.public boolean forceCursorOnFocus()
true so it needs to be overwritten if other return value
is required for particular widget implementation class.forceCursorOnFocus in interface Widget<O extends OutputManager<?>>forceCursorOnFocus in class AbstractWidget<O extends OutputManager<?>>true as the default value.public MnemonicInfo getPreparedLabel()
getPreparedLabel in interface MenuElement<O extends OutputManager<?>>public java.lang.String getPreparedTitle()
getPreparedTitle in interface MenuElement<O extends OutputManager<?>>public void setTitle(java.lang.String title)
title - New item title.public boolean isNormal()
true if NORMAL false otherwise.public boolean isRule()
true if RULE false otherwise.public boolean isSkip()
true if SKIP false otherwise.public boolean isInitDisabled()
true if menu-item was defined as disabled.public boolean isEnabled()
isEnabled in interface Widget<O extends OutputManager<?>>isEnabled in class AbstractWidget<O extends OutputManager<?>>true if widget is enabled.public void processKeyEvent(KeyInput event)
processKeyEvent in interface Widget<O extends OutputManager<?>>processKeyEvent in class AbstractWidget<O extends OutputManager<?>>event - Key event to process.protected MnemonicInfo createLabelInfo()
protected void selectMenuItem()