public class ExtensionPopupMenuItem extends JMenuItem implements ExtensionPopupMenuComponent
JMenuItem.AccessibleJMenuItem
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static int |
ATTACK_MENU_INDEX |
static int |
CONTEXT_FLAG_MENU_INDEX |
static int |
EXCLUDE_MENU_INDEX |
static int |
FLAG_MENU_INDEX |
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
ExtensionPopupMenuItem()
Constructs an
ExtensionPopupMenuItem with no text nor icon. |
ExtensionPopupMenuItem(Action action)
Constructs an
ExtensionPopupMenuItem with the given action. |
ExtensionPopupMenuItem(String text)
Constructs an
ExtensionPopupMenuItem with the given text and no icon. |
ExtensionPopupMenuItem(String text,
Icon icon)
Constructs an
ExtensionPopupMenuItem with the given text and icon. |
Modifier and Type | Method and Description |
---|---|
void |
dismissed(ExtensionPopupMenuComponent selectedMenuComponent)
Does nothing by default.
|
int |
getMenuIndex()
Returns the position that the pop up menu component should occupy in the pop up menu.
|
int |
getParentMenuIndex() |
String |
getParentMenuName() |
boolean |
isDummyItem() |
boolean |
isEnableForComponent(Component invoker)
By default, the pop up menu item button is enabled and it is enable for all
invoker s. |
boolean |
isEnableForMessageContainer(MessageContainer<?> invoker)
Defaults to call the method
isEnableForComponent(Component) passing as parameter the
component returned by the method MessageContainer#getComponent() called on the given
invoker . |
boolean |
isSafe()
Tells whether or not the pop up menu component is safe, that is, doesn't do any potentially
dangerous operations (for example, active scan a target server).
|
boolean |
isSubMenu() |
boolean |
isSuperMenu()
Deprecated.
(2.3.0) Not used. It will be removed in a following release.
|
boolean |
precedeWithSeparator()
Tells whether or not the pop up menu component should be preceded with a separator.
|
void |
setMenuIndex(int menuIndex) |
void |
setParentMenuIndex(int parentMenuIndex) |
void |
setPrecedeWithSeparator(boolean precede) |
void |
setSucceedWithSeparator(boolean succeed) |
boolean |
succeedWithSeparator()
Tells whether or not the pop up menu component should be succeeded with a separator.
|
actionPropertyChanged, addMenuDragMouseListener, addMenuKeyListener, configurePropertiesFromAction, fireMenuDragMouseDragged, fireMenuDragMouseEntered, fireMenuDragMouseExited, fireMenuDragMouseReleased, fireMenuKeyPressed, fireMenuKeyReleased, fireMenuKeyTyped, getAccelerator, getAccessibleContext, getComponent, getMenuDragMouseListeners, getMenuKeyListeners, getSubElements, getUIClassID, init, isArmed, menuSelectionChanged, paramString, processKeyEvent, processMenuDragMouseEvent, processMenuKeyEvent, processMouseEvent, removeMenuDragMouseListener, removeMenuKeyListener, setAccelerator, setArmed, setEnabled, setModel, setUI, updateUI
addActionListener, addChangeListener, addImpl, addItemListener, checkHorizontalKey, checkVerticalKey, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, removeNotify, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setFocusPainted, setHideActionText, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final int ATTACK_MENU_INDEX
public static final int EXCLUDE_MENU_INDEX
public static final int CONTEXT_FLAG_MENU_INDEX
public static final int FLAG_MENU_INDEX
public ExtensionPopupMenuItem()
ExtensionPopupMenuItem
with no text nor icon.public ExtensionPopupMenuItem(String text)
ExtensionPopupMenuItem
with the given text and no icon.text
- the text of the menu item.public ExtensionPopupMenuItem(String text, Icon icon)
ExtensionPopupMenuItem
with the given text and icon.text
- the text of the menu item.icon
- the icon of the menu item.public ExtensionPopupMenuItem(Action action)
ExtensionPopupMenuItem
with the given action.
The text and icon (if any) are obtained from the given action.
action
- the action of the menu item.public boolean isEnableForComponent(Component invoker)
invoker
s.isEnableForComponent
in interface ExtensionPopupMenuComponent
invoker
- the component where the pop up menu was invokedtrue
if the menu component is enable for the given invoker
, false
otherwise.isEnableForMessageContainer(MessageContainer)
public boolean isEnableForMessageContainer(MessageContainer<?> invoker)
isEnableForComponent(Component)
passing as parameter the
component returned by the method MessageContainer#getComponent()
called on the given
invoker
.isEnableForMessageContainer
in interface ExtensionPopupMenuComponent
invoker
- the message container where the pop up menu was invokedtrue
if the menu component is enable for the given invoker
, false
otherwise.isEnableForComponent(Component)
,
MessageContainer.getComponent()
public String getParentMenuName()
public int getMenuIndex()
ExtensionPopupMenuComponent
getMenuIndex
in interface ExtensionPopupMenuComponent
public void setMenuIndex(int menuIndex)
public int getParentMenuIndex()
public void setParentMenuIndex(int parentMenuIndex)
public boolean isSubMenu()
@Deprecated public boolean isSuperMenu()
public boolean isDummyItem()
public boolean precedeWithSeparator()
ExtensionPopupMenuComponent
precedeWithSeparator
in interface ExtensionPopupMenuComponent
true
if the menu component should be preceded with a separator, false
otherwise.JPopupMenu.Separator
public void setPrecedeWithSeparator(boolean precede)
public boolean succeedWithSeparator()
ExtensionPopupMenuComponent
succeedWithSeparator
in interface ExtensionPopupMenuComponent
true
if the menu component should be succeeded with a separator, false
otherwise.JPopupMenu.Separator
public void setSucceedWithSeparator(boolean succeed)
public boolean isSafe()
ExtensionPopupMenuComponent
The pop up menu component will be automatically disabled when it is not safe and the
Control.Mode
set doesn't allow potentially dangerous operations.
isSafe
in interface ExtensionPopupMenuComponent
true
if the menu component is safe, false
otherwise.Control.Mode
public void dismissed(ExtensionPopupMenuComponent selectedMenuComponent)
dismissed
in interface ExtensionPopupMenuComponent
selectedMenuComponent
- the selected menu component or null
if noneExtensionPopupMenuComponent.isEnableForComponent(Component)
,
ExtensionPopupMenuComponent.isEnableForMessageContainer(MessageContainer)