org.fest.swing.fixture
Class Containers

java.lang.Object
  extended by org.fest.swing.fixture.Containers

public final class Containers
extends Object

Understands utility methods related to Containers.

Since:
1.2
Author:
Alex Ruiz

Field Summary
static String CREATED_FRAME_NAME
          Name of the JFrames created by this class.
 
Method Summary
static FrameFixture frameFixtureFor(Container contentPane)
          Creates a new JFrame and uses the given Container as its content pane.
static JFrame frameFor(Container contentPane)
          Creates a new JFrame and uses the given Container as its content pane.
static FrameFixture showInFrame(Container contentPane)
          Creates a new JFrame and uses the given Container as its content pane.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATED_FRAME_NAME

public static final String CREATED_FRAME_NAME
Name of the JFrames created by this class.

See Also:
Constant Field Values
Method Detail

showInFrame

@RunsInEDT
public static FrameFixture showInFrame(Container contentPane)
Creates a new JFrame and uses the given Container as its content pane. The created JFrame is wrapped and displayed by a FrameFixture.

Note:This method creates a new Robot. When using this method, please do not create any additional instances of Robot. Only one instance of Robot can exist per test class.

Parameters:
contentPane - the Container to use as content pane for the JFrame to create.
Returns:
the created FrameFixture.
See Also:
frameFor(Container)

frameFixtureFor

@RunsInEDT
public static FrameFixture frameFixtureFor(Container contentPane)
Creates a new JFrame and uses the given Container as its content pane. The created JFrame is wrapped by a FrameFixture. Unlike showInFrame(Container), this method does not display the created JFrame.

Note:This method creates a new Robot. When using this method, please do not create any additional instances of Robot. Only one instance of Robot can exist per test class.

Parameters:
contentPane - the Container to use as content pane for the JFrame to create.
Returns:
the created FrameFixture.
See Also:
frameFor(Container)

frameFor

@RunsInEDT
public static JFrame frameFor(Container contentPane)
Creates a new JFrame and uses the given Container as its content pane. The created JFrame has the name specified by CREATED_FRAME_NAME. This method is executed in the Event Dispatch Thread (EDT.)

Parameters:
contentPane - the Container to use as content pane for the JFrame to create.
Returns:
the created JFrame.


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