org.fest.swing.fixture
Class ContainerFixture<T extends Container>

java.lang.Object
  extended by org.fest.swing.fixture.ComponentFixture<T>
      extended by org.fest.swing.fixture.ContainerFixture<T>
Type Parameters:
T - the type of container handled by this fixture.
All Implemented Interfaces:
ComponentContainerFixture
Direct Known Subclasses:
JInternalFrameFixture, JOptionPaneFixture, JPanelFixture, JToolBarFixture, WindowFixture

public abstract class ContainerFixture<T extends Container>
extends ComponentFixture<T>
implements ComponentContainerFixture

Understands lookup of Components contained in a Container.

Author:
Alex Ruiz, Yvonne Wang

Field Summary
 
Fields inherited from class org.fest.swing.fixture.ComponentFixture
BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY, robot, target
 
Fields inherited from interface org.fest.swing.fixture.ComponentContainerFixture
DEFAULT_DIALOG_LOOKUP_TIMEOUT
 
Constructor Summary
ContainerFixture(Robot robot, Class<? extends T> type)
          Creates a new ContainerFixture.
ContainerFixture(Robot robot, String name, Class<? extends T> type)
          Creates a new ContainerFixture.
ContainerFixture(Robot robot, T target)
          Creates a new ContainerFixture.
 
Method Summary
 JButtonFixture button()
          Returns a JButton found in this fixture's Container.
 JButtonFixture button(GenericTypeMatcher<? extends JButton> matcher)
          Finds a JButton in this fixture's Container, that matches the specified search criteria.
 JButtonFixture button(String name)
          Finds a JButton in this fixture's Container, which name matches the specified one.
 JCheckBoxFixture checkBox()
          Returns a JCheckBox found in this fixture's Container.
 JCheckBoxFixture checkBox(GenericTypeMatcher<? extends JCheckBox> matcher)
          Finds a JCheckBox in this fixture's Container, that matches the specified search criteria.
 JCheckBoxFixture checkBox(String name)
          Finds a JCheckBox in this fixture's Container, which name matches the specified one.
 JComboBoxFixture comboBox()
          Returns a JComboBox found in this fixture's Container.
 JComboBoxFixture comboBox(GenericTypeMatcher<? extends JComboBox> matcher)
          Finds a JComboBox in this fixture's Container, that matches the specified search criteria.
 JComboBoxFixture comboBox(String name)
          Finds a JComboBox in this fixture's Container, which name matches the specified one.
 DialogFixture dialog()
          Returns the only Dialog currently available (if any.) This method uses the value defined in ComponentContainerFixture.DEFAULT_DIALOG_LOOKUP_TIMEOUT as the default lookup timeout.
 DialogFixture dialog(GenericTypeMatcher<? extends Dialog> matcher)
          Finds a Dialog that matches the specified search criteria.
 DialogFixture dialog(GenericTypeMatcher<? extends Dialog> matcher, Timeout timeout)
          Finds a Dialog that matches the specified search criteria.
 DialogFixture dialog(String name)
          Finds a Dialog with a name matching the specified one.
 DialogFixture dialog(String name, Timeout timeout)
          Finds a Dialog with a name matching the specified one.
 DialogFixture dialog(Timeout timeout)
          Returns the only Dialog currently available (if any.)
 JFileChooserFixture fileChooser()
          Returns the only JFileChooser currently available (if any.) This method uses the value defined in ComponentContainerFixture.DEFAULT_DIALOG_LOOKUP_TIMEOUT as the default lookup timeout.
 JFileChooserFixture fileChooser(GenericTypeMatcher<? extends JFileChooser> matcher)
          Finds a JFileChooser that matches the specified search criteria.
 JFileChooserFixture fileChooser(GenericTypeMatcher<? extends JFileChooser> matcher, Timeout timeout)
          Finds a JFileChooser that matches the specified search criteria.
 JFileChooserFixture fileChooser(String name)
          Finds a JFileChooser with a name matching the specified one.
 JFileChooserFixture fileChooser(String name, Timeout timeout)
          Finds a JFileChooser with a name matching the specified one.
 JFileChooserFixture fileChooser(Timeout timeout)
          Returns the only JFileChooser currently available (if any.)
protected
<C extends Component>
C
find(GenericTypeMatcher<? extends C> matcher)
          Finds a Component using the given GenericTypeMatcher, contained in this fixture's Container.
protected
<C extends Component>
C
findByName(String name, Class<C> type)
          Finds a component by name and type, contained in this fixture's Container.
protected
<C extends Component>
C
findByType(Class<C> type)
          Finds a component by type, contained in this fixture's Container.
protected  ComponentFinder finder()
          Returns the ComponentFinder contained in this fixture's Robot.
 JLabelFixture label()
          Returns a JLabel found in this fixture's Container.
 JLabelFixture label(GenericTypeMatcher<? extends JLabel> matcher)
          Finds a JLabel in this fixture's Container, that matches the specified search criteria.
 JLabelFixture label(String name)
          Finds a JLabel in this fixture's Container, which name matches the specified one.
 JListFixture list()
          Returns a JList found in this fixture's Container.
 JListFixture list(GenericTypeMatcher<? extends JList> matcher)
          Finds a JList in this fixture's Container, that matches the specified search criteria.
 JListFixture list(String name)
          Finds a JList in this fixture's Container, which name matches the specified one.
 JMenuItemFixture menuItem(GenericTypeMatcher<? extends JMenuItem> matcher)
          Finds a JMenuItem, contained in this fixture's Container, that matches the specified search criteria.
 JMenuItemFixture menuItem(String name)
          Finds a JMenuItem, contained in this fixture's Container, which name matches the specified one.
 JMenuItemFixture menuItemWithPath(String... path)
          Finds a JMenuItem in this fixture's Container, which path matches the given one.
 JOptionPaneFixture optionPane()
          Returns the only JOptionPane currently available (if any.) This method uses the value defined in ComponentContainerFixture.DEFAULT_DIALOG_LOOKUP_TIMEOUT as the default lookup timeout.
 JOptionPaneFixture optionPane(Timeout timeout)
          Returns the only JOptionPane currently available (if any.)
 JPanelFixture panel()
          Returns a JPanel found in this fixture's Container.
 JPanelFixture panel(GenericTypeMatcher<? extends JPanel> matcher)
          Finds a JPanel in this fixture's Container, that matches the specified search criteria.
 JPanelFixture panel(String name)
          Finds a JPanel in this fixture's Container, which name matches the specified one.
 JProgressBarFixture progressBar()
          Returns a JProgressBar found in this fixture's Container.
 JProgressBarFixture progressBar(GenericTypeMatcher<? extends JProgressBar> matcher)
          Finds a JProgressBar in this fixture's Container, that matches the specified search criteria.
 JProgressBarFixture progressBar(String name)
          Finds a JProgressBar in this fixture's Container, which name matches the specified one.
 JRadioButtonFixture radioButton()
          Returns a JRadioButton found in this fixture's Container.
 JRadioButtonFixture radioButton(GenericTypeMatcher<? extends JRadioButton> matcher)
          Finds a JRadioButton in this fixture's Container, that matches the specified search criteria.
 JRadioButtonFixture radioButton(String name)
          Finds a JRadioButton in this fixture's Container, which name matches the specified one.
 JScrollBarFixture scrollBar()
          Returns a JScrollBar found in this fixture's Container.
 JScrollBarFixture scrollBar(GenericTypeMatcher<? extends JScrollBar> matcher)
          Finds a JScrollBar in this fixture's Container, that matches the specified search criteria.
 JScrollBarFixture scrollBar(String name)
          Finds a JScrollBar in this fixture's Container, which name matches the specified one.
 JScrollPaneFixture scrollPane()
          Returns a JScrollPane found in this fixture's Container.
 JScrollPaneFixture scrollPane(GenericTypeMatcher<? extends JScrollPane> matcher)
          Finds a JScrollPane in this fixture's Container, that matches the specified search criteria.
 JScrollPaneFixture scrollPane(String name)
          Finds a JScrollPane in this fixture's Container, which name matches the specified one.
 JSliderFixture slider()
          Returns a JSlider found in this fixture's Container.
 JSliderFixture slider(GenericTypeMatcher<? extends JSlider> matcher)
          Finds a JSlider in this fixture's Container, that matches the specified search criteria.
 JSliderFixture slider(String name)
          Finds a JSlider in this fixture's Container, which name matches the specified one.
 JSpinnerFixture spinner()
          Returns a JSpinner found in this fixture's Container.
 JSpinnerFixture spinner(GenericTypeMatcher<? extends JSpinner> matcher)
          Finds a JSpinner in this fixture's Container, that matches the specified search criteria.
 JSpinnerFixture spinner(String name)
          Finds a JSpinner in this fixture's Container, which name matches the specified one.
 JSplitPaneFixture splitPane()
          Returns the JSplitPane found in this fixture's Container.
 JSplitPaneFixture splitPane(GenericTypeMatcher<? extends JSplitPane> matcher)
          Finds a JSplitPane in this fixture's Container, that matches the specified search criteria.
 JSplitPaneFixture splitPane(String name)
          Finds a JSplitPane in this fixture's Container, which name matches the specified one.
 JTabbedPaneFixture tabbedPane()
          Returns a JTabbedPane found in this fixture's Container.
 JTabbedPaneFixture tabbedPane(GenericTypeMatcher<? extends JTabbedPane> matcher)
          Finds a JTabbedPane in this fixture's Container, that matches the specified search criteria.
 JTabbedPaneFixture tabbedPane(String name)
          Finds a JTabbedPane in this fixture's Container, which name matches the specified one.
 JTableFixture table()
          Returns a JTable found in this fixture's Container.
 JTableFixture table(GenericTypeMatcher<? extends JTable> matcher)
          Finds a JTable in this fixture's Container, that matches the specified search criteria.
 JTableFixture table(String name)
          Finds a JTable in this fixture's Container, which name matches the specified one.
 JTextComponentFixture textBox()
          Returns a JTextComponent found in this fixture's Container.
 JTextComponentFixture textBox(GenericTypeMatcher<? extends JTextComponent> matcher)
          Finds a JTextComponent in this fixture's Container managed by this fixture, that matches the specified search criteria.
 JTextComponentFixture textBox(String name)
          Finds a JTextComponent in this fixture's Container managed by this fixture, which name matches the specified one.
 JToggleButtonFixture toggleButton()
          Returns a JToggleButton found in this fixture's Container.
 JToggleButtonFixture toggleButton(GenericTypeMatcher<? extends JToggleButton> matcher)
          Finds a JToggleButton in this fixture's Container, that matches the specified search criteria.
 JToggleButtonFixture toggleButton(String name)
          Finds a JToggleButton in this fixture's Container, which name matches the specified one.
 JToolBarFixture toolBar()
          Returns a JToolBar found in this fixture's Container.
 JToolBarFixture toolBar(GenericTypeMatcher<? extends JToolBar> matcher)
          Finds a JToolBar in this fixture's Container, that matches the specified search criteria.
 JToolBarFixture toolBar(String name)
          Finds a JToolBar in this fixture's Container, which name matches the specified one.
 JTreeFixture tree()
          Returns a JTree found in this fixture's Container.
 JTreeFixture tree(GenericTypeMatcher<? extends JTree> matcher)
          Finds a JTree in this fixture's Container, that matches the specified search criteria.
 JTreeFixture tree(String name)
          Finds a JTree in this fixture's Container, which name matches the specified one.
<C extends Component,F extends ComponentFixture<C>>
F
with(ComponentFixtureExtension<C,F> extension)
          Returns a ComponentFixture managing a component inside this fixture's Container.
 
Methods inherited from class org.fest.swing.fixture.ComponentFixture
background, component, font, foreground, requireShowing, targetCastedTo, validateNotNull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerFixture

public ContainerFixture(Robot robot,
                        Class<? extends T> type)
Creates a new ContainerFixture.

Parameters:
robot - performs simulation of user events on a Container.
type - the type of the Container to find using the given Robot.
Throws:
NullPointerException - if robot is null.
NullPointerException - if type is null.
ComponentLookupException - if a matching component could not be found.
ComponentLookupException - if more than one matching component is found.
See Also:
ComponentFinder.findByType(Class)

ContainerFixture

public ContainerFixture(Robot robot,
                        String name,
                        Class<? extends T> type)
Creates a new ContainerFixture.

Parameters:
robot - performs simulation of user events on a Container.
name - the name of the Container to find using the given Robot.
type - the type of the Container to find using the given Robot.
Throws:
NullPointerException - if robot is null.
NullPointerException - if type is null.
ComponentLookupException - if a matching component could not be found.
ComponentLookupException - if more than one matching component is found.
See Also:
ComponentFinder.findByName(String, Class)

ContainerFixture

public ContainerFixture(Robot robot,
                        T target)
Creates a new ContainerFixture.

Parameters:
robot - performs simulation of user events on the given Container.
target - the Container to be.
Throws:
NullPointerException - if robot is null.
NullPointerException - if target is null.
Method Detail

button

public JButtonFixture button()
Returns a JButton found in this fixture's Container.

Specified by:
button in interface ComponentContainerFixture
Returns:
a fixture that manages the JButton found.

button

public JButtonFixture button(GenericTypeMatcher<? extends JButton> matcher)
Finds a JButton in this fixture's Container, that matches the specified search criteria.

Specified by:
button in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JButton.
Returns:
a fixture that manages the JButton found.

button

public JButtonFixture button(String name)
Finds a JButton in this fixture's Container, which name matches the specified one.

Specified by:
button in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JButton found.

checkBox

public JCheckBoxFixture checkBox()
Returns a JCheckBox found in this fixture's Container.

Specified by:
checkBox in interface ComponentContainerFixture
Returns:
a fixture that manages the JCheckBox found.

checkBox

public JCheckBoxFixture checkBox(GenericTypeMatcher<? extends JCheckBox> matcher)
Finds a JCheckBox in this fixture's Container, that matches the specified search criteria.

Specified by:
checkBox in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JCheckBox.
Returns:
a fixture that manages the JCheckBox found.

checkBox

public JCheckBoxFixture checkBox(String name)
Finds a JCheckBox in this fixture's Container, which name matches the specified one.

Specified by:
checkBox in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JCheckBox found.

comboBox

public JComboBoxFixture comboBox()
Returns a JComboBox found in this fixture's Container.

Specified by:
comboBox in interface ComponentContainerFixture
Returns:
a fixture that manages the JComboBox found.

comboBox

public JComboBoxFixture comboBox(GenericTypeMatcher<? extends JComboBox> matcher)
Finds a JComboBox in this fixture's Container, that matches the specified search criteria.

Specified by:
comboBox in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JComboBox.
Returns:
a fixture that manages the JComboBox found.

comboBox

public JComboBoxFixture comboBox(String name)
Finds a JComboBox in this fixture's Container, which name matches the specified one.

Specified by:
comboBox in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JComboBox found.

dialog

public DialogFixture dialog()
Returns the only Dialog currently available (if any.) This method uses the value defined in ComponentContainerFixture.DEFAULT_DIALOG_LOOKUP_TIMEOUT as the default lookup timeout.

Specified by:
dialog in interface ComponentContainerFixture
Returns:
a fixture that manages the Dialog found.
See Also:
ComponentContainerFixture.dialog(Timeout)

dialog

public DialogFixture dialog(Timeout timeout)
Returns the only Dialog currently available (if any.)

Specified by:
dialog in interface ComponentContainerFixture
Parameters:
timeout - the amount of time to wait for a Dialog to be found.
Returns:
a fixture that manages the Dialog found.

dialog

public DialogFixture dialog(GenericTypeMatcher<? extends Dialog> matcher)
Finds a Dialog that matches the specified search criteria. This method uses the value defined in ComponentContainerFixture.DEFAULT_DIALOG_LOOKUP_TIMEOUT as the default lookup timeout.

Specified by:
dialog in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a Dialog.
Returns:
a fixture that manages the Dialog found.
See Also:
ComponentContainerFixture.dialog(GenericTypeMatcher, Timeout)

dialog

public DialogFixture dialog(GenericTypeMatcher<? extends Dialog> matcher,
                            Timeout timeout)
Finds a Dialog that matches the specified search criteria.

Specified by:
dialog in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a Dialog.
timeout - the amount of time to wait for a Dialog to be found.
Returns:
a fixture that manages the Dialog found.

dialog

public DialogFixture dialog(String name)
Finds a Dialog with a name matching the specified one. This method uses the value defined in ComponentContainerFixture.DEFAULT_DIALOG_LOOKUP_TIMEOUT as the default lookup timeout.

Specified by:
dialog in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the Dialog found.
See Also:
ComponentContainerFixture.dialog(String, Timeout)

dialog

public DialogFixture dialog(String name,
                            Timeout timeout)
Finds a Dialog with a name matching the specified one.

Specified by:
dialog in interface ComponentContainerFixture
Parameters:
name - the name to match.
timeout - the amount of time to wait for a Dialog to be found.
Returns:
a fixture that manages the Dialog found.

fileChooser

public JFileChooserFixture fileChooser()
Returns the only JFileChooser currently available (if any.) This method uses the value defined in ComponentContainerFixture.DEFAULT_DIALOG_LOOKUP_TIMEOUT as the default lookup timeout.

Specified by:
fileChooser in interface ComponentContainerFixture
Returns:
a fixture that manages the JFileChooser found.
See Also:
ComponentContainerFixture.fileChooser(Timeout)

fileChooser

public JFileChooserFixture fileChooser(Timeout timeout)
Returns the only JFileChooser currently available (if any.)

Specified by:
fileChooser in interface ComponentContainerFixture
Parameters:
timeout - the amount of time to wait for a JFileChooser to be found.
Returns:
a fixture that manages the JFileChooser found.

fileChooser

public JFileChooserFixture fileChooser(GenericTypeMatcher<? extends JFileChooser> matcher)
Finds a JFileChooser that matches the specified search criteria. This method uses the value defined in ComponentContainerFixture.DEFAULT_DIALOG_LOOKUP_TIMEOUT as the default lookup timeout.

Specified by:
fileChooser in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JFileChooser.
Returns:
a fixture that manages the JFileChooser found.
See Also:
ComponentContainerFixture.fileChooser(GenericTypeMatcher, Timeout)

fileChooser

public JFileChooserFixture fileChooser(GenericTypeMatcher<? extends JFileChooser> matcher,
                                       Timeout timeout)
Finds a JFileChooser that matches the specified search criteria.

Specified by:
fileChooser in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JFileChooser.
timeout - the amount of time to wait for a JFileChooser to be found.
Returns:
a fixture that manages the JFileChooser found.

fileChooser

public JFileChooserFixture fileChooser(String name)
Finds a JFileChooser with a name matching the specified one. This method uses the value defined in ComponentContainerFixture.DEFAULT_DIALOG_LOOKUP_TIMEOUT as the default lookup timeout.

Specified by:
fileChooser in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JFileChooser found.
See Also:
ComponentContainerFixture.fileChooser(String, Timeout)

fileChooser

public JFileChooserFixture fileChooser(String name,
                                       Timeout timeout)
Finds a JFileChooser with a name matching the specified one.

Specified by:
fileChooser in interface ComponentContainerFixture
Parameters:
name - the name to match.
timeout - the amount of time to wait for a JFileChooser to be found.
Returns:
a fixture that manages the JFileChooser found.

label

public JLabelFixture label()
Returns a JLabel found in this fixture's Container.

Specified by:
label in interface ComponentContainerFixture
Returns:
a fixture that manages the JLabel found.

label

public JLabelFixture label(GenericTypeMatcher<? extends JLabel> matcher)
Finds a JLabel in this fixture's Container, that matches the specified search criteria.

Specified by:
label in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JLabel.
Returns:
a fixture that manages the JLabel found.

label

public JLabelFixture label(String name)
Finds a JLabel in this fixture's Container, which name matches the specified one.

Specified by:
label in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JLabel found.

list

public JListFixture list()
Returns a JList found in this fixture's Container.

Specified by:
list in interface ComponentContainerFixture
Returns:
a fixture that manages the JList found.

list

public JListFixture list(GenericTypeMatcher<? extends JList> matcher)
Finds a JList in this fixture's Container, that matches the specified search criteria.

Specified by:
list in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JList.
Returns:
a fixture that manages the JList found.

list

public JListFixture list(String name)
Finds a JList in this fixture's Container, which name matches the specified one.

Specified by:
list in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JList found.

menuItemWithPath

public JMenuItemFixture menuItemWithPath(String... path)
Finds a JMenuItem in this fixture's Container, which path matches the given one.

For example, if we are looking for the menu with text "New" contained under the menu with text "File", we can simply call

 JMenuItemFixture menuItem = container.menuItemWithPath("File", "Menu");
 

Specified by:
menuItemWithPath in interface ComponentContainerFixture
Parameters:
path - the path of the menu to find.
Returns:
a fixture that manages the JMenuItem found.

menuItem

public JMenuItemFixture menuItem(String name)
Finds a JMenuItem, contained in this fixture's Container, which name matches the specified one.

Specified by:
menuItem in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JMenuItem found.

menuItem

public JMenuItemFixture menuItem(GenericTypeMatcher<? extends JMenuItem> matcher)
Finds a JMenuItem, contained in this fixture's Container, that matches the specified search criteria.

Specified by:
menuItem in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JMenuItem.
Returns:
a fixture that manages the JMenuItem found.

optionPane

public JOptionPaneFixture optionPane()
Returns the only JOptionPane currently available (if any.) This method uses the value defined in ComponentContainerFixture.DEFAULT_DIALOG_LOOKUP_TIMEOUT as the default lookup timeout.

Specified by:
optionPane in interface ComponentContainerFixture
Returns:
a fixture that manages the JOptionPane found.
See Also:
ComponentContainerFixture.optionPane(Timeout)

optionPane

public JOptionPaneFixture optionPane(Timeout timeout)
Returns the only JOptionPane currently available (if any.)

Specified by:
optionPane in interface ComponentContainerFixture
Parameters:
timeout - the amount of time to wait for a JOptionPane to be found.
Returns:
a fixture that manages the JOptionPane found.

panel

public JPanelFixture panel()
Returns a JPanel found in this fixture's Container.

Specified by:
panel in interface ComponentContainerFixture
Returns:
a fixture that manages the JPanel found.

panel

public JPanelFixture panel(GenericTypeMatcher<? extends JPanel> matcher)
Finds a JPanel in this fixture's Container, that matches the specified search criteria.

Specified by:
panel in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JPanel.
Returns:
a fixture that manages the JPanel found.

panel

public JPanelFixture panel(String name)
Finds a JPanel in this fixture's Container, which name matches the specified one.

Specified by:
panel in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JPanel found.

progressBar

public JProgressBarFixture progressBar()
Returns a JProgressBar found in this fixture's Container.

Specified by:
progressBar in interface ComponentContainerFixture
Returns:
a fixture that manages the JProgressBar found.

progressBar

public JProgressBarFixture progressBar(GenericTypeMatcher<? extends JProgressBar> matcher)
Finds a JProgressBar in this fixture's Container, that matches the specified search criteria.

Specified by:
progressBar in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JProgressBar.
Returns:
a fixture that manages the JProgressBar found.

progressBar

public JProgressBarFixture progressBar(String name)
Finds a JProgressBar in this fixture's Container, which name matches the specified one.

Specified by:
progressBar in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JProgressBar found.

radioButton

public JRadioButtonFixture radioButton()
Returns a JRadioButton found in this fixture's Container.

Specified by:
radioButton in interface ComponentContainerFixture
Returns:
a fixture that manages the JRadioButton found.

radioButton

public JRadioButtonFixture radioButton(GenericTypeMatcher<? extends JRadioButton> matcher)
Finds a JRadioButton in this fixture's Container, that matches the specified search criteria.

Specified by:
radioButton in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JRadioButton.
Returns:
a fixture that manages the JRadioButton found.

radioButton

public JRadioButtonFixture radioButton(String name)
Finds a JRadioButton in this fixture's Container, which name matches the specified one.

Specified by:
radioButton in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JRadioButton found.

scrollBar

public JScrollBarFixture scrollBar()
Returns a JScrollBar found in this fixture's Container.

Specified by:
scrollBar in interface ComponentContainerFixture
Returns:
a fixture that manages the JScrollBar found.

scrollBar

public JScrollBarFixture scrollBar(GenericTypeMatcher<? extends JScrollBar> matcher)
Finds a JScrollBar in this fixture's Container, that matches the specified search criteria.

Specified by:
scrollBar in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JScrollBar.
Returns:
a fixture that manages the JScrollBar found.

scrollBar

public JScrollBarFixture scrollBar(String name)
Finds a JScrollBar in this fixture's Container, which name matches the specified one.

Specified by:
scrollBar in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JScrollBar found.

scrollPane

public JScrollPaneFixture scrollPane()
Returns a JScrollPane found in this fixture's Container.

Specified by:
scrollPane in interface ComponentContainerFixture
Returns:
a fixture that manages the JScrollPane found.

scrollPane

public JScrollPaneFixture scrollPane(GenericTypeMatcher<? extends JScrollPane> matcher)
Finds a JScrollPane in this fixture's Container, that matches the specified search criteria.

Specified by:
scrollPane in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JScrollPane.
Returns:
a fixture that manages the JScrollPane found.

scrollPane

public JScrollPaneFixture scrollPane(String name)
Finds a JScrollPane in this fixture's Container, which name matches the specified one.

Specified by:
scrollPane in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JScrollPane found.

slider

public JSliderFixture slider()
Returns a JSlider found in this fixture's Container.

Specified by:
slider in interface ComponentContainerFixture
Returns:
a fixture that manages the JSlider found.

slider

public JSliderFixture slider(GenericTypeMatcher<? extends JSlider> matcher)
Finds a JSlider in this fixture's Container, that matches the specified search criteria.

Specified by:
slider in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JSlider.
Returns:
a fixture that manages the JSlider found.

slider

public JSliderFixture slider(String name)
Finds a JSlider in this fixture's Container, which name matches the specified one.

Specified by:
slider in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JSlider found.

spinner

public JSpinnerFixture spinner()
Returns a JSpinner found in this fixture's Container.

Specified by:
spinner in interface ComponentContainerFixture
Returns:
a fixture that manages the JSpinner found.

spinner

public JSpinnerFixture spinner(GenericTypeMatcher<? extends JSpinner> matcher)
Finds a JSpinner in this fixture's Container, that matches the specified search criteria.

Specified by:
spinner in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JSpinner.
Returns:
a fixture that manages the JSpinner found.

spinner

public JSpinnerFixture spinner(String name)
Finds a JSpinner in this fixture's Container, which name matches the specified one.

Specified by:
spinner in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JSpinner found.

splitPane

public JSplitPaneFixture splitPane()
Returns the JSplitPane found in this fixture's Container.

Specified by:
splitPane in interface ComponentContainerFixture
Returns:
a fixture that manages the JSplitPane found.

splitPane

public JSplitPaneFixture splitPane(GenericTypeMatcher<? extends JSplitPane> matcher)
Finds a JSplitPane in this fixture's Container, that matches the specified search criteria.

Specified by:
splitPane in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JSplitPane.
Returns:
a fixture that manages the JSplitPane found.

splitPane

public JSplitPaneFixture splitPane(String name)
Finds a JSplitPane in this fixture's Container, which name matches the specified one.

Specified by:
splitPane in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JSplitPane found.

tabbedPane

public JTabbedPaneFixture tabbedPane()
Returns a JTabbedPane found in this fixture's Container.

Specified by:
tabbedPane in interface ComponentContainerFixture
Returns:
a fixture that manages the JTabbedPane found.

tabbedPane

public JTabbedPaneFixture tabbedPane(GenericTypeMatcher<? extends JTabbedPane> matcher)
Finds a JTabbedPane in this fixture's Container, that matches the specified search criteria.

Specified by:
tabbedPane in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JTabbedPane.
Returns:
a fixture that manages the JTabbedPane found.

tabbedPane

public JTabbedPaneFixture tabbedPane(String name)
Finds a JTabbedPane in this fixture's Container, which name matches the specified one.

Specified by:
tabbedPane in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JTabbedPane found.

table

public JTableFixture table()
Returns a JTable found in this fixture's Container.

Specified by:
table in interface ComponentContainerFixture
Returns:
a fixture that manages the JTable found.

table

public JTableFixture table(GenericTypeMatcher<? extends JTable> matcher)
Finds a JTable in this fixture's Container, that matches the specified search criteria.

Specified by:
table in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JTable.
Returns:
a fixture that manages the JTable found.

table

public JTableFixture table(String name)
Finds a JTable in this fixture's Container, which name matches the specified one.

Specified by:
table in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JTable found.

textBox

public JTextComponentFixture textBox()
Returns a JTextComponent found in this fixture's Container.

Specified by:
textBox in interface ComponentContainerFixture
Returns:
a fixture that manages the JTextComponent found.

textBox

public JTextComponentFixture textBox(GenericTypeMatcher<? extends JTextComponent> matcher)
Finds a JTextComponent in this fixture's Container managed by this fixture, that matches the specified search criteria.

Specified by:
textBox in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JTextComponent.
Returns:
a fixture that manages the JTextComponent found.

textBox

public JTextComponentFixture textBox(String name)
Finds a JTextComponent in this fixture's Container managed by this fixture, which name matches the specified one.

Specified by:
textBox in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JTextComponent found.

toggleButton

public JToggleButtonFixture toggleButton()
Returns a JToggleButton found in this fixture's Container.

Specified by:
toggleButton in interface ComponentContainerFixture
Returns:
a fixture that manages the JToggleButton found.

toggleButton

public JToggleButtonFixture toggleButton(GenericTypeMatcher<? extends JToggleButton> matcher)
Finds a JToggleButton in this fixture's Container, that matches the specified search criteria.

Specified by:
toggleButton in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JToggleButton.
Returns:
a fixture that manages the JToggleButton found.

toggleButton

public JToggleButtonFixture toggleButton(String name)
Finds a JToggleButton in this fixture's Container, which name matches the specified one.

Specified by:
toggleButton in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JToggleButton found.

toolBar

public JToolBarFixture toolBar()
Returns a JToolBar found in this fixture's Container.

Specified by:
toolBar in interface ComponentContainerFixture
Returns:
a fixture that manages the JToolBar found.

toolBar

public JToolBarFixture toolBar(GenericTypeMatcher<? extends JToolBar> matcher)
Finds a JToolBar in this fixture's Container, that matches the specified search criteria.

Specified by:
toolBar in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JToolBar.
Returns:
a fixture that manages the JToolBar found.

toolBar

public JToolBarFixture toolBar(String name)
Finds a JToolBar in this fixture's Container, which name matches the specified one.

Specified by:
toolBar in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JToolBar found.

tree

public JTreeFixture tree()
Returns a JTree found in this fixture's Container.

Specified by:
tree in interface ComponentContainerFixture
Returns:
a fixture that manages the JTree found.

tree

public JTreeFixture tree(GenericTypeMatcher<? extends JTree> matcher)
Finds a JTree in this fixture's Container, that matches the specified search criteria.

Specified by:
tree in interface ComponentContainerFixture
Parameters:
matcher - contains the search criteria for finding a JTree.
Returns:
a fixture that manages the JTree found.

tree

public JTreeFixture tree(String name)
Finds a JTree in this fixture's Container, which name matches the specified one.

Specified by:
tree in interface ComponentContainerFixture
Parameters:
name - the name to match.
Returns:
a fixture that manages the JTree found.

findByType

protected final <C extends Component> C findByType(Class<C> type)
Finds a component by type, contained in this fixture's Container.

Type Parameters:
C - the generic type of the component to find.
Parameters:
type - the type of component to find.
Returns:
the found component.
Throws:
ComponentLookupException - if a matching component could not be found.
ComponentLookupException - if more than one matching component is found.

findByName

protected final <C extends Component> C findByName(String name,
                                                   Class<C> type)
Finds a component by name and type, contained in this fixture's Container.

Type Parameters:
C - the generic type of the component to find.
Parameters:
name - the name of the component to find.
type - the type of component to find.
Returns:
the found component.
Throws:
ComponentLookupException - if a matching component could not be found.
ComponentLookupException - if more than one matching component is found.

find

protected final <C extends Component> C find(GenericTypeMatcher<? extends C> matcher)
Finds a Component using the given GenericTypeMatcher, contained in this fixture's Container.

Type Parameters:
C - the generic type of component the given matcher can handle.
Parameters:
matcher - the matcher to use to find the component.
Returns:
the found component.
Throws:
ComponentLookupException - if a matching component could not be found.
ComponentLookupException - if more than one matching component is found.

with

public <C extends Component,F extends ComponentFixture<C>> F with(ComponentFixtureExtension<C,F> extension)
Returns a ComponentFixture managing a component inside this fixture's Container. This is an extension method, to allow implementations of ContainerFixture handle custom GUI components.

Specified by:
with in interface ComponentContainerFixture
Type Parameters:
C - the type of Component the fixture to return can handle.
F - the type of ComponentFixture to return.
Parameters:
extension - the ComponentFixtureExtension that creates the ComponentFixture to return.
Returns:
a ComponentFixture managing a component inside this fixture's Container.

finder

protected final ComponentFinder finder()
Returns the ComponentFinder contained in this fixture's Robot.

Returns:
the ComponentFinder contained in this fixture's Robot.


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.