public class GMenuItem extends GComponent implements ActionListener
GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.Operation
NAME_ATTRIBUTE
Constructor and Description |
---|
GMenuItem(JMenuItem menu)
Constructor.
|
GMenuItem(String name)
Constructor.
|
GMenuItem(String widgetId,
JMenuItem menu)
Constructor.
|
GMenuItem(String widgetId,
String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e) |
Component |
getComponent()
Returns the low level Swing Component encapsulated by the class if any, otherwise returns
null.
|
JMenuItem |
getJMenuItem()
Get the JMenuItem object associated with the widget.
|
String |
getText()
Get the text associated to the menu item.
|
String |
getToolTipText()
Getter for the tooltip text from the menu item.
|
boolean |
isEnabled()
Gets the enable status of the widget.
|
void |
setAccelerator(int acceleratorKey,
int modifierKeys)
Set the accelerator key or key combination attached to the menu item.
|
void |
setEnabled(boolean b)
Set the enable status of the component.
|
void |
setIcon(ImageIcon ico)
Set the icon associated to the menu item.
|
void |
setShortcut(int shorcutKey)
Set the shortcut key attached to the menu item.
|
void |
setText(String text)
Set the text associated to the menu item.
|
void |
setToolTipText(String toolTipText)
Setter of a tooltip text to a menu item.
|
activateConstraintsByType, attachCopyPasteMenu, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, clearAllInnerDescendantConstraint, clearConstraint, clearInnerDescendantContraint, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getConstraint, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGClassName, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getName, getNameInConfigFile, getOperationSaveValue, getPathInConfigFile, getSimpleWidgetId, getStatus, getStringConstraint, getSubComponent, getWidgetId, handleCopyPasteEvent, handleCopyPasteEvent, handleProcessEventException, isCopyPasteEvent, isForcedStatus, isModified, launchInvalidPositionException, mouseWheelMoved, parseSimpleConstraint, processGEvent, processMouseWheelEvent, setBusyCursor, setCommentInConfigFile, setConstraint, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDefaultConstraints, setDisplayIsModifiedIndicator, setElement, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setStringConstraint, setWidgetId, setWidth, setWindowBusyCursor, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem
public GMenuItem(String name)
name
- of the menu item.public GMenuItem(String widgetId, String name)
widgetId
- widget identifier.name
- of the menu item.public GMenuItem(String widgetId, JMenuItem menu)
widgetId
- widget identifier.menu
- JmenuItempublic GMenuItem(JMenuItem menu)
menu
- JmenuItempublic String getText()
public void setText(String text)
text
- the text associated to the menu item.public void setIcon(ImageIcon ico)
ico
- icon associated to the menu item.public boolean isEnabled()
isEnabled
in class GComponent
public void setEnabled(boolean b)
setEnabled
in class GComponent
b
- new enable status of the component.public JMenuItem getJMenuItem()
public Component getComponent()
getComponent
in class GComponent
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public void setShortcut(int shorcutKey)
shorcutKey
- the shortcut key to be attached to the menu item.public void setAccelerator(int acceleratorKey, int modifierKeys)
acceleratorKey
- the key to be attached to the menu item.modifierKeys
- the modifier key or key combination to be pressed together with the shortcut key (usually
Ctrl or Ctrl+Alt).public void setToolTipText(String toolTipText)
setToolTipText
in class GComponent
toolTipText
- to be set to the menu itempublic String getToolTipText()
Copyright © 2024. All rights reserved.