public class GPopupMenu extends GComponent implements MouseListener
add(GMenuItem) allows creation of sub menus using GMenuItem objects.GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.OperationNAME_ATTRIBUTE| Constructor and Description |
|---|
GPopupMenu(GComponent component)
Constructor.
|
GPopupMenu(String widgetId,
GComponent component)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(GLabel labelItem)
Add a label to the popup menu.
|
void |
add(GMenuItem menuItem)
Add a menu item to the popup menu.
|
void |
addSeparator()
Add a separtor to the popup menu.
|
Component |
getComponent()
Returns the low level Swing Component encapsulated by the class if any, otherwise returns
null.
|
JPopupMenu |
getJPopupMenu()
Return the JPopupMenu Swing component associated with the GPopupMenu.
|
boolean |
isEmpty()
Returns if the poup menu is empty.
|
void |
mouseClicked(MouseEvent e) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
void |
remove(int position)
Remove the menu item at the specified position.
|
void |
removeAll()
Remove all the menu items.
|
void |
setMouseEvent(int event)
Set the event that will trigger the displaying of the popup 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, isEnabled, isForcedStatus, isModified, launchInvalidPositionException, mouseWheelMoved, parseSimpleConstraint, processGEvent, processMouseWheelEvent, setBusyCursor, setCommentInConfigFile, setConstraint, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDefaultConstraints, setDisplayIsModifiedIndicator, setElement, setEnabled, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setStringConstraint, setToolTipText, setWidgetId, setWidth, setWindowBusyCursor, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItempublic GPopupMenu(String widgetId, GComponent component)
widgetId - identifier of the widget.component - component to which the popup menu is associated.public GPopupMenu(GComponent component)
component - component to which the popup menu is associated.public void add(GMenuItem menuItem)
menuItem - to add to the popup menu.public void add(GLabel labelItem)
labelItem - label to add to the popup menu.public void addSeparator()
public void remove(int position)
position - of the menu item to remove.public void removeAll()
public void setMouseEvent(int event)
event - to trigger the popup menu, see Swing events for possible choices.public Component getComponent()
GComponentgetComponent in class GComponentpublic JPopupMenu getJPopupMenu()
public void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerpublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenerpublic boolean isEmpty()
Copyright © 2024. All rights reserved.