abbot.tester
Class JListTester

java.lang.Object
  extended byabbot.tester.Robot
      extended byabbot.tester.ComponentTester
          extended byabbot.tester.ContainerTester
              extended byabbot.tester.JComponentTester
                  extended byabbot.tester.JListTester

public class JListTester
extends JComponentTester

Provide actions and assertions for a JList component. The JList substructure is a "row", and JListLocation provides different identifiers for a row.

Note that "row" is used in preference to "index", since it is closer to the concept of the actual user action (you select a "row" of a table, not an "index").


Field Summary
 
Fields inherited from class abbot.tester.Robot
BUTTON_MASK, componentDelay, defaultDelay, DRAG_THRESHOLD, EM_AWT, EM_ROBOT, MENU_SHORTCUT_KEYCODE, MENU_SHORTCUT_MASK, MENU_SHORTCUT_MODIFIER, MENU_SHORTCUT_STRING, MULTI_CLICK_INTERVAL, POPUP_MASK, POPUP_MODIFIER, POPUP_ON_PRESS, popupDelay, TERTIARY_MASK, TERTIARY_MODIFIER
 
Constructor Summary
JListTester()
           
 
Method Summary
 void actionClickIndex(Component list, int index)
          Deprecated. Use the ComponentLocation version instead.
 void actionClickIndex(Component list, int index, String modifiers)
          Deprecated. Use the ComponentLocation version instead.
 void actionClickIndex(Component c, int index, String modifiers, int count)
          Deprecated. Use the ComponentLocation version instead.
 void actionClickValue(Component list, String item)
          Deprecated. Use the ComponentLocation version instead.
 void actionClickValue(Component list, String item, String modifiers)
          Deprecated. Use the ComponentLocation version instead.
 void actionClickValue(Component list, String item, String modifiers, int count)
          Deprecated. Use the ComponentLocation version instead.
 void actionScrollRowToVisible(Component list, int index)
          Deprecated. Use the JListLocation version.
 void actionSelectIndex(Component c, int index)
          Select the given index.
 void actionSelectPopupMenuItemAtIndex(Component list, int index, String menuItem)
          Deprecated. Use the ComponentLocation version instead.
 void actionSelectPopupMenuItemAtValue(Component list, String item, String menuItem)
          Deprecated. Use the ComponentLocation version instead.
 void actionSelectRow(Component c, JListLocation location)
          Select the given row.
 void actionSelectValue(Component list, String item)
          Deprecated. Use the ComponentLocation version instead.
 void actionShowPopupMenuAtIndex(Component list, int index)
          Deprecated. Use the ComponentLocation version instead.
 void actionShowPopupMenuAtValue(Component list, String item)
          Deprecated. Use the ComponentLocation version instead.
 String[] getContents(JList list)
          Return an array of strings that represents the list's contents.
 Object getElementAt(JList list, int index)
          JList doesn't provide direct access to its contents, so make up for that oversight.
 ComponentLocation getLocation(Component c, Point p)
          Return the value, row, or coordinate location.
 int getSize(JList list)
          Return the size of the given list.
 ComponentLocation parseLocation(String encoded)
          Parse the String representation of a JListLocation into the actual JListLocation object.
static String valueToString(JList list, int index)
          Convert the value in the list at the given index into a reasonable string representation, or null if one can not be obtained.
 
Methods inherited from class abbot.tester.JComponentTester
actionActionMap, actionClick, actionClick, actionDrag, actionDrop, actionScrollToVisible, actionScrollToVisible, actionScrollToVisible, deriveTag, mousePress, scrollToVisible, scrollToVisible
 
Methods inherited from class abbot.tester.ComponentTester
actionClick, actionClick, actionClick, actionClick, actionClick, actionClick, actionClick, actionClick, actionClick, actionDelay, actionDrag, actionDrag, actionDrag, actionDrag, actionDrop, actionDrop, actionFocus, actionKeyPress, actionKeyPress, actionKeyPress, actionKeyPress, actionKeyRelease, actionKeyRelease, actionKeyRelease, actionKeyRelease, actionKeyString, actionKeyString, actionKeyStroke, actionKeyStroke, actionKeyStroke, actionKeyStroke, actionKeyStroke, actionKeyStroke, actionKeyStroke, actionKeyStroke, actionSelectAWTMenuItemByLabel, actionSelectAWTPopupMenuItemByLabel, actionSelectMenuItem, actionSelectPopupMenuItem, actionSelectPopupMenuItem, actionSelectPopupMenuItem, actionShowPopupMenu, actionShowPopupMenu, actionShowPopupMenu, actionWaitForIdle, assertComponentShowing, assertFrameShowing, assertImage, deriveAccessibleTag, getActions, getAssertMethods, getComponentActions, getComponentAssertMethods, getPropertyMethods, getTag, getTestedClass, getTester, getTester, isExtension, setTester, stripHTML, waitAction, waitForComponentShowing, waitForFrameShowing
 
Methods inherited from class abbot.tester.Robot
activate, canMoveWindows, canResizeWindows, capture, capture, capture, click, click, click, click, click, close, deiconify, delay, descriptiveClassName, drag, drag, dragOver, drop, findFocusOwner, fireAccessibleAction, focus, focus, getAutoDelay, getCanonicalClass, getCloseLocation, getEventID, getEventID, getEventMode, getEventModeDescription, getEventPostDelay, getEventQueue, getIconifyLocation, getKeyCode, getKeyCode, getKeyModifiers, getMaximizeLocation, getModifiers, getModifiers, getMouseModifiers, getMoveLocation, getPreferredRobotAutoDelay, getResizeLocation, hasFrameDeiconifyBug, hasHierarchyEventGenerationBug, hasKeyStrokeGenerationBug, hasMultiClickFrameBug, hasRobotMotionBug, iconify, invokeAction, invokeAction, invokeAndWait, invokeAndWait, isModifier, isReadyForInput, isTertiaryButton, jitter, jitter, key, key, keyCodeToMask, keyPress, keyRelease, keyString, keyStroke, maskToKeyCode, maximize, mouseMove, mouseMove, mousePress, mousePress, mousePress, mousePress, mouseRelease, mouseRelease, move, moveBy, normalize, postEvent, reset, resize, resizeBy, sample, sample, selectAWTMenuItem, selectAWTMenuItemByLabel, selectAWTPopupMenuItem, selectAWTPopupMenuItemByLabel, selectMenuItem, sendEvent, setAutoDelay, setEventMode, setEventPostDelay, setModifiers, showPopupMenu, showPopupMenu, simpleClassName, sleep, toHierarchyPath, toString, toString, toString, userMovable, userResizable, useScreenMenuBar, wait, wait, wait, waitForIdle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JListTester

public JListTester()
Method Detail

valueToString

public static String valueToString(JList list,
                                   int index)
Convert the value in the list at the given index into a reasonable string representation, or null if one can not be obtained.


getElementAt

public Object getElementAt(JList list,
                           int index)
JList doesn't provide direct access to its contents, so make up for that oversight.


getSize

public int getSize(JList list)
Return the size of the given list.


getContents

public String[] getContents(JList list)
Return an array of strings that represents the list's contents.


actionScrollRowToVisible

public void actionScrollRowToVisible(Component list,
                                     int index)
Deprecated. Use the JListLocation version.

Make sure the entire element at the given index is visible.


actionSelectIndex

public void actionSelectIndex(Component c,
                              int index)
Select the given index. Equivalent to actionSelectRow(c, new JListLocation(index)).


actionSelectRow

public void actionSelectRow(Component c,
                            JListLocation location)
Select the given row. Does nothing if the index is already selected.


actionClickIndex

public void actionClickIndex(Component list,
                             int index)
Deprecated. Use the ComponentLocation version instead.

Click the cell at the given row, using mouse button 1.

Throws:
ActionFailedException - if the index is out of range.

actionClickIndex

public void actionClickIndex(Component list,
                             int index,
                             String modifiers)
Deprecated. Use the ComponentLocation version instead.

Click the cell at the given index, using the given button modifiers.

Throws:
ActionFailedException - if the index is out of range.

actionClickIndex

public void actionClickIndex(Component c,
                             int index,
                             String modifiers,
                             int count)
Deprecated. Use the ComponentLocation version instead.

Click the cell at the given index, using the given button modifiers and click count.

Throws:
ActionFailedException - if the index is out of range.

actionSelectValue

public void actionSelectValue(Component list,
                              String item)
Deprecated. Use the ComponentLocation version instead.

Select the first instance of the given value in the JList. Does nothing if that value is already selected.

Throws:
ActionFailedException - if the value does not exist.

actionClickValue

public void actionClickValue(Component list,
                             String item)
Deprecated. Use the ComponentLocation version instead.

Click on the given value using mouse button 1.

Throws:
ActionFailedException - if the value does not exist.

actionClickValue

public void actionClickValue(Component list,
                             String item,
                             String modifiers)
Deprecated. Use the ComponentLocation version instead.

Click on the given value, using the given button modifiers.

Throws:
ActionFailedException - if the value does not exist.

actionClickValue

public void actionClickValue(Component list,
                             String item,
                             String modifiers,
                             int count)
Deprecated. Use the ComponentLocation version instead.

Click on the given value, using the given button modifiers and click count.

Throws:
ActionFailedException - if the value does not exist.

actionSelectPopupMenuItemAtIndex

public void actionSelectPopupMenuItemAtIndex(Component list,
                                             int index,
                                             String menuItem)
Deprecated. Use the ComponentLocation version instead.

Select an item from a popup menu on the given list at the given index.

Throws:
ActionFailedException - if the index is out of range.

actionSelectPopupMenuItemAtValue

public void actionSelectPopupMenuItemAtValue(Component list,
                                             String item,
                                             String menuItem)
Deprecated. Use the ComponentLocation version instead.

Select an item from a popup menu on the given list at the given value.

Throws:
ActionFailedException - if the value does not exist.

actionShowPopupMenuAtIndex

public void actionShowPopupMenuAtIndex(Component list,
                                       int index)
Deprecated. Use the ComponentLocation version instead.

Activate a popup menu on the given list at the given index.

Throws:
ActionFailedException - if the index is out of range.

actionShowPopupMenuAtValue

public void actionShowPopupMenuAtValue(Component list,
                                       String item)
Deprecated. Use the ComponentLocation version instead.

Activate a popup menu on the given list at the given value.

Throws:
ActionFailedException - if the value does not exist.

parseLocation

public ComponentLocation parseLocation(String encoded)
Parse the String representation of a JListLocation into the actual JListLocation object.

Overrides:
parseLocation in class ComponentTester

getLocation

public ComponentLocation getLocation(Component c,
                                     Point p)
Return the value, row, or coordinate location.

Overrides:
getLocation in class ComponentTester


Copyright © 2002-2004 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge