org.fest.swing.driver
Class WindowDriver

java.lang.Object
  extended by org.fest.swing.driver.ComponentDriver
      extended by org.fest.swing.driver.ContainerDriver
          extended by org.fest.swing.driver.WindowDriver
Direct Known Subclasses:
DialogDriver, FrameDriver

public class WindowDriver
extends ContainerDriver

Understands functional testing of Windows:

This class is intended for internal use only. Please use the classes in the package org.fest.swing.fixture in your tests.

Author:
Alex Ruiz

Field Summary
 
Fields inherited from class org.fest.swing.driver.ComponentDriver
robot
 
Constructor Summary
WindowDriver(Robot robot)
          Creates a new WindowDriver.
 
Method Summary
 void close(Window w)
          Closing the Window.
 void moveTo(Window w, Point where)
          Moves the Window to the given location.
 void moveToBack(Window w)
          If the given Window is visible, sends it to the back and may cause it to lose focus or activation if it is the focused or active.
 void moveToFront(Window w)
          If the given Window is visible, brings it to the front and may make it the focused one.
 void resizeHeightTo(Window w, int height)
          Resizes the Window vertically.
 void resizeTo(Window w, Dimension size)
          Resizes the Window to the given size.
 void resizeWidthTo(Window w, int width)
          Resizes the Window horizontally.
 void show(Window w)
          Shows the Window.
 void show(Window w, Dimension size)
          Shows the Window, resized to the given size.
 
Methods inherited from class org.fest.swing.driver.ContainerDriver
move, resize, resizeHeight, resizeWidth
 
Methods inherited from class org.fest.swing.driver.ComponentDriver
assertIsEnabledAndShowing, click, click, click, click, click, doubleClick, drag, dragOver, drop, focus, focusAndWaitForFocusGain, invokePopupMenu, invokePopupMenu, moveMouseIgnoringAnyError, moveMouseIgnoringAnyError, performAccessibleActionOf, pressAndReleaseKey, pressAndReleaseKey, pressAndReleaseKeys, pressKey, propertyName, releaseKey, requireDisabled, requireEnabled, requireEnabled, requireFocused, requireNotVisible, requireSize, requireVisible, rightClick, settings, waitForShowing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowDriver

public WindowDriver(Robot robot)
Creates a new WindowDriver.

Parameters:
robot - the robot to use to simulate user input.
Method Detail

resizeWidthTo

@RunsInEDT
public void resizeWidthTo(Window w,
                                    int width)
Resizes the Window horizontally.

Parameters:
w - the target Window.
width - the width that the Window should have after being resized.
Throws:
ActionFailedException - if the Window is not enabled.
ActionFailedException - if the Window is not resizable by the user.
ActionFailedException - if the Window is not showing on the screen.

resizeHeightTo

@RunsInEDT
public void resizeHeightTo(Window w,
                                     int height)
Resizes the Window vertically.

Parameters:
w - the target Window.
height - the height that the Window should have after being resized.
Throws:
ActionFailedException - if the Window is not enabled.
ActionFailedException - if the Window is not resizable by the user.
ActionFailedException - if the Window is not showing on the screen.

resizeTo

@RunsInEDT
public void resizeTo(Window w,
                               Dimension size)
Resizes the Window to the given size.

Parameters:
w - the target Window.
size - the size to resize the Window to.
Throws:
ActionFailedException - if the Window is not enabled.
ActionFailedException - if the Window is not resizable by the user.
ActionFailedException - if the Window is not showing on the screen.

moveTo

public void moveTo(Window w,
                   Point where)
Moves the Window to the given location.

Parameters:
w - the target Window.
where - the location to move the Window to.
Throws:
ActionFailedException - if the Window is not enabled.
ActionFailedException - if the Window is not movable by the user.
ActionFailedException - if the Window is not showing on the screen.

close

@RunsInEDT
public void close(Window w)
Closing the Window.

Parameters:
w - the target Window.
Throws:
ActionFailedException - if the Window is not enabled.
ActionFailedException - if the Window is not showing on the screen.

show

@RunsInEDT
public void show(Window w)
Shows the Window.

Parameters:
w - the target Window.

show

@RunsInEDT
public void show(Window w,
                           Dimension size)
Shows the Window, resized to the given size.

Parameters:
w - the target Window.
size - the size to resize the Window to.

moveToFront

@RunsInEDT
public void moveToFront(Window w)
If the given Window is visible, brings it to the front and may make it the focused one.

Parameters:
w - the target Window.

moveToBack

@RunsInEDT
public void moveToBack(Window w)
If the given Window is visible, sends it to the back and may cause it to lose focus or activation if it is the focused or active.

Parameters:
w - the target Window.


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