org.fest.swing.driver
Class JTableHeaderLocation

java.lang.Object
  extended by org.fest.swing.driver.JTableHeaderLocation

public class JTableHeaderLocation
extends Object

Understands the location of a JTableHeader (a coordinate, column index or value.)

Author:
Yvonne Wang, Alex Ruiz

Constructor Summary
JTableHeaderLocation()
           
 
Method Summary
 int indexOf(JTableHeader tableHeader, TextMatcher matcher)
          Returns the index of the column which name matches the value in the given TextMatcher, or -1 if a matching column was not found.
 Point pointAt(JTableHeader tableHeader, int index)
          Returns the coordinates of the column under the given index.
 Pair<Integer,Point> pointAt(JTableHeader tableHeader, TextMatcher matcher)
          Returns the index and the coordinates of the column which name matches the value in the given TextMatcher.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JTableHeaderLocation

public JTableHeaderLocation()
Method Detail

pointAt

@RunsInCurrentThread
public Pair<Integer,Point> pointAt(JTableHeader tableHeader,
                                                       TextMatcher matcher)
Returns the index and the coordinates of the column which name matches the value in the given TextMatcher.

Note: This method is not guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for calling this method from the EDT.

Parameters:
tableHeader - the target JTableHeader.
matcher - indicates which is the matching column name.
Returns:
the index and the coordinates of the column under the given index.
Throws:
LocationUnavailableException - if a column with a matching value cannot be found.

pointAt

@RunsInCurrentThread
public Point pointAt(JTableHeader tableHeader,
                                         int index)
Returns the coordinates of the column under the given index.

Note: This method is not guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for calling this method from the EDT.

Parameters:
tableHeader - the target JTableHeader.
index - the given index.
Returns:
the coordinates of the column under the given index.
Throws:
IndexOutOfBoundsException - if the index is out of bounds.

indexOf

@RunsInCurrentThread
public int indexOf(JTableHeader tableHeader,
                                       TextMatcher matcher)
Returns the index of the column which name matches the value in the given TextMatcher, or -1 if a matching column was not found.

Note: This method is not guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for calling this method from the EDT.

Parameters:
tableHeader - the target JTableHeader.
matcher - indicates which is the matching column name.
Returns:
the index of a matching column or -1 if a matching column was not found.


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.