public class AbstractComboBoxDriver extends JComponentDriver
AbstractComboBox. This is loosely based
on the JComboBoxDriver class so a familiar usage pattern
will exist between Swing combo boxes and JIDE combo boxes.| Modifier and Type | Field and Description |
|---|---|
protected AbstractComboBoxCellReader |
_cellReader |
robot| Constructor and Description |
|---|
AbstractComboBoxDriver(Robot robot) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
areEqual(com.jidesoft.combobox.AbstractComboBox combo,
Object o1,
Object o2) |
void |
cellReader(AbstractComboBoxCellReader newCellReader)
Updates the implementation of
to use
when comparing internal values of a and the values expected
in a test. |
void |
clickPopupButton(com.jidesoft.combobox.AbstractComboBox comboBox) |
protected String |
convertElementToString(com.jidesoft.combobox.AbstractComboBox comboBox,
Object o)
Converts an object that may be present in the ComboBox into a String representation.
|
void |
deleteText(com.jidesoft.combobox.AbstractComboBox comboBox)
Deletes the text of the
AbstractComboBox. |
void |
enterText(com.jidesoft.combobox.AbstractComboBox comboBox,
String text)
Simulates a user entering the specified text in the
. |
String |
getEditorText(com.jidesoft.combobox.AbstractComboBox comboBox) |
protected Component |
getInteractionComponent(Component c)
Obtains the component that the user will interact with, which could be the actual
combo box, or the editor component, depending upon the state of the combo box.
|
String |
getStringRepresentation(com.jidesoft.combobox.AbstractComboBox box,
Object o) |
protected boolean |
isDropDownVisible(com.jidesoft.combobox.AbstractComboBox comboBox) |
protected Object |
itemAt(com.jidesoft.combobox.AbstractComboBox comboBox,
int index) |
void |
pressAndReleaseKey(Component c,
int keyCode,
int[] modifiers)
We need to cater for the editor component if we are editable.
|
void |
pressAndReleaseKey(Component c,
KeyPressInfo keyPressInfo)
We need to cater for the editor component if we are editable.
|
void |
pressAndReleaseKeys(Component c,
int... keyCodes)
We need to cater for the editor component if we are editable.
|
void |
pressKey(Component c,
int keyCode)
Simulates a user pressing given key on the
. |
void |
releaseKey(Component c,
int keyCode)
Simulates a user releasing the given key on the
. |
void |
replaceText(com.jidesoft.combobox.AbstractComboBox comboBox,
String text)
Simulates a user entering the specified text in the
,
replacing any text. |
void |
requireEditable(com.jidesoft.combobox.AbstractComboBox comboBox)
Asserts that the given
is editable. |
void |
requireEditorText(com.jidesoft.combobox.AbstractComboBox comboBox,
String requiredText) |
void |
requireEnabled(com.jidesoft.combobox.AbstractComboBox comboBox) |
void |
requireNoSelection(com.jidesoft.combobox.AbstractComboBox comboBox) |
void |
requireNotEditable(com.jidesoft.combobox.AbstractComboBox comboBox)
Asserts that the given
is not editable. |
void |
requireNotEnabled(com.jidesoft.combobox.AbstractComboBox comboBox) |
void |
requirePopupVisible(com.jidesoft.combobox.AbstractComboBox target,
boolean visible) |
void |
requireSelection(com.jidesoft.combobox.AbstractComboBox comboBox,
String value) |
void |
selectAllText(com.jidesoft.combobox.AbstractComboBox comboBox)
Simulates a user selecting the text in the
. |
protected String |
selectedIndexProperty(com.jidesoft.combobox.AbstractComboBox comboBox) |
protected int |
size(com.jidesoft.combobox.AbstractComboBox comboBox) |
clientProperty, invokeAction, isVisible, isVisible, requireToolTip, requireToolTip, scrollToVisibledoResizeHeight, doResizeWidth, isResizable, move, resizebackgroundOf, checkClickAllowed, checkInEdtEnabledAndShowing, checkInEdtShowing, click, click, click, click, click, doubleClick, drag, dragOver, drop, focus, focusAndWaitForFocusGain, fontOf, foregroundOf, invokePopupMenu, invokePopupMenu, moveMouseIgnoringAnyError, moveMouseIgnoringAnyError, performAccessibleActionOf, propertyName, requireDisabled, requireEnabled, requireEnabled, requireFocused, requireNotVisible, requireSize, requireVisible, rightClick, settings, waitForShowingprotected AbstractComboBoxCellReader _cellReader
public AbstractComboBoxDriver(Robot robot)
@RunsInEDT public void deleteText(com.jidesoft.combobox.AbstractComboBox comboBox)
AbstractComboBox.comboBox - the target AbstractComboBox.IllegalStateException - if the AbstractComboBox is disabled.IllegalStateException - if the AbstractComboBox is not showing on the screen.@RunsInEDT public void replaceText(com.jidesoft.combobox.AbstractComboBox comboBox, String text)
AbstractComboBox,
replacing any text. This action is executed only if the AbstractComboBox is editable.comboBox - the target AbstractComboBox.text - the text to enter.IllegalStateException - if the AbstractComboBox is disabled.IllegalStateException - if the AbstractComboBox is not showing on the
screen.IllegalStateException - if the AbstractComboBox is not editable.@RunsInEDT public void selectAllText(com.jidesoft.combobox.AbstractComboBox comboBox)
AbstractComboBox. This
action is executed only if the AbstractComboBox is editable.comboBox - the target AbstractComboBox.IllegalStateException - if the AbstractComboBox is disabled.IllegalStateException - if the AbstractComboBox is not showing on the
screen.IllegalStateException - if the AbstractComboBox is not editable.@RunsInEDT public void pressAndReleaseKeys(Component c, int... keyCodes)
pressAndReleaseKeys in class ComponentDriverc - the target component.keyCodes - one or more codes of the keys to press.@RunsInEDT public void pressAndReleaseKey(Component c, KeyPressInfo keyPressInfo)
pressAndReleaseKey in class ComponentDriverc - the target component.keyPressInfo - specifies the key and modifiers to press.@RunsInEDT public void pressAndReleaseKey(Component c, int keyCode, int[] modifiers)
pressAndReleaseKey in class ComponentDriverc - the target component.keyCode - the code of the key to press.modifiers - the given modifiers.@RunsInEDT public void pressKey(Component c, int keyCode)
Component.pressKey in class ComponentDriverc - the target component.keyCode - the code of the key to press.IllegalArgumentException - if the given code is not a valid key code.IllegalStateException - if the Component is disabled, or is not
showing on the screen.KeyEvent@RunsInEDT public void releaseKey(Component c, int keyCode)
Component.releaseKey in class ComponentDriverc - the target component.keyCode - the code of the key to release.IllegalArgumentException - if the given code is not a valid key code.IllegalStateException - if the Component is disabled, or is not
showing on the screen.KeyEventpublic void requireSelection(com.jidesoft.combobox.AbstractComboBox comboBox,
String value)
@RunsInEDT public void enterText(com.jidesoft.combobox.AbstractComboBox comboBox, String text)
AbstractComboBox.
This action is executed only if the AbstractComboBox is editable.comboBox - the target AbstractComboBox.text - the text to enter.IllegalStateException - if the AbstractComboBox is disabled.IllegalStateException - if the AbstractComboBox is not editable or
is not showing on the screen.@RunsInEDT public void requireEditable(com.jidesoft.combobox.AbstractComboBox comboBox)
AbstractComboBox is editable.comboBox - the target AbstractComboBox.AssertionError - if the AbstractComboBox is not editable.@RunsInEDT public void requireNotEditable(com.jidesoft.combobox.AbstractComboBox comboBox)
AbstractComboBox is not editable.comboBox - the given AbstractComboBox.AssertionError - if the AbstractComboBox is editable.@RunsInEDT public void requireNotEnabled(com.jidesoft.combobox.AbstractComboBox comboBox)
@RunsInEDT public void requireEnabled(com.jidesoft.combobox.AbstractComboBox comboBox)
public String getStringRepresentation(com.jidesoft.combobox.AbstractComboBox box, Object o)
public String getEditorText(com.jidesoft.combobox.AbstractComboBox comboBox)
public void requireEditorText(com.jidesoft.combobox.AbstractComboBox comboBox,
String requiredText)
public void requireNoSelection(com.jidesoft.combobox.AbstractComboBox comboBox)
protected String convertElementToString(com.jidesoft.combobox.AbstractComboBox comboBox, Object o)
comboBox - The comboBox to convert the object for.o - The object to convert into a String.protected boolean isDropDownVisible(com.jidesoft.combobox.AbstractComboBox comboBox)
protected int size(com.jidesoft.combobox.AbstractComboBox comboBox)
protected Object itemAt(com.jidesoft.combobox.AbstractComboBox comboBox, int index)
protected boolean areEqual(com.jidesoft.combobox.AbstractComboBox combo,
Object o1,
Object o2)
protected String selectedIndexProperty(com.jidesoft.combobox.AbstractComboBox comboBox)
public void cellReader(AbstractComboBoxCellReader newCellReader)
AbstractComboBoxCellReader to use
when comparing internal values of a ListComboBox and the values expected
in a test.newCellReader - the new ListComboBoxCellValueReader to use.IllegalArgumentException - if newCellReader is null.@RunsInEDT public void clickPopupButton(com.jidesoft.combobox.AbstractComboBox comboBox)
@RunsInEDT protected Component getInteractionComponent(Component c)
c - The Component to obtain the interactive component from.Component that the user is to interact with.public void requirePopupVisible(com.jidesoft.combobox.AbstractComboBox target,
boolean visible)
Copyright © 2014–2016 AssertJ. All rights reserved.