public final class JMenuItemLocation extends Object
JMenuItem
.Constructor and Description |
---|
JMenuItemLocation(JMenuItem menuItem)
Creates a new
JMenuItemLocation . |
Modifier and Type | Method and Description |
---|---|
boolean |
inMenuBar()
Indicates whether the
JMenuItem is in a JMenuBar . |
boolean |
isParentAMenu()
Indicates whether the parent of the
JMenuItem is another menu. |
Component |
parentOrInvoker() |
JPopupMenu |
parentPopup() |
@RunsInCurrentThread public JMenuItemLocation(@Nonnull JMenuItem menuItem)
Creates a new JMenuItemLocation
.
Note: This constructor is accessed in the current executing thread. Such thread may or may not be the event dispatch thread (EDT). Client code must call this constructor from the EDT.
menuItem
- the target JMenuItem
.public boolean inMenuBar()
JMenuItem
is in a JMenuBar
.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.@Nonnull public Component parentOrInvoker()
JMenuItem
, or its invoker (if it is in a pop-up).@Nullable public JPopupMenu parentPopup()
null
if the JMenuItem
is not in a pop-up.Copyright © 2014–2019 AssertJ. All rights reserved.