|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object abbot.tester.Robot abbot.tester.ComponentTester abbot.tester.ContainerTester abbot.tester.JComponentTester abbot.tester.JComboBoxTester
public class JComboBoxTester
JComboBoxTester for testing JComboBox instances.
In the case where you need to create a tester for JComboBox subclasses that use novel components in the popup, for example jtree, you can quickly subclass this tester to deal with those cases without the need to create a seperate Recorder. Simply override the selectItemInPopup, getTargetClass, getValueAsStringFromRenderer and findPopupComponent(Container) to return relavent values for your subclass of JComboBox.
Field Summary |
---|
Fields inherited from class abbot.tester.ComponentTester |
---|
IGNORED_METHODS |
Fields inherited from class abbot.tester.Robot |
---|
componentDelay, defaultDelay, EM_AWT, EM_ROBOT, IDLE_TIMEOUT, MOUSELESS_MODIFIER, MOUSELESS_MODIFIER_MASK, popupDelay |
Fields inherited from interface abbot.tester.AWTConstants |
---|
BUTTON_MASK, COPY_MASK, DRAG_THRESHOLD, LINK_MASK, MENU_SHORTCUT_KEYCODE, MENU_SHORTCUT_MASK, MENU_SHORTCUT_MODIFIER, MENU_SHORTCUT_STRING, MOVE_MASK, MULTI_CLICK_INTERVAL, POPUP_MASK, POPUP_MODIFIER, POPUP_ON_PRESS, TERTIARY_MASK, TERTIARY_MODIFIER |
Constructor Summary | |
---|---|
JComboBoxTester()
|
Method Summary | |
---|---|
void |
actionSelectIndex(Component comp,
int index)
|
void |
actionSelectItem(Component comp,
String item)
|
protected Component |
findPopupComponent(Container parent)
Find the correct popup component in the container |
Component |
findPopupComponent(JComboBox cb)
Find the component in the popup raised by this combo box, if the LAF actually uses one. |
String[] |
getContents(JComboBox cb)
Return an array of strings that represent the combo box list. |
Class |
getTargetClass()
Allow the recorder to write out the correct class name. |
String |
getValueAsString(JComboBox combo,
Component popupComponent,
Object item,
int index)
If the value looks meaningful, return it, otherwise return null. |
protected String |
getValueAsStringFromRenderer(JComboBox combo,
Component popupComponent,
Object item,
int index)
Convert the value to a string using a local render |
protected void |
selectIndexInPopup(Component popup,
int index)
Provide an override point to select the correct index in whatever index the recording has specified |
Methods inherited from class abbot.tester.JComponentTester |
---|
actionActionMap, actionClick, actionClick, actionDrag, actionDrag, actionDrop, actionScrollToVisible, actionScrollToVisible, actionScrollToVisible, convertRendererToString, deriveTag, getTester, isVisible, isVisible, mousePress, scrollRectToVisible, scrollToVisible, scrollToVisible |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JComboBoxTester()
Method Detail |
---|
public String[] getContents(JComboBox cb)
public void actionSelectIndex(Component comp, int index)
protected void selectIndexInPopup(Component popup, int index)
public Component findPopupComponent(JComboBox cb)
protected Component findPopupComponent(Container parent)
public String getValueAsString(JComboBox combo, Component popupComponent, Object item, int index)
public Class getTargetClass()
protected String getValueAsStringFromRenderer(JComboBox combo, Component popupComponent, Object item, int index)
public void actionSelectItem(Component comp, String item)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |