org.uispec4j
Class ListBox

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

public class ListBox
extends AbstractSwingUIComponent

Wrapper for JList components.

This class provides means for checking the contents and selection of the list, 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
ListBox(javax.swing.JList list)
           
 
Method Summary
 Assertion backgroundEquals(java.lang.Object[] colors)
          Checks the background color of the List cells using either Color or String objects
 Assertion backgroundNear(int index, java.lang.Object expected)
           
 void clearSelection()
           
 void click(int row)
           
 void click(int row, Key.Modifier modifier)
           
 Assertion contains(java.lang.String... items)
           
 Assertion contains(java.lang.String item)
           
 Assertion contentEquals(java.lang.String... displayedValues)
           
 void doubleClick()
           
 void doubleClick(int row)
           
 Assertion foregroundEquals(java.lang.Object[] colors)
          Checks the foreground color of the table cells using either Color or String objects
 Assertion foregroundNear(int index, java.lang.Object expected)
           
 javax.swing.JList 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().
 int getSize()
           
 java.awt.Component getSwingRendererComponentAt(int index)
           
 Assertion isEmpty()
           
 void rightClick(int row)
           
 void select(java.lang.String... values)
           
 void selectIndex(int index)
           
 void selectIndices(int... indices)
           
 Assertion selectionEquals(java.lang.String... items)
           
 Assertion selectionIsEmpty()
           
 void setCellValueConverter(ListBoxCellValueConverter cellValueConverter)
           
 Trigger triggerClick(int row, Key.Modifier modifier)
           
 Trigger triggerDoubleClick(int row)
           
 Trigger triggerRightClick(int row)
           
 
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, getSubDescription, 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

ListBox

public ListBox(javax.swing.JList list)
Method Detail

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().


getAwtComponent

public javax.swing.JList 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

setCellValueConverter

public void setCellValueConverter(ListBoxCellValueConverter cellValueConverter)

isEmpty

public Assertion isEmpty()

contentEquals

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

contains

public Assertion contains(java.lang.String item)

contains

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

selectIndex

public void selectIndex(int index)

selectIndices

public void selectIndices(int... indices)

select

public void select(java.lang.String... values)

clearSelection

public void clearSelection()

getSize

public int getSize()

doubleClick

public void doubleClick()

click

public void click(int row)

click

public void click(int row,
                  Key.Modifier modifier)

rightClick

public void rightClick(int row)

doubleClick

public void doubleClick(int row)

triggerClick

public Trigger triggerClick(int row,
                            Key.Modifier modifier)

triggerRightClick

public Trigger triggerRightClick(int row)

triggerDoubleClick

public Trigger triggerDoubleClick(int row)

selectionIsEmpty

public Assertion selectionIsEmpty()

selectionEquals

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

foregroundEquals

public Assertion foregroundEquals(java.lang.Object[] colors)
Checks the foreground color of the table cells using either Color or String objects

See Also:
Using colors

foregroundNear

public Assertion foregroundNear(int index,
                                java.lang.Object expected)

backgroundNear

public Assertion backgroundNear(int index,
                                java.lang.Object expected)

backgroundEquals

public Assertion backgroundEquals(java.lang.Object[] colors)
Checks the background color of the List cells using either Color or String objects

See Also:
Using colors

getSwingRendererComponentAt

public java.awt.Component getSwingRendererComponentAt(int index)


Copyright © 2004-2010. All Rights Reserved.