org.assertj.swing.driver
Class BasicJComboBoxCellReader

java.lang.Object
  extended by org.assertj.swing.driver.BasicJComboBoxCellReader
All Implemented Interfaces:
JComboBoxCellReader

public class BasicJComboBoxCellReader
extends Object
implements JComboBoxCellReader

Default implementation of JComboBoxCellReader.

Author:
Alex Ruiz, Yvonne Wang

Constructor Summary
BasicJComboBoxCellReader()
          Creates a new BasicJComboBoxCellReader that uses a BasicCellRendererReader to read the value from the cell renderer Component in a JComboBox.
BasicJComboBoxCellReader(CellRendererReader rendererReader)
          Creates a new BasicJComboBoxCellReader.
 
Method Summary
 String valueAt(JComboBox comboBox, int index)
           Returns the internal value of a cell in a JComboBox as expected in a test.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicJComboBoxCellReader

public BasicJComboBoxCellReader()
Creates a new BasicJComboBoxCellReader that uses a BasicCellRendererReader to read the value from the cell renderer Component in a JComboBox.


BasicJComboBoxCellReader

public BasicJComboBoxCellReader(@Nonnull
                                CellRendererReader rendererReader)
Creates a new BasicJComboBoxCellReader.

Parameters:
rendererReader - knows how to read values from the cell renderer Component in a JComboBox.
Throws:
NullPointerException - if the given CellRendererReader is null.
Method Detail

valueAt

@RunsInCurrentThread
@Nullable
public String valueAt(@Nonnull
                                                   JComboBox comboBox,
                                                   int index)

Returns the internal value of a cell in a JComboBox as expected in a test.

Note: This method is accessed in the current executing thread. Such thread may or may not be the event dispatch thread (EDT.) Client code must call this method from the EDT.

Specified by:
valueAt in interface JComboBoxCellReader
Parameters:
comboBox - the given JComboBox.
index - the index of the cell.
Returns:
the internal value of a cell in a JComboBox as expected in a test.
See Also:
CellRendererReader.valueFrom(Component)


Copyright © 2014–2015 AssertJ. All rights reserved.