Constructor and Description |
---|
JMenuItemLocation(JMenuItem menuItem)
Creates a new
JMenuItemLocation . |
Modifier and Type | Method and Description |
---|---|
boolean |
inMenuBar()
|
boolean |
isParentAMenu()
Indicates whether the parent of the
is another menu. |
Component |
parentOrInvoker()
Returns the parent of
, or its invoker (if it is in a pop-up.) |
JPopupMenu |
parentPopup()
Returns the parent pop-up menu, or
null if the is not in a pop-up. |
@RunsInCurrentThread public JMenuItemLocation(JMenuItem menuItem)
JMenuItemLocation
.
Note: This constructor is not guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for ensuring that this constructor is executed in the EDT.
menuItem
- the target JMenuItem
.public boolean inMenuBar()
true
if the JMenuItem
is in a JMenuBar
, false
otherwise.@RunsInEDT public boolean isParentAMenu()
JMenuItem
is another menu.true
if the parent of the JMenuItem
is another menu, false
otherwise.public Component parentOrInvoker()
JMenuItem
, or its invoker (if it is in a pop-up.)JMenuItem
.public JPopupMenu parentPopup()
null
if the JMenuItem
is not in a pop-up.null
if the JMenuItem
is not in a pop-up.Copyright © 2007-2013 FEST (Fixtures for Easy Software Testing). All Rights Reserved.