public class JWAutomate
extends java.lang.Object
Constructor and Description |
---|
JWAutomate() |
Modifier and Type | Method and Description |
---|---|
static java.awt.image.BufferedImage |
capture(java.awt.Component comp,
boolean shadow)
Dump a screenshot of one component as a PNG image, including a small drop shadow
|
static void |
deselectJTable(java.awt.Component parent)
Remove all selections in the first JTable found inside the component
|
static void |
dumpScreenshots(java.awt.Component[] parent,
java.io.File html,
boolean visibleOnly,
java.lang.Class[] ignoreList)
Create PNG screenshots for all components within the specified component (including the component itself)
and create an HTML file listing all of them for easy perusal.
|
static java.util.ArrayList<javax.swing.JComponent> |
findAll(java.awt.Component parent,
java.lang.Class type)
Find all visible components of this type inside the parent component hierarchy
|
static java.util.ArrayList<javax.swing.JComponent> |
findAll(java.awt.Component parent,
java.lang.String text,
java.lang.Class type)
Find all visible components of this type which contain the specified text (case insensitive)
|
static java.util.ArrayList<javax.swing.JComponent> |
findAllTT(java.awt.Component parent,
java.lang.String text,
java.lang.Class type)
Find all visible components of this type which contain the specified text (case insensitive)
in its ToolTip
|
static java.util.ArrayList<javax.swing.JComponent> |
findEverything(java.awt.Component c) |
static void |
findEverything(java.awt.Component c,
java.util.ArrayList<javax.swing.JComponent> list) |
static javax.swing.JComponent |
findFirst(java.awt.Component parent,
java.lang.Class type)
Find the first visible component of this type inside the parent component hierarchy
|
static javax.swing.JComponent |
findFirst(java.awt.Component parent,
java.lang.String text,
java.lang.Class type)
Find the first visible component of this type which contains the specified text (case insensitive)
|
static javax.swing.JComponent |
findFirstTT(java.awt.Component parent,
java.lang.String text,
java.lang.Class type)
Find the first visible component of this type which contains the specified text (case insensitive)
in its ToolTip
|
static int |
getJTableSize(java.awt.Component parent)
Get the row count of the first JTable found inside the component
|
static int |
getListSize(java.awt.Component parent)
Get the size of the first JList found inside the component
|
static void |
hitButton(java.awt.Component parent,
java.lang.String text)
Click the first AbstractButton (JButton, JToggleButton etc) found inside the component
which contains the specified text
|
static void |
hitButtonTT(java.awt.Component parent,
java.lang.String text)
Click the first AbstractButton (JButton, JToggleButton etc) found inside the component
which contains the specified text in its ToolTip
|
static void |
hitJTable(java.awt.Component parent)
Select the first row in the first JTable found inside the component
|
static void |
hitList(java.awt.Component parent)
Click the first list entry in the first JList found inside the component
|
static void |
hitList(java.awt.Component parent,
java.lang.String text)
Click the list entry which contains the specified text in the first JList found inside the component
|
static void |
hitMenu(java.awt.Component parent,
java.lang.String text)
Click the menu item which contains the specified text in the first JMenu found inside the component
|
static java.awt.Component |
hitTab(java.awt.Component parent,
java.lang.String text)
Click the tab which contains the specified text in the first JTabbedPane found inside the component
|
static void |
layoutComponent(java.awt.Component c) |
static void |
nextJTable(java.awt.Component parent)
Select the next row in the first JTable found inside the component
|
static void |
nextList(java.awt.Component parent)
Click the next list entry in the first JList found inside the component
|
static boolean |
scrollDownPage(java.awt.Component parent)
Scroll down one page (visible extent) in the first JScrollPane found inside the component
|
static boolean |
scrollUpPage(java.awt.Component parent)
Scroll up one page (visible extent) in the first JScrollPane found inside the component
|
static void |
sleep(long millis)
Sleeps without throwing an InterruptedException
|
static void |
sleepMins(double mins)
Sleeps without throwing an InterruptedException
|
public static void dumpScreenshots(java.awt.Component[] parent, java.io.File html, boolean visibleOnly, java.lang.Class[] ignoreList) throws java.io.FileNotFoundException, java.io.IOException
parent
- html
- visibleOnly
- java.io.FileNotFoundException
java.io.IOException
public static void layoutComponent(java.awt.Component c)
public static java.awt.image.BufferedImage capture(java.awt.Component comp, boolean shadow)
comp
- public static javax.swing.JComponent findFirst(java.awt.Component parent, java.lang.Class type)
parent
- the parent component to search in, this can also be a matchtype
- the class of the component to match, for example AbstractButton.class or JTable.classpublic static java.util.ArrayList<javax.swing.JComponent> findAll(java.awt.Component parent, java.lang.Class type)
parent
- the parent component to search in, this can also be a matchtype
- the class of the component to match, for example AbstractButton.class or JTable.classpublic static javax.swing.JComponent findFirst(java.awt.Component parent, java.lang.String text, java.lang.Class type)
parent
- the parent component to search in, this can also be a matchtype
- the class of the component to match, for example AbstractButton.class or JTable.classpublic static javax.swing.JComponent findFirstTT(java.awt.Component parent, java.lang.String text, java.lang.Class type)
parent
- the parent component to search in, this can also be a matchtype
- the class of the component to match, for example AbstractButton.class or JTable.classpublic static java.util.ArrayList<javax.swing.JComponent> findAll(java.awt.Component parent, java.lang.String text, java.lang.Class type)
parent
- the parent component to search in, this can also be a matchtype
- the class of the component to match, for example AbstractButton.class or JTable.classpublic static java.util.ArrayList<javax.swing.JComponent> findAllTT(java.awt.Component parent, java.lang.String text, java.lang.Class type)
parent
- the parent component to search in, this can also be a matchtype
- the class of the component to match, for example AbstractButton.class or JTable.classpublic static void deselectJTable(java.awt.Component parent)
parent
- the JTable or container of a JTablepublic static void hitJTable(java.awt.Component parent)
parent
- the JTable or container of a JTablepublic static int getJTableSize(java.awt.Component parent)
parent
- the JTable or container of a JTablepublic static void nextJTable(java.awt.Component parent)
parent
- the JTable or container of a JTablepublic static boolean scrollDownPage(java.awt.Component parent)
parent
- the ScrollPane or container of a ScrollPanepublic static boolean scrollUpPage(java.awt.Component parent)
parent
- the ScrollPane or container of a ScrollPanepublic static void hitButton(java.awt.Component parent, java.lang.String text)
parent
- the AbstractButton or container of a AbstractButtontext
- the text to match in the button textpublic static void hitButtonTT(java.awt.Component parent, java.lang.String text)
parent
- the AbstractButton or container of a AbstractButtontext
- the text to match in the button textpublic static void sleep(long millis)
public static void sleepMins(double mins)
public static java.awt.Component hitTab(java.awt.Component parent, java.lang.String text)
parent
- the JTabbedPane or container of a JTabbedPanetext
- the text to match in the tab textpublic static void hitMenu(java.awt.Component parent, java.lang.String text)
parent
- the JMenu or container of a JMenutext
- the text to match in the menu item textpublic static void hitList(java.awt.Component parent)
parent
- the JList or container of a JListpublic static int getListSize(java.awt.Component parent)
parent
- the JList or container of a JListpublic static void nextList(java.awt.Component parent)
parent
- the JList or container of a JListpublic static void hitList(java.awt.Component parent, java.lang.String text)
parent
- the JList or container of a JListtext
- the text to match in the tab textpublic static java.util.ArrayList<javax.swing.JComponent> findEverything(java.awt.Component c)
public static void findEverything(java.awt.Component c, java.util.ArrayList<javax.swing.JComponent> list)