org.uispec4j
Class ComboBox

java.lang.Object
  extended by org.uispec4j.AbstractUIComponent
      extended by org.uispec4j.AbstractSwingUIComponent
          extended by org.uispec4j.ComboBox
All Implemented Interfaces:
TooltipComponent, UIComponent

public class ComboBox
extends AbstractSwingUIComponent

Wrapper for JComboBox components. This class provides means for checking the contents and selection of the comboBox, changing the selection, etc. For all these methods, when using String values, the means of retrieving a String representation of the displayed values can be customized using the setCellValueConverter(ListBoxCellValueConverter) method and providing a new ListBoxCellValueConverter implementation. A DefaultListBoxCellValueConverter is set up by default.


Field Summary
static java.lang.Class[] SWING_CLASSES
           
static java.lang.String TYPE_NAME
           
 
Constructor Summary
ComboBox(javax.swing.JComboBox combo)
           
 
Method Summary
 void click()
          Selects the first item in the list, if not empty
 Assertion contains(java.lang.String... items)
           
 Assertion contains(java.lang.String item)
           
 Assertion contentEquals(java.lang.String... expected)
           
 javax.swing.JComboBox getAwtComponent()
          Returns the Java GUI component represented by this object.
 java.lang.String getDescriptionTypeName()
          Returns the name of the component as it will appear in the XML representation returned by UIComponent.getDescription().
protected  void getSubDescription(java.awt.Container container, XmlWriter.Tag tag)
           
 Assertion isEditable()
           
 Assertion isEmpty(java.lang.String displayedValue)
          Checks that the combo box displays the given value and that it shows no elements when expanded.
 void select(java.lang.String value)
           
 Assertion selectionEquals(java.lang.String selection)
           
 void setCellValueConverter(ListBoxCellValueConverter cellValueConverter)
           
 void setText(java.lang.String text)
          Changes the displayed text, in case of an editable combo box.
 
Methods inherited from class org.uispec4j.AbstractSwingUIComponent
tooltipContains, tooltipEquals
 
Methods inherited from class org.uispec4j.AbstractUIComponent
addAttributes, backgroundEquals, backgroundNear, foregroundEquals, foregroundNear, getContainer, getContainer, getDescription, getDescription, getLabel, getName, isEnabled, isVisible, pressKey, releaseKey, typeKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_NAME

public static final java.lang.String TYPE_NAME
See Also:
Constant Field Values

SWING_CLASSES

public static final java.lang.Class[] SWING_CLASSES
Constructor Detail

ComboBox

public ComboBox(javax.swing.JComboBox combo)
Method Detail

getAwtComponent

public javax.swing.JComboBox getAwtComponent()
Description copied from interface: UIComponent
Returns the Java GUI component represented by this object.

Specified by:
getAwtComponent in interface UIComponent
Specified by:
getAwtComponent in class AbstractSwingUIComponent

getDescriptionTypeName

public java.lang.String getDescriptionTypeName()
Description copied from interface: UIComponent
Returns the name of the component as it will appear in the XML representation returned by UIComponent.getDescription().


setCellValueConverter

public void setCellValueConverter(ListBoxCellValueConverter cellValueConverter)

getSubDescription

protected void getSubDescription(java.awt.Container container,
                                 XmlWriter.Tag tag)
Overrides:
getSubDescription in class AbstractUIComponent

click

public void click()
Selects the first item in the list, if not empty


select

public void select(java.lang.String value)

setText

public void setText(java.lang.String text)
Changes the displayed text, in case of an editable combo box.

This method will throw an exception if the component is not editable.


contentEquals

public Assertion contentEquals(java.lang.String... expected)

contains

public Assertion contains(java.lang.String item)

contains

public Assertion contains(java.lang.String... items)

isEmpty

public Assertion isEmpty(java.lang.String displayedValue)
Checks that the combo box displays the given value and that it shows no elements when expanded.


selectionEquals

public Assertion selectionEquals(java.lang.String selection)

isEditable

public Assertion isEditable()


Copyright © 2004-2010. All Rights Reserved.