org.eclipse.jubula.rc.swing.swing.implclasses
Class SwingApplicationImplClass

java.lang.Object
  extended by org.eclipse.jubula.rc.common.implclasses.AbstractApplicationImplClass
      extended by org.eclipse.jubula.rc.swing.swing.implclasses.SwingApplicationImplClass
All Implemented Interfaces:
org.eclipse.jubula.rc.common.implclasses.IBaseImplementationClass, IImplementationClass

public class SwingApplicationImplClass
extends org.eclipse.jubula.rc.common.implclasses.AbstractApplicationImplClass
implements IImplementationClass

Implementation class for general application-wide operations. The class is mapped to a dummy component GraphicApplication.

Created:
03.06.2005

Field Summary
 
Fields inherited from class org.eclipse.jubula.rc.common.implclasses.AbstractApplicationImplClass
OVERWRITE, RENAME
 
Constructor Summary
SwingApplicationImplClass()
           
 
Method Summary
 void gdActivate(java.lang.String method)
          activate the AUT
 void gdCheckExistenceOfWindow(java.lang.String title, java.lang.String operator, boolean exists)
          Checks for the existence of a window with the given title
 void gdClickDirect(int count, int button, int xPos, java.lang.String xUnits, int yPos, java.lang.String yUnits)
          clicks into the active window.
 void gdInputText(java.lang.String text)
           
 void gdKeyStroke(java.lang.String modifierSpec, java.lang.String keySpec)
          perform a keystroke specified according string representation of a keystroke ,
 void gdKeyType(int keyCode)
          Just a server side method, not useable as action.
 void gdReplaceText(java.lang.String text)
          Deprecated. Removed without substitution: Testcases with this action are fragile, because this action assumes the availabality of a text component. Any other case breaks the test.
 void gdToggle(int key, boolean activated)
          Just a server side method, not useable as action.
 void gdWaitForWindow(java.lang.String title, java.lang.String operator, int pTimeout, int delay)
          Waits timeMillSec if the application opens a window with the given title.
 void gdWaitForWindowActivation(java.lang.String title, java.lang.String operator, int pTimeout, int delay)
          Waits timeMillSec if the application activates a window with the given title.
 void gdWaitForWindowToClose(java.lang.String title, java.lang.String operator, int pTimeout, int delay)
          Waits timeMillSec if the application closes (or hides) a window with the given title.
 java.awt.Rectangle getActiveWindowBounds()
          
 int getKeyCode(java.lang.String keyCodeName)
           
protected  org.eclipse.jubula.rc.common.driver.IRobot getRobot()
          
 java.lang.String[] getTextArrayFromComponent()
          Returns a descriptive text array that represents the given gui component.
 void highLight(java.awt.Component component, java.awt.Color border)
          High light the given component, called during object mapping
 void lowLight(java.awt.Component component)
          Low light the given component, called during object mapping
 
Methods inherited from class org.eclipse.jubula.rc.common.implclasses.AbstractApplicationImplClass
gdCheckStringValues, gdCheckValues, gdCopyToClipboard, gdExecuteExternalCommand, gdManualTestStep, gdNativeInputText, gdNativeKeyStroke, gdPause, gdReadTimer, gdRestart, gdSetValue, gdStartTimer, gdTakeScreenshot, gdTakeScreenshotOfActiveWindow, gdWait, setComponent, takeScreenshot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jubula.rc.common.implclasses.IBaseImplementationClass
setComponent
 

Constructor Detail

SwingApplicationImplClass

public SwingApplicationImplClass()
Method Detail

getRobot

protected org.eclipse.jubula.rc.common.driver.IRobot getRobot()

Specified by:
getRobot in class org.eclipse.jubula.rc.common.implclasses.AbstractApplicationImplClass
Returns:
The Robot instance

highLight

public void highLight(java.awt.Component component,
                      java.awt.Color border)
High light the given component, called during object mapping

Specified by:
highLight in interface IImplementationClass
Parameters:
component - the component to high light
border - the color we want to highlight with

lowLight

public void lowLight(java.awt.Component component)
Low light the given component, called during object mapping

Specified by:
lowLight in interface IImplementationClass
Parameters:
component - the component to remove the 'hight light'

gdKeyStroke

public void gdKeyStroke(java.lang.String modifierSpec,
                        java.lang.String keySpec)
perform a keystroke specified according string representation of a keystroke ,

Parameters:
modifierSpec - the string representation of the modifiers
keySpec - the string representation of the key

gdCheckExistenceOfWindow

public void gdCheckExistenceOfWindow(java.lang.String title,
                                     java.lang.String operator,
                                     boolean exists)
Checks for the existence of a window with the given title

Parameters:
title - the title
operator - the comparing operator
exists - True if the window is expected to exist and be visible, otherwise false.

gdWaitForWindow

public void gdWaitForWindow(java.lang.String title,
                            java.lang.String operator,
                            int pTimeout,
                            int delay)
Waits timeMillSec if the application opens a window with the given title.

Parameters:
title - the title
operator - the comparing operator
pTimeout - the time in ms
delay - delay after the window is shown

gdWaitForWindowActivation

public void gdWaitForWindowActivation(java.lang.String title,
                                      java.lang.String operator,
                                      int pTimeout,
                                      int delay)
Waits timeMillSec if the application activates a window with the given title.

Parameters:
title - the title
operator - the comparing operator
pTimeout - the time in ms
delay - delay after the window is activated

gdWaitForWindowToClose

public void gdWaitForWindowToClose(java.lang.String title,
                                   java.lang.String operator,
                                   int pTimeout,
                                   int delay)
Waits timeMillSec if the application closes (or hides) a window with the given title. If no window with the given title can be found, then it is assumed that the window has already closed.

Parameters:
title - the title
operator - the comparing operator
pTimeout - the time in ms
delay - delay after the window is closed

getKeyCode

public int getKeyCode(java.lang.String keyCodeName)
               throws org.eclipse.jubula.rc.common.exception.StepExecutionException
Parameters:
keyCodeName - The name of a key code, e.g. TAB for a tabulator key code
Returns:
The key code or -1, if the key code name doesn't exist in the KeyEvent class
Throws:
org.eclipse.jubula.rc.common.exception.StepExecutionException - If the key code name cannot be converted to a key code due to the reflection call

gdKeyType

public void gdKeyType(int keyCode)
Just a server side method, not useable as action.

Parameters:
keyCode - The key code

gdToggle

public void gdToggle(int key,
                     boolean activated)
Just a server side method, not useable as action. note : this action only works if application got focus, because using defaultToolkit does not work. You have to use component.getToolKit()s

Parameters:
key - to set numlock Num Lock 1 caplock Caps Lock 2 scolllock Scroll 3
activated - boolean

gdReplaceText

public void gdReplaceText(java.lang.String text)
Deprecated. Removed without substitution: Testcases with this action are fragile, because this action assumes the availabality of a text component. Any other case breaks the test.

Types text into the component. This replaces the shown content.

Parameters:
text - the text to type in

gdInputText

public void gdInputText(java.lang.String text)
Parameters:
text - text to type

gdActivate

public void gdActivate(java.lang.String method)
activate the AUT

Parameters:
method - activation method

gdClickDirect

public void gdClickDirect(int count,
                          int button,
                          int xPos,
                          java.lang.String xUnits,
                          int yPos,
                          java.lang.String yUnits)
                   throws org.eclipse.jubula.rc.common.exception.StepExecutionException
clicks into the active window.

Parameters:
count - amount of clicks
button - what mouse button should be used
xPos - what x position
xUnits - should x position be pixel or percent values
yPos - what y position
yUnits - should y position be pixel or percent values
Throws:
org.eclipse.jubula.rc.common.exception.StepExecutionException - error

getTextArrayFromComponent

public java.lang.String[] getTextArrayFromComponent()
Returns a descriptive text array that represents the given gui component.
Descriptive texts can be received for example from buttons, labels and table headers. If text is obviously data (for example in text input components) then it is not considered a descriptive text.
If the component has no descriptive text then null, an empty array or an array with length one and null or an empty string as content has to be returned.

Specified by:
getTextArrayFromComponent in interface org.eclipse.jubula.rc.common.implclasses.IBaseImplementationClass
Returns:
array containing none, one or many texts representing the
gui component or null

getActiveWindowBounds

public java.awt.Rectangle getActiveWindowBounds()

Specified by:
getActiveWindowBounds in class org.eclipse.jubula.rc.common.implclasses.AbstractApplicationImplClass
Returns:
an awt rectangle which represents the absolute active window bounds; may return null e.g. if no active window could be found