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

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

public class JComboBoxImplClass
extends AbstractSwingImplClass

The implementation class for JComboBox.

Created:
08.03.2005

Field Summary
static int NO_MAX_WIDTH
          INVALID_MAX_WIDTH
 
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
JComboBoxImplClass()
           
 
Method Summary
 void gdInputText(java.lang.String text)
          Sets the text into the combobox, by typing it into the textfield
 java.lang.String gdReadValue(java.lang.String variable)
          Action to read the value of a JComboBox to store it in a variable in the Client
 void gdReplaceText(java.lang.String text)
          Types text into the component.
 void gdSelectIndex(java.lang.String index)
          Selects index in the combobox.
 void gdSelectValue(java.lang.String valueList, java.lang.String operator, java.lang.String searchType)
          Selects a value from the list of the combobox
 void gdVerifyContainsValue(java.lang.String text)
          Checks if the component contains the specified text.
 void gdVerifyContainsValue(java.lang.String value, java.lang.String operator, boolean exists)
          Verifies if the list contains an element that renderes value.
 void gdVerifyEditable(boolean editable)
          Verifies the editable property.
 void gdVerifyFocus(boolean hasFocus)
          Verifies if the component has the focus.
 void gdVerifySelectedIndex(java.lang.String index, boolean isSelected)
          Verifies if the combobox has index selected.
 void gdVerifyText(java.lang.String text)
          Verifies if the passed text is currently selected in the combobox.
 void gdVerifyText(java.lang.String text, java.lang.String operator)
          Verifies if the passed text is currently selected in the combobox.
 JComboBoxHelper getComboBoxHelper()
          Gets the ComboBox helper.
 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, gdVerifyEnabled, gdVerifyExists, 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
 

Field Detail

NO_MAX_WIDTH

public static final int NO_MAX_WIDTH
INVALID_MAX_WIDTH

See Also:
Constant Field Values
Constructor Detail

JComboBoxImplClass

public JComboBoxImplClass()
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:
The component passed to the implementation class by calling IBaseImplementationClass.setComponent(Object)

getComboBoxHelper

public JComboBoxHelper getComboBoxHelper()
Gets the ComboBox helper. The helper is created once per instance.

Returns:
The ComboBox helper

gdVerifyEditable

public void gdVerifyEditable(boolean editable)
Verifies the editable property.

Parameters:
editable - The editable property to verify.

gdVerifySelectedIndex

public void gdVerifySelectedIndex(java.lang.String index,
                                  boolean isSelected)
Verifies if the combobox has index selected.

Parameters:
index - The index to verify
isSelected - If the index should be selected or not.

gdVerifyText

public void gdVerifyText(java.lang.String text,
                         java.lang.String operator)
Verifies if the passed text is currently selected in the combobox.

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

gdVerifyText

public void gdVerifyText(java.lang.String text)
Verifies if the passed text is currently selected in the combobox.

Parameters:
text - The text to verify.

gdVerifyContainsValue

public void gdVerifyContainsValue(java.lang.String text)
Checks if the component contains the specified text.

Parameters:
text - check if this text is in the combobox

gdVerifyContainsValue

public void gdVerifyContainsValue(java.lang.String value,
                                  java.lang.String operator,
                                  boolean exists)
Verifies if the list contains an element that renderes value.

Parameters:
value - The text to verify
operator - The operator used to verify
exists - If the value should exist or not.

gdReplaceText

public void gdReplaceText(java.lang.String text)
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)
Sets the text into the combobox, by typing it into the textfield

Parameters:
text - the text which should be typed in.

gdSelectIndex

public void gdSelectIndex(java.lang.String index)
Selects index in the combobox.

Parameters:
index - The index to select

gdSelectValue

public void gdSelectValue(java.lang.String valueList,
                          java.lang.String operator,
                          java.lang.String searchType)
Selects a value from the list of the combobox

Parameters:
valueList - The value or list of values to (not)select
operator - if regular expressions are used
searchType - Determines where the search begins ("relative" or "absolute")

gdReadValue

public java.lang.String gdReadValue(java.lang.String variable)
Action to read the value of a JComboBox 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:
value from ComboBoxHelper
See Also:
AbstractSwingImplClass.getText()

gdVerifyFocus

public void gdVerifyFocus(boolean hasFocus)
Verifies if the component has the focus.

Overrides:
gdVerifyFocus in class AbstractSwingImplClass
Parameters:
hasFocus - The hasFocus property to verify.