org.fest.swing.driver
Class JTabbedPaneLocation

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

public class JTabbedPaneLocation
extends Object

Understands a location on a JTabbedPane (notably a tab).

Author:
Alex Ruiz, Yvonne Wang

Constructor Summary
JTabbedPaneLocation()
           
 
Method Summary
 int indexOf(JTabbedPane tabbedPane, String title)
          Returns the index of the first tab that matches the given String.
 int indexOf(JTabbedPane tabbedPane, TextMatcher matcher)
          Returns the index of the first tab whose title matches the value in the given TextMatcher.
 Point pointAt(JTabbedPane tabbedPane, int index)
          Returns the coordinates of the tab under the given index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JTabbedPaneLocation

public JTabbedPaneLocation()
Method Detail

indexOf

@RunsInCurrentThread
public int indexOf(JTabbedPane tabbedPane,
                                       String title)
Returns the index of the first tab that matches the given String.

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:
tabbedPane - the target JTabbedPane.
title - the title to match.
Returns:
the index of the first tab that matches the given String.
Throws:
LocationUnavailableException - if a tab matching the given title could not be found.

indexOf

@RunsInCurrentThread
public int indexOf(JTabbedPane tabbedPane,
                                       TextMatcher matcher)
Returns the index of the first tab whose title 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:
tabbedPane - the target JTabbedPane.
matcher - indicates if the text of the JTabbedPane matches the value we are looking for.
Returns:
the index of the first tab that matches the given String.
Throws:
LocationUnavailableException - if a tab matching the given title could not be found.

pointAt

@RunsInCurrentThread
public Point pointAt(JTabbedPane tabbedPane,
                                         int index)
Returns the coordinates of the tab 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:
tabbedPane - the target JTabbedPane.
index - the given index.
Returns:
the coordinates of the tab under the given index.
Throws:
IndexOutOfBoundsException - if the given index is negative or out of bounds.
LocationUnavailableException - if the tab under the given index is not visible.


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