org.assertj.swing.driver
Class BasicJTreeCellReader

java.lang.Object
  extended by org.assertj.swing.driver.BasicJTreeCellReader
All Implemented Interfaces:
JTreeCellReader

public class BasicJTreeCellReader
extends Object
implements JTreeCellReader

Default implementation of JTreeCellReader.

Author:
Yvonne Wang, Alex Ruiz

Constructor Summary
BasicJTreeCellReader()
          Creates a new BasicJTreeCellReader that uses a BasicCellRendererReader to read the value from the cell renderer component in a JTree.
BasicJTreeCellReader(CellRendererReader reader)
          Creates a new BasicJTreeCellReader.
 
Method Summary
 String valueAt(JTree tree, Object modelValue)
           Returns the internal value of a cell in a JTree 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

BasicJTreeCellReader

public BasicJTreeCellReader()
Creates a new BasicJTreeCellReader that uses a BasicCellRendererReader to read the value from the cell renderer component in a JTree.


BasicJTreeCellReader

public BasicJTreeCellReader(@Nonnull
                            CellRendererReader reader)
Creates a new BasicJTreeCellReader.

Parameters:
reader - knows how to read values from the cell renderer component in a JTree.
Throws:
NullPointerException - if reader is null.
Method Detail

valueAt

@RunsInCurrentThread
@Nullable
public String valueAt(@Nonnull
                                                   JTree tree,
                                                   @Nullable
                                                   Object modelValue)

Returns the internal value of a cell in a JTree 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 JTreeCellReader
Parameters:
tree - the given JTree.
modelValue - the value of a cell, retrieved from the model.
Returns:
the internal value of a cell in a JTree as expected in a test.


Copyright © 2014–2015 AssertJ. All rights reserved.