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

java.lang.Object
  extended by org.eclipse.jubula.rc.swing.swing.implclasses.AbstractSwingImplClass
      extended by org.eclipse.jubula.rc.swing.swing.implclasses.AbstractButtonImplClass
All Implemented Interfaces:
org.eclipse.jubula.rc.common.implclasses.IBaseImplementationClass, IImplementationClass
Direct Known Subclasses:
JButtonImplClass, JCheckBoxImplClass, JRadioButtonImplClass

public class AbstractButtonImplClass
extends AbstractSwingImplClass

The implementation class for AbstractButton and subclasses. Note the "Abstract" in the class name implies only that this class can test AbstractButton components. The class itself should NOT be designated abstract, as this class is instantiated using reflection.

Created:
22.09.2004

Field Summary
 
Fields inherited from class org.eclipse.jubula.rc.swing.swing.implclasses.AbstractSwingImplClass
INDEX_LIST_SEP_CHAR, POS_UNI_PERCENT, POS_UNIT_PIXEL, RENDERER_FALLBACK_TEXT_GETTER_METHOD_1, RENDERER_FALLBACK_TEXT_GETTER_METHOD_2, VALUE_SEPARATOR
 
Constructor Summary
AbstractButtonImplClass()
           
 
Method Summary
 void gdClick(int count)
          Clicks the button count times.
 java.lang.String gdReadValue(java.lang.String variable)
          Action to read the value of a JButton to store it in a variable in the Client
 void gdVerifyEnabled(boolean enabled)
          Verifies the enabled property.
 void gdVerifySelected(boolean selected)
          Verifies the selected property.
 void gdVerifyText(java.lang.String text)
          Verifies the passed text.
 void gdVerifyText(java.lang.String text, java.lang.String operator)
          Verifies the passed text.
 javax.swing.JComponent getComponent()
           
protected  java.lang.String getText()
          Get a String representation of the "text" of the component.
 java.lang.String[] getTextArrayFromComponent()
          Returns a descriptive text array that represents the given gui component.
 void setComponent(java.lang.Object graphicsComponent)
          Set the component the methods this implementation class implements have to work with.
 
Methods inherited from class org.eclipse.jubula.rc.swing.swing.implclasses.AbstractSwingImplClass
gdClick, gdClickDirect, gdDrag, gdDrop, gdPopupSelectByIndexPath, gdPopupSelectByIndexPath, gdPopupSelectByIndexPath, gdPopupSelectByIndexPath, gdPopupSelectByTextPath, gdPopupSelectByTextPath, gdPopupSelectByTextPath, gdPopupSelectByTextPath, gdPopupVerifyEnabledByIndexPath, gdPopupVerifyEnabledByIndexPath, gdPopupVerifyEnabledByTextPath, gdPopupVerifyEnabledByTextPath, gdPopupVerifyExistsByIndexPath, gdPopupVerifyExistsByIndexPath, gdPopupVerifyExistsByTextPath, gdPopupVerifyExistsByTextPath, gdPopupVerifySelectedByIndexPath, gdPopupVerifySelectedByIndexPath, gdPopupVerifySelectedByTextPath, gdPopupVerifySelectedByTextPath, gdShowText, gdStorePropertyValue, gdVerifyExists, gdVerifyFocus, gdVerifyProperty, gdWaitForComponent, getClickModifier, getEventThreadQueuer, getRenderedText, getRenderedText, getRobot, getRobotFactory, hasFocus, highLight, lowLight, pressOrReleaseModifiers, resolveRenderedText, showPopup, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractButtonImplClass

public AbstractButtonImplClass()
Method Detail

setComponent

public void setComponent(java.lang.Object graphicsComponent)
Set the component the methods this implementation class implements have to work with.
The methods are declared by the configuration file for supported components.

Parameters:
graphicsComponent - the component from the AUT
Notice: Every changes made to control affects the AUT.

getComponent

public javax.swing.JComponent getComponent()
Specified by:
getComponent in class AbstractSwingImplClass
Returns:
Returns the button.

gdClick

public void gdClick(int count)
Clicks the button count times.

Parameters:
count - The number of clicks

gdVerifySelected

public void gdVerifySelected(boolean selected)
Verifies the selected property.

Parameters:
selected - The selected property value to verify.

gdVerifyText

public void gdVerifyText(java.lang.String text,
                         java.lang.String operator)
Verifies the passed text.

Parameters:
text - The text to verify
operator - The RegEx operator used to verify

gdVerifyText

public void gdVerifyText(java.lang.String text)
Verifies the passed text.

Parameters:
text - The text to verify

gdVerifyEnabled

public void gdVerifyEnabled(boolean enabled)
Verifies the enabled property.

Overrides:
gdVerifyEnabled in class AbstractSwingImplClass
Parameters:
enabled - The enabled property value to verify

gdReadValue

public java.lang.String gdReadValue(java.lang.String variable)
Action to read the value of a JButton to store it in a variable in the Client

Parameters:
variable - the name of the variable
Returns:
the text value.

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.

Returns:
array containing none, one or many texts representing the
gui component or null

getText

protected java.lang.String getText()
Description copied from class: AbstractSwingImplClass
Get a String representation of the "text" of the component. This String is used in all compare actions and all other places where a simple "as text" view is needed. This has to be replaced either with simple getText() calls on the components or by calls to the cell (or other) renderers of the component using getRenderedText()

Specified by:
getText in class AbstractSwingImplClass
Returns:
AbstractButton.getText() value
See Also:
AbstractSwingImplClass.getText()