public class JMenuItemMatcher extends Object implements ComponentMatcher
JMenuItem
given a simple label or a menu path of the format "menu|submenu|menuitem", for example
"File|Open|Can of worms". Adapted from Abbot's own JMenuItemMatcher
.Constructor and Description |
---|
JMenuItemMatcher(String... path)
Creates a new
JMenuItemMatcher . |
Modifier and Type | Method and Description |
---|---|
boolean |
matches(Component c)
Indicates whether the given component is a
JMenuItem whose text matches the path specified in this matcher. |
String |
toString() |
public JMenuItemMatcher(@Nonnull String... path)
JMenuItemMatcher
.path
- the path of the menu to match.@RunsInCurrentThread public boolean matches(@Nullable Component c)
Indicates whether the given component is a JMenuItem
whose text matches the path specified in this matcher.
Note: This method is accessed in the current executing thread. Such thread may or may not be the event dispatch thread (EDT). Client code must call this method from the EDT.
matches
in interface ComponentMatcher
c
- the component to verify.true
if the component matches, false
otherwise.Copyright © 2014–2019 AssertJ. All rights reserved.