|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jubula.rc.swing.swing.implclasses.AbstractSwingImplClass
public abstract class AbstractSwingImplClass
Field Summary | |
---|---|
static char |
INDEX_LIST_SEP_CHAR
The default separator for enumerations of list values. |
protected static java.lang.String |
POS_UNI_PERCENT
constants for communication |
protected static java.lang.String |
POS_UNIT_PIXEL
constants for communication |
static java.lang.String |
RENDERER_FALLBACK_TEXT_GETTER_METHOD_1
RENDERER_FALLBACK_TEXT_GETTER_METHOD_1 |
static java.lang.String |
RENDERER_FALLBACK_TEXT_GETTER_METHOD_2
RENDERER_FALLBACK_TEXT_GETTER_METHOD_2 |
static char |
VALUE_SEPARATOR
The dafault separator of a list of values |
Constructor Summary | |
---|---|
AbstractSwingImplClass()
|
Method Summary | |
---|---|
void |
gdClick(int count,
int button)
Clicks the center of the component. |
void |
gdClickDirect(int count,
int button,
int xPos,
java.lang.String xUnits,
int yPos,
java.lang.String yUnits)
clicks into a component. |
void |
gdDrag(int mouseButton,
java.lang.String modifier,
int xPos,
java.lang.String xUnits,
int yPos,
java.lang.String yUnits)
Performs a Drag. |
void |
gdDrop(int xPos,
java.lang.String xUnits,
int yPos,
java.lang.String yUnits,
int delayBeforeDrop)
Performs a Drop. |
void |
gdPopupSelectByIndexPath(int xPos,
int yPos,
java.lang.String units,
java.lang.String indexPath)
Deprecated. Will be removed with gdPopupSelectByIndexPath with int parameter for MouseButton |
void |
gdPopupSelectByIndexPath(int xPos,
java.lang.String xUnits,
int yPos,
java.lang.String yUnits,
java.lang.String indexPath,
int button)
Opens the popup menu at the given position relative the current component and selects an item at the given position in the popup menu |
void |
gdPopupSelectByIndexPath(java.lang.String indexPath)
Deprecated. Will be removed with gdPopupSelectByIndexPath with int parameter for MouseButton |
void |
gdPopupSelectByIndexPath(java.lang.String indexPath,
int button)
Select an item in the popup menu |
void |
gdPopupSelectByTextPath(int xPos,
int yPos,
java.lang.String units,
java.lang.String textPath,
java.lang.String operator)
Deprecated. Will be removed with gdPopupSelectByTextPath with int parameter for MouseButton |
void |
gdPopupSelectByTextPath(int xPos,
java.lang.String xUnits,
int yPos,
java.lang.String yUnits,
java.lang.String textPath,
java.lang.String operator,
int button)
Selects an item in the popup menu |
void |
gdPopupSelectByTextPath(java.lang.String textPath,
java.lang.String operator)
Deprecated. Will be removed with gdPopupSelectByTextPath with int parameter for MouseButton |
void |
gdPopupSelectByTextPath(java.lang.String textPath,
java.lang.String operator,
int button)
Selects an item in the popup menu |
void |
gdPopupVerifyEnabledByIndexPath(int xPos,
java.lang.String xUnits,
int yPos,
java.lang.String yUnits,
java.lang.String indexPath,
boolean enabled,
int button)
Opens the popup menu at the given position relative the current component and checks if the specified context menu entry is enabled. |
void |
gdPopupVerifyEnabledByIndexPath(java.lang.String indexPath,
boolean enabled,
int button)
Checks if the specified context menu entry is enabled. |
void |
gdPopupVerifyEnabledByTextPath(int xPos,
java.lang.String xUnits,
int yPos,
java.lang.String yUnits,
java.lang.String textPath,
java.lang.String operator,
boolean enabled,
int button)
Opens the popup menu at the given position relative the current component and checks if the specified context menu entry is enabled. |
void |
gdPopupVerifyEnabledByTextPath(java.lang.String textPath,
java.lang.String operator,
boolean enabled,
int button)
Checks if the specified context menu entry is enabled. |
void |
gdPopupVerifyExistsByIndexPath(int xPos,
java.lang.String xUnits,
int yPos,
java.lang.String yUnits,
java.lang.String indexPath,
boolean exists,
int button)
Opens the popup menu at the given position relative the current component and checks if the specified context menu entry exists. |
void |
gdPopupVerifyExistsByIndexPath(java.lang.String indexPath,
boolean exists,
int button)
Checks if the specified context menu entry exists. |
void |
gdPopupVerifyExistsByTextPath(int xPos,
java.lang.String xUnits,
int yPos,
java.lang.String yUnits,
java.lang.String textPath,
java.lang.String operator,
boolean exists,
int button)
Opens the popup menu at the given position relative the current component and checks if the specified context menu entry exists. |
void |
gdPopupVerifyExistsByTextPath(java.lang.String textPath,
java.lang.String operator,
boolean exists,
int button)
Checks if the specified context menu entry exists. |
void |
gdPopupVerifySelectedByIndexPath(int xPos,
java.lang.String xUnits,
int yPos,
java.lang.String yUnits,
java.lang.String indexPath,
boolean selected,
int button)
Opens the popup menu at the given position relative the current component and checks if the specified context menu entry is selected. |
void |
gdPopupVerifySelectedByIndexPath(java.lang.String indexPath,
boolean selected,
int button)
Checks if the specified context menu entry is selected. |
void |
gdPopupVerifySelectedByTextPath(int xPos,
java.lang.String xUnits,
int yPos,
java.lang.String yUnits,
java.lang.String textPath,
java.lang.String operator,
boolean selected,
int button)
Opens the popup menu at the given position relative the current component and checks if the specified context menu entry is selected. |
void |
gdPopupVerifySelectedByTextPath(java.lang.String textPath,
java.lang.String operator,
boolean selected,
int button)
Checks if the specified context menu entry is selected. |
void |
gdShowText(java.lang.String text,
int textSize,
int timePerWord,
int windowWidth)
Simulates a tooltip for demonstration purposes. |
java.lang.String |
gdStorePropertyValue(java.lang.String variableName,
java.lang.String propertyName)
Stores the value of the property with the name name . |
void |
gdVerifyEnabled(boolean enabled)
Verifies the enabled property. |
void |
gdVerifyExists(boolean exists)
Verifies that the component exists and is visible. |
void |
gdVerifyFocus(boolean hasFocus)
Verifies if the component has the focus. |
void |
gdVerifyProperty(java.lang.String name,
java.lang.String value,
java.lang.String operator)
Verifies the value of the property with the name name . |
void |
gdWaitForComponent(int timeout,
int delay)
dummy method for "wait for component" |
protected org.eclipse.jubula.rc.common.driver.ClickOptions.ClickModifier |
getClickModifier(java.lang.String extendSelection)
|
abstract javax.swing.JComponent |
getComponent()
|
protected org.eclipse.jubula.rc.common.driver.IEventThreadQueuer |
getEventThreadQueuer()
|
static java.lang.String |
getRenderedText(java.awt.Component renderer)
|
protected java.lang.String |
getRenderedText(java.awt.Component renderer,
boolean queueInEventThread)
Casts the passed renderer component to a known type and extracts the rendered text. |
protected org.eclipse.jubula.rc.common.driver.IRobot |
getRobot()
Gets the IEventThreadQueuer. |
protected org.eclipse.jubula.rc.common.driver.IRobotFactory |
getRobotFactory()
Gets the Robot factory. |
protected abstract java.lang.String |
getText()
Get a String representation of the "text" of the component. |
protected boolean |
hasFocus()
|
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 |
protected void |
pressOrReleaseModifiers(java.lang.String modifier,
boolean press)
Presses or releases the given modifier. |
static java.lang.String |
resolveRenderedText(java.awt.Component renderer)
|
protected javax.swing.JPopupMenu |
showPopup(int button)
Shows and returns the popup menu |
protected void |
verify(boolean expected,
java.lang.String name,
org.eclipse.jubula.rc.common.driver.IRunnable runnable)
Checks wether two boolean values are equal. |
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 |
---|
getTextArrayFromComponent, setComponent |
Field Detail |
---|
public static final java.lang.String RENDERER_FALLBACK_TEXT_GETTER_METHOD_1
RENDERER_FALLBACK_TEXT_GETTER_METHOD_1
public static final java.lang.String RENDERER_FALLBACK_TEXT_GETTER_METHOD_2
RENDERER_FALLBACK_TEXT_GETTER_METHOD_2
public static final char INDEX_LIST_SEP_CHAR
public static final char VALUE_SEPARATOR
protected static final java.lang.String POS_UNIT_PIXEL
protected static final java.lang.String POS_UNI_PERCENT
Constructor Detail |
---|
public AbstractSwingImplClass()
Method Detail |
---|
public abstract javax.swing.JComponent getComponent()
IBaseImplementationClass.setComponent(Object)
protected org.eclipse.jubula.rc.common.driver.IRobotFactory getRobotFactory()
protected org.eclipse.jubula.rc.common.driver.IRobot getRobot() throws org.eclipse.jubula.rc.common.exception.RobotException
org.eclipse.jubula.rc.common.exception.RobotException
- If the Robot cannot be created.protected org.eclipse.jubula.rc.common.driver.IEventThreadQueuer getEventThreadQueuer()
protected void verify(boolean expected, java.lang.String name, org.eclipse.jubula.rc.common.driver.IRunnable runnable) throws org.eclipse.jubula.rc.common.exception.StepVerifyFailedException
runnable
.
expected
- The expected value.name
- The runnable name.runnable
- The runnable.
org.eclipse.jubula.rc.common.exception.StepVerifyFailedException
- If the values are not equal.public void highLight(java.awt.Component component, java.awt.Color border)
highLight
in interface IImplementationClass
component
- the component to high lightborder
- the color we want to highlight withpublic void lowLight(java.awt.Component component)
lowLight
in interface IImplementationClass
component
- the component to remove the 'hight light'public static java.lang.String getRenderedText(java.awt.Component renderer) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
renderer
- The component which is used as the renderer
org.eclipse.jubula.rc.common.exception.StepExecutionException
- If the renderer component is not of type JLabel
,
JToggleButton
, AbstractButton
,
JTextComponent
or supports one of the fallback
methodspublic static java.lang.String resolveRenderedText(java.awt.Component renderer)
renderer
- The component which is used as the renderer
null
if it
could not be resolved.protected java.lang.String getRenderedText(java.awt.Component renderer, boolean queueInEventThread) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
renderer
- The renderer.queueInEventThread
- If true
, the text extraction is executed in
the event queue thread.
org.eclipse.jubula.rc.common.exception.StepExecutionException
- If the passed renderer is not supported. Supported types are
JLabel
, JToggleButton
,
AbstractButton
and JTextComponent
protected abstract java.lang.String getText()
public void gdVerifyEnabled(boolean enabled)
enabled
property.
enabled
- The enabled
property value to verifypublic void gdVerifyExists(boolean exists)
exists
- True
if the component is expected to exist
and be visible, otherwise false
.public void gdVerifyFocus(boolean hasFocus)
hasFocus
- The hasFocus property to verify.public void gdVerifyProperty(java.lang.String name, java.lang.String value, java.lang.String operator)
name
.
The name of the property has be specified according to the JavaBean
specification. The value returned by the property is converted into a
string by calling toString()
and is compared to the passed
value
.
name
- The name of the propertyvalue
- The value of the property as a stringoperator
- The operator used to verifypublic java.lang.String gdStorePropertyValue(java.lang.String variableName, java.lang.String propertyName)
name
.
The name of the property has be specified according to the JavaBean
specification. The value returned by the property is converted into a
string by calling toString()
and is stored to the passed
variable.
variableName
- The name of the variable to store the property value inpropertyName
- The name of the property
public void gdClick(int count, int button)
count
- Number of mouse clicksbutton
- Pressed buttonpublic 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
count
- amount of clicksbutton
- what mouse button should be usedxPos
- what x positionxUnits
- should x position be pixel or percent valuesyPos
- what y positionyUnits
- should y position be pixel or percent values
org.eclipse.jubula.rc.common.exception.StepExecutionException
- errorpublic void gdPopupSelectByIndexPath(java.lang.String indexPath) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
indexPath
- path of item indices
org.eclipse.jubula.rc.common.exception.StepExecutionException
- errorpublic void gdPopupSelectByIndexPath(java.lang.String indexPath, int button) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
indexPath
- path of item indicesbutton
- MouseButton
org.eclipse.jubula.rc.common.exception.StepExecutionException
- errorpublic void gdPopupSelectByIndexPath(int xPos, int yPos, java.lang.String units, java.lang.String indexPath) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
xPos
- what x positionyPos
- what y positionunits
- should x,y position be pixel or percent valuesindexPath
- path of item indices
org.eclipse.jubula.rc.common.exception.StepExecutionException
- errorpublic void gdPopupSelectByIndexPath(int xPos, java.lang.String xUnits, int yPos, java.lang.String yUnits, java.lang.String indexPath, int button) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
xPos
- what x positionxUnits
- should x position be pixel or percent valuesyPos
- what y positionyUnits
- should y position be pixel or percent valuesindexPath
- path of item indicesbutton
- MouseButton
org.eclipse.jubula.rc.common.exception.StepExecutionException
- errorpublic void gdWaitForComponent(int timeout, int delay)
timeout
- the maximum amount of time to wait for the componentdelay
- the time to wait after the component is foundpublic void gdPopupSelectByTextPath(java.lang.String textPath, java.lang.String operator) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
textPath
- path of item textsoperator
- operator used for matching
org.eclipse.jubula.rc.common.exception.StepExecutionException
- errorpublic void gdPopupSelectByTextPath(java.lang.String textPath, java.lang.String operator, int button) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
textPath
- path of item textsoperator
- operator used for matchingbutton
- MouseButton
org.eclipse.jubula.rc.common.exception.StepExecutionException
- errorpublic void gdPopupSelectByTextPath(int xPos, int yPos, java.lang.String units, java.lang.String textPath, java.lang.String operator) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
xPos
- what x positionyPos
- what y positionunits
- should x,y position be pixel or percent valuestextPath
- path of item textsoperator
- operator used for matching
org.eclipse.jubula.rc.common.exception.StepExecutionException
- errorpublic void gdPopupSelectByTextPath(int xPos, java.lang.String xUnits, int yPos, java.lang.String yUnits, java.lang.String textPath, java.lang.String operator, int button) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
xPos
- what x positionxUnits
- should x position be pixel or percent valuesyPos
- what y positionyUnits
- should y position be pixel or percent valuestextPath
- path of item textsoperator
- operator used for matchingbutton
- MouseButton
org.eclipse.jubula.rc.common.exception.StepExecutionException
- errorpublic void gdPopupVerifyEnabledByIndexPath(java.lang.String indexPath, boolean enabled, int button) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
indexPath
- the menu item to verifyenabled
- for checking enabled or disabledbutton
- MouseButton
org.eclipse.jubula.rc.common.exception.StepExecutionException
public void gdPopupVerifyEnabledByIndexPath(int xPos, java.lang.String xUnits, int yPos, java.lang.String yUnits, java.lang.String indexPath, boolean enabled, int button) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
xPos
- what x positionxUnits
- should x position be pixel or percent valuesyPos
- what y positionyUnits
- should y position be pixel or percent valuesindexPath
- the menu item to verifyenabled
- for checking enabled or disabledbutton
- MouseButton
org.eclipse.jubula.rc.common.exception.StepExecutionException
public void gdPopupVerifyEnabledByTextPath(java.lang.String textPath, java.lang.String operator, boolean enabled, int button) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
textPath
- the menu item to verifyoperator
- operator used for matchingenabled
- for checking enabled or disabledbutton
- MouseButton
org.eclipse.jubula.rc.common.exception.StepExecutionException
public void gdPopupVerifyEnabledByTextPath(int xPos, java.lang.String xUnits, int yPos, java.lang.String yUnits, java.lang.String textPath, java.lang.String operator, boolean enabled, int button) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
xPos
- what x positionxUnits
- should x position be pixel or percent valuesyPos
- what y positionyUnits
- should y position be pixel or percent valuestextPath
- the menu item to verifyoperator
- operator used for matchingenabled
- for checking enabled or disabledbutton
- MouseButton
org.eclipse.jubula.rc.common.exception.StepExecutionException
public void gdPopupVerifyExistsByIndexPath(java.lang.String indexPath, boolean exists, int button) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
indexPath
- the menu item to verifyexists
- for checking if entry existsbutton
- MouseButton
org.eclipse.jubula.rc.common.exception.StepExecutionException
public void gdPopupVerifyExistsByIndexPath(int xPos, java.lang.String xUnits, int yPos, java.lang.String yUnits, java.lang.String indexPath, boolean exists, int button) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
xPos
- what x positionxUnits
- should x position be pixel or percent valuesyPos
- what y positionyUnits
- should y position be pixel or percent valuesindexPath
- the menu item to verifyexists
- for checking if entry existsbutton
- MouseButton
org.eclipse.jubula.rc.common.exception.StepExecutionException
public void gdPopupVerifyExistsByTextPath(java.lang.String textPath, java.lang.String operator, boolean exists, int button) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
textPath
- the menu item to verifyoperator
- operator used for matchingexists
- for checking if entry existsbutton
- MouseButton
org.eclipse.jubula.rc.common.exception.StepExecutionException
public void gdPopupVerifyExistsByTextPath(int xPos, java.lang.String xUnits, int yPos, java.lang.String yUnits, java.lang.String textPath, java.lang.String operator, boolean exists, int button) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
xPos
- what x positionxUnits
- should x position be pixel or percent valuesyPos
- what y positionyUnits
- should y position be pixel or percent valuestextPath
- the menu item to verifyoperator
- operator used for matchingexists
- for checking if entry existsbutton
- MouseButton
org.eclipse.jubula.rc.common.exception.StepExecutionException
public void gdPopupVerifySelectedByIndexPath(java.lang.String indexPath, boolean selected, int button) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
indexPath
- the menu item to verifyselected
- for checking if entry is selectedbutton
- MouseButton
org.eclipse.jubula.rc.common.exception.StepExecutionException
public void gdPopupVerifySelectedByIndexPath(int xPos, java.lang.String xUnits, int yPos, java.lang.String yUnits, java.lang.String indexPath, boolean selected, int button) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
xPos
- what x positionxUnits
- should x position be pixel or percent valuesyPos
- what y positionyUnits
- should y position be pixel or percent valuesindexPath
- the menu item to verifyselected
- for checking if entry is selectedbutton
- MouseButton
org.eclipse.jubula.rc.common.exception.StepExecutionException
public void gdPopupVerifySelectedByTextPath(java.lang.String textPath, java.lang.String operator, boolean selected, int button) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
textPath
- the menu item to verifyoperator
- operator used for matchingselected
- for checking if entry is selectedbutton
- MouseButton
org.eclipse.jubula.rc.common.exception.StepExecutionException
public void gdPopupVerifySelectedByTextPath(int xPos, java.lang.String xUnits, int yPos, java.lang.String yUnits, java.lang.String textPath, java.lang.String operator, boolean selected, int button) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
xPos
- what x positionxUnits
- should x position be pixel or percent valuesyPos
- what y positionyUnits
- should y position be pixel or percent valuestextPath
- the menu item to verifyoperator
- operator used for matchingselected
- for checking if entry is selectedbutton
- MouseButton
org.eclipse.jubula.rc.common.exception.StepExecutionException
protected javax.swing.JPopupMenu showPopup(int button)
button
- MouseButton
protected boolean hasFocus()
true
if the component is the focusownerpublic void gdShowText(java.lang.String text, int textSize, int timePerWord, int windowWidth)
text
- The text to show in the tooltiptextSize
- The size of the text in pointstimePerWord
- The amount of time, in milliseconds, used to display a
single word. A word is defined as a string surrounded
by whitespace.windowWidth
- The width of the tooltip window in pixels.public void gdDrag(int mouseButton, java.lang.String modifier, int xPos, java.lang.String xUnits, int yPos, java.lang.String yUnits)
mouseButton
- the mouse button.modifier
- the modifier, e.g. shift, ctrl, etc.xPos
- what x positionxUnits
- should x position be pixel or percent valuesyPos
- what y positionyUnits
- should y position be pixel or percent valuespublic void gdDrop(int xPos, java.lang.String xUnits, int yPos, java.lang.String yUnits, int delayBeforeDrop)
xPos
- what x positionxUnits
- should x position be pixel or percent valuesyPos
- what y positionyUnits
- should y position be pixel or percent valuesdelayBeforeDrop
- the amount of time (in milliseconds) to wait
between moving the mouse to the drop point and
releasing the mouse buttonprotected void pressOrReleaseModifiers(java.lang.String modifier, boolean press)
modifier
- the modifier.press
- if true, the modifier will be pressed.
if false, the modifier will be released.protected org.eclipse.jubula.rc.common.driver.ClickOptions.ClickModifier getClickModifier(java.lang.String extendSelection)
extendSelection
- the string to indicate that the selection should be extended
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |