public class GMenu extends GComponent
GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.Operation
NAME_ATTRIBUTE
Constructor and Description |
---|
GMenu(JMenu menu)
Constructor.
|
GMenu(String name)
Constructor.
|
GMenu(String widgetId,
JMenu menu)
Constructor.
|
GMenu(String widgetId,
String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(GMenu submenu)
Adds a menu to the menu, creating an hierachical menu.
|
void |
add(GMenu submenu,
int idx)
Adds a submenu to the menu, at the index selected.
|
void |
add(GMenuItem menuItem)
Adds a menu item to the menu.
|
void |
add(GMenuItem menuItem,
int idx)
Adds a menu to the menu, at the index selected.
|
void |
add(JMenu submenu,
int idx)
Adds a submenu to the menu, at the index selected.
|
void |
add(JMenuItem menuItem,
int idx)
Adds a menu to the menu, at the index selected.
|
void |
delete(GMenu submenu)
Deletes a submenu from the menu.
|
void |
delete(GMenuItem menuItem)
Deletes a menu from the menu.
|
void |
delete(JMenuItem menuItem)
Deletes a menu from the menu.
|
void |
delete(String menuItem)
Deletes a menu from the menu.
|
Component |
getComponent()
Returns the low level Swing Component encapsulated by the class if any, otherwise returns
null.
|
GMenuItem |
getGMenuItem(String menuItem)
Getter for a menu item
|
JMenu |
getJMenu()
Get the JMenu object associated with the widget.
|
boolean |
isEnabled()
Gets the enable status of the widget.
|
void |
move(GMenu submenu,
int idx)
Moves a menu to the indicated index
|
void |
move(GMenuItem menuItem,
int idx)
Moves a menu to the indicated index
|
void |
move(JMenu submenu,
int idx)
Moves a menu to the indicated index
|
void |
move(JMenuItem menuItem,
int idx)
Moves a menu to the indicated index
|
void |
move(String menuItem,
int idx)
Moves a menu to the indicated index
|
void |
setEnabled(boolean b)
Set the enable status of the component.
|
void |
setShortcut(int shorcutKey)
Set the shortcut key attached to the menu.
|
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, setToolTipText, setWidgetId, setWidth, setWindowBusyCursor, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem
public GMenu(String name)
name
- of the menu.public GMenu(String widgetId, String name)
widgetId
- widget identifier.name
- of the menu.public GMenu(String widgetId, JMenu menu)
widgetId
- widget identifier.menu
- JMenupublic GMenu(JMenu menu)
menu
- JMenupublic void add(GMenuItem menuItem)
menuItem
- to be added to the menu.public void add(GMenu submenu)
submenu
- the menu to be added to the menu.public boolean isEnabled()
isEnabled
in class GComponent
public void setEnabled(boolean b)
setEnabled
in class GComponent
b
- new enable status of the component.public JMenu getJMenu()
public void add(GMenuItem menuItem, int idx)
menuItem
- the menu to be added to the menu.idx
- the index at which the menu will be addedpublic void add(JMenuItem menuItem, int idx)
menuItem
- the menu to be added to the menu.idx
- the index at which the menu will be addedpublic void add(GMenu submenu, int idx)
submenu
- the menu to be added to the menu.idx
- the index at which the menu will be addedpublic void add(JMenu submenu, int idx)
submenu
- the menu to be added to the menu.idx
- the index at which the menu will be addedpublic void move(GMenuItem menuItem, int idx)
menuItem
- the menu to be moved.idx
- the index at which the menu will be movedpublic void move(JMenuItem menuItem, int idx)
menuItem
- the menu to be moved.idx
- the index at which the menu will be movedpublic void move(GMenu submenu, int idx)
submenu
- the menu to be moved.idx
- the index at which the menu will be movedpublic void move(JMenu submenu, int idx)
submenu
- the menu to be moved.idx
- the index at which the menu will be movedpublic void move(String menuItem, int idx)
menuItem
- the menu to be moved.idx
- the index at which the menu will be movedpublic void delete(GMenuItem menuItem)
menuItem
- menu to deletepublic void delete(JMenuItem menuItem)
menuItem
- menu to deletepublic void delete(String menuItem)
menuItem
- menu to deletepublic void delete(GMenu submenu)
submenu
- submenu to deletepublic GMenuItem getGMenuItem(String menuItem)
menuItem
- menuItem that we want to getpublic Component getComponent()
getComponent
in class GComponent
public void setShortcut(int shorcutKey)
shorcutKey
- the shortcut key to be attached to the menu.Copyright © 2024. All rights reserved.