org.netbeans.jemmy.operators
Class JComboBoxOperator

java.lang.Object
  extended by org.netbeans.jemmy.operators.Operator
      extended by org.netbeans.jemmy.operators.ComponentOperator
          extended by org.netbeans.jemmy.operators.ContainerOperator
              extended by org.netbeans.jemmy.operators.JComponentOperator
                  extended by org.netbeans.jemmy.operators.JComboBoxOperator
All Implemented Interfaces:
Outputable, Timeoutable

public class JComboBoxOperator
extends JComponentOperator
implements Timeoutable, Outputable



Timeouts used:
JComboBoxOperator.BeforeSelectingTimeout - time to sleep after list opened and before item selected
JComboBoxOperator.WaitListTimeout - time to wait list opened
ComponentOperator.WaitComponentTimeout - time to wait component displayed
ComponentOperator.WaitComponentEnabledTimeout - time to wait component enabled
ComponentOperator.WaitStateTimeout - time to wait for item to be selected
AbstractButtonOperator.PushButtonTimeout - time between combo button pressing and releasing
ComponentOperator.MouseClickTimeout - time between mouse pressing and releasing during item selecting
JTextComponentOperator.PushKeyTimeout - time between key pressing and releasing during text typing
JTextComponentOperator.BetweenKeysTimeout - time to sleep between two chars typing
JTextComponentOperator.ChangeCaretPositionTimeout - maximum time to chenge caret position
JTextComponentOperator.TypeTextTimeout - maximum time to type text
.

Author:
Alexandre Iline ([email protected])
See Also:
Timeouts

Nested Class Summary
static class JComboBoxOperator.JComboBoxByItemFinder
          Allows to find component by an item.
static class JComboBoxOperator.JComboBoxFinder
          Checks component type.
 
Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.JComponentOperator
JComponentOperator.JComponentByTipFinder, JComponentOperator.JComponentFinder
 
Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.ContainerOperator
ContainerOperator.ContainerFinder
 
Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.Operator
Operator.ComponentVisualizer, Operator.DefaultPathParser, Operator.DefaultStringComparator, Operator.Finder, Operator.MapAction, Operator.MapBooleanAction, Operator.MapByteAction, Operator.MapCharacterAction, Operator.MapDoubleAction, Operator.MapFloatAction, Operator.MapIntegerAction, Operator.MapLongAction, Operator.MapVoidAction, Operator.NoBlockingAction, Operator.PathParser, Operator.StringComparator
 
Field Summary
static java.lang.String ITEM_PREFIX_DPROP
          Identifier for a "item" property values.
static java.lang.String TEXT_DPROP
          Identifier for a "text" property.
 
Fields inherited from class org.netbeans.jemmy.operators.JComponentOperator
A11Y_DATA, A11Y_DESCRIPTION_DPROP, A11Y_NAME_DPROP, TOOLTIP_TEXT_DPROP
 
Fields inherited from class org.netbeans.jemmy.operators.ComponentOperator
HEIGHT_DPROP, IS_SHOWING_DPROP, IS_VISIBLE_DPROP, NAME_DPROP, WIDTH_DPROP, X_DPROP, Y_DPROP
 
Fields inherited from class org.netbeans.jemmy.operators.Operator
CLASS_DPROP, TO_STRING_DPROP
 
Constructor Summary
JComboBoxOperator(ContainerOperator cont)
          Constructor.
JComboBoxOperator(ContainerOperator cont, ComponentChooser chooser)
          Constructs a JComboBoxOperator object.
JComboBoxOperator(ContainerOperator cont, ComponentChooser chooser, int index)
          Constructs a JComboBoxOperator object.
JComboBoxOperator(ContainerOperator cont, int index)
          Constructor.
JComboBoxOperator(ContainerOperator cont, java.lang.String text)
          Constructor.
JComboBoxOperator(ContainerOperator cont, java.lang.String text, int index)
          Constructor.
JComboBoxOperator(javax.swing.JComboBox b)
          Constructs a JComboBoxOperator object.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent actionEvent)
          Maps JComboBox.actionPerformed(ActionEvent) through queue
 void addActionListener(java.awt.event.ActionListener actionListener)
          Maps JComboBox.addActionListener(ActionListener) through queue
 void addItem(java.lang.Object object)
          Maps JComboBox.addItem(Object) through queue
 void addItemListener(java.awt.event.ItemListener itemListener)
          Maps JComboBox.addItemListener(ItemListener) through queue
 void clearText()
          Clears text in the editable combobox using left-arrow and delete keys.
 void configureEditor(javax.swing.ComboBoxEditor comboBoxEditor, java.lang.Object object)
          Maps JComboBox.configureEditor(ComboBoxEditor, Object) through queue
 void contentsChanged(javax.swing.event.ListDataEvent listDataEvent)
          Maps JComboBox.contentsChanged(ListDataEvent) through queue
 void copyEnvironment(Operator anotherOperator)
          Copies all environment (output, timeouts, visualizer) from another operator.
 void enterText(java.lang.String text)
          Requests a focus, clears text, types new one and pushes Enter.
 int findItemIndex(java.lang.String item, Operator.StringComparator comparator)
          Finds an item between list items.
 javax.swing.JButton findJButton()
          Searches JButton inside component.
static javax.swing.JComboBox findJComboBox(java.awt.Container cont, ComponentChooser chooser)
          Searches 0'th JComboBox in container.
static javax.swing.JComboBox findJComboBox(java.awt.Container cont, ComponentChooser chooser, int index)
          Searches JComboBox in container.
static javax.swing.JComboBox findJComboBox(java.awt.Container cont, java.lang.String text, boolean ce, boolean ccs, int itemIndex)
          Searches JComboBox by item.
static javax.swing.JComboBox findJComboBox(java.awt.Container cont, java.lang.String text, boolean ce, boolean ccs, int itemIndex, int index)
          Searches JComboBox by item.
 javax.swing.JTextField findJTextField()
          Searches JTextField inside component.
 java.lang.String getActionCommand()
          Maps JComboBox.getActionCommand() through queue
 JButtonOperator getButton()
          Creates an operator for button returned by findJButton() method.
 java.util.Hashtable getDump()
          Returns information about component.
 javax.swing.ComboBoxEditor getEditor()
          Maps JComboBox.getEditor() through queue
 java.lang.Object getItemAt(int i)
          Maps JComboBox.getItemAt(int) through queue
 int getItemCount()
          Maps JComboBox.getItemCount() through queue
 javax.swing.JComboBox.KeySelectionManager getKeySelectionManager()
          Maps JComboBox.getKeySelectionManager() through queue
 int getMaximumRowCount()
          Maps JComboBox.getMaximumRowCount() through queue
 javax.swing.ComboBoxModel getModel()
          Maps JComboBox.getModel() through queue
 TestOut getOutput()
          Returns print output streams or writers.
 javax.swing.ListCellRenderer getRenderer()
          Maps JComboBox.getRenderer() through queue
 int getSelectedIndex()
          Maps JComboBox.getSelectedIndex() through queue
 java.lang.Object getSelectedItem()
          Maps JComboBox.getSelectedItem() through queue
 java.lang.Object[] getSelectedObjects()
          Maps JComboBox.getSelectedObjects() through queue
 JTextFieldOperator getTextField()
          Creates an operator for button returned by findJTextField() method.
 Timeouts getTimeouts()
          Return current timeouts.
 javax.swing.plaf.ComboBoxUI getUI()
          Maps JComboBox.getUI() through queue
 void hidePopup()
          Maps JComboBox.hidePopup() through queue
 void insertItemAt(java.lang.Object object, int i)
          Maps JComboBox.insertItemAt(Object, int) through queue
 void intervalAdded(javax.swing.event.ListDataEvent listDataEvent)
          Maps JComboBox.intervalAdded(ListDataEvent) through queue
 void intervalRemoved(javax.swing.event.ListDataEvent listDataEvent)
          Maps JComboBox.intervalRemoved(ListDataEvent) through queue
 boolean isEditable()
          Maps JComboBox.isEditable() through queue
 boolean isLightWeightPopupEnabled()
          Maps JComboBox.isLightWeightPopupEnabled() through queue
 boolean isPopupVisible()
          Maps JComboBox.isPopupVisible() through queue
 void processKeyEvent(java.awt.event.KeyEvent keyEvent)
          Maps JComboBox.processKeyEvent(KeyEvent) through queue
 void pushComboButton()
          Push combobox's button to expand or collapse combobox.
 void removeActionListener(java.awt.event.ActionListener actionListener)
          Maps JComboBox.removeActionListener(ActionListener) through queue
 void removeAllItems()
          Maps JComboBox.removeAllItems() through queue
 void removeItem(java.lang.Object object)
          Maps JComboBox.removeItem(Object) through queue
 void removeItemAt(int i)
          Maps JComboBox.removeItemAt(int) through queue
 void removeItemListener(java.awt.event.ItemListener itemListener)
          Maps JComboBox.removeItemListener(ItemListener) through queue
 void selectItem(int index)
          Selects combobox item.
 void selectItem(java.lang.String item)
          Selects combobox item.
 void selectItem(java.lang.String item, boolean ce, boolean cc)
          Deprecated. Use selectItem(String) or selectItem(String, StringComparator)
 void selectItem(java.lang.String item, Operator.StringComparator comparator)
          Selects an item by text.
 boolean selectWithKeyChar(char c)
          Maps JComboBox.selectWithKeyChar(char) through queue
 void setActionCommand(java.lang.String string)
          Maps JComboBox.setActionCommand(String) through queue
 void setEditable(boolean b)
          Maps JComboBox.setEditable(boolean) through queue
 void setEditor(javax.swing.ComboBoxEditor comboBoxEditor)
          Maps JComboBox.setEditor(ComboBoxEditor) through queue
 void setKeySelectionManager(javax.swing.JComboBox.KeySelectionManager keySelectionManager)
          Maps JComboBox.setKeySelectionManager(KeySelectionManager) through queue
 void setLightWeightPopupEnabled(boolean b)
          Maps JComboBox.setLightWeightPopupEnabled(boolean) through queue
 void setMaximumRowCount(int i)
          Maps JComboBox.setMaximumRowCount(int) through queue
 void setModel(javax.swing.ComboBoxModel comboBoxModel)
          Maps JComboBox.setModel(ComboBoxModel) through queue
 void setOutput(TestOut output)
          Defines print output streams or writers.
 void setPopupVisible(boolean b)
          Maps JComboBox.setPopupVisible(boolean) through queue
 void setRenderer(javax.swing.ListCellRenderer listCellRenderer)
          Maps JComboBox.setRenderer(ListCellRenderer) through queue
 void setSelectedIndex(int i)
          Maps JComboBox.setSelectedIndex(int) through queue
 void setSelectedItem(java.lang.Object object)
          Maps JComboBox.setSelectedItem(Object) through queue
 void setTimeouts(Timeouts timeouts)
          Defines current timeouts.
 void setUI(javax.swing.plaf.ComboBoxUI comboBoxUI)
          Maps JComboBox.setUI(ComboBoxUI) through queue
 void showPopup()
          Maps JComboBox.showPopup() through queue
 void typeText(java.lang.String text)
          Types text in the editable combobox.
 int waitItem(int itemIndex)
          Waits for an item of given index available between list items.
 int waitItem(java.lang.String item, Operator.StringComparator comparator)
          Waits for an item available between list items.
 void waitItemSelected(int index)
          Waits for item to be selected.
 void waitItemSelected(java.lang.String item)
          Waits for item to be selected.
static javax.swing.JComboBox waitJComboBox(java.awt.Container cont, ComponentChooser chooser)
          Waits 0'th JComboBox in container.
static javax.swing.JComboBox waitJComboBox(java.awt.Container cont, ComponentChooser chooser, int index)
          Waits JComboBox in container.
static javax.swing.JComboBox waitJComboBox(java.awt.Container cont, java.lang.String text, boolean ce, boolean ccs, int itemIndex)
          Waits JComboBox by item.
static javax.swing.JComboBox waitJComboBox(java.awt.Container cont, java.lang.String text, boolean ce, boolean ccs, int itemIndex, int index)
          Waits JComboBox by item.
 javax.swing.JList waitList()
          Waits combobox's list to be displayed.
 
Methods inherited from class org.netbeans.jemmy.operators.JComponentOperator
addAncestorListener, addVetoableChangeListener, computeVisibleRect, createToolTip, findJComponent, findJComponent, findJComponent, findJComponent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getAutoscrolls, getBorder, getCenterXForClick, getCenterYForClick, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getInsets, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVisibleRect, getWindowContainerOperator, grabFocus, isFocusCycleRoot, isManagingFocus, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, requestDefaultFocus, resetKeyboardActions, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, showToolTip, unregisterKeyboardAction, updateUI, waitJComponent, waitJComponent, waitJComponent, waitJComponent, waitToolTip
 
Methods inherited from class org.netbeans.jemmy.operators.ContainerOperator
add, add, add, add, add, addContainerListener, createSubOperator, createSubOperator, findComponentAt, findComponentAt, findContainer, findContainer, findContainer, findContainer, findContainerUnder, findContainerUnder, findSubComponent, findSubComponent, getComponent, getComponentCount, getComponents, getInsets, getLayout, isAncestorOf, paintComponents, printComponents, remove, remove, removeAll, removeContainerListener, setLayout, waitContainer, waitContainer, waitContainer, waitContainer, waitSubComponent, waitSubComponent
 
Methods inherited from class org.netbeans.jemmy.operators.ComponentOperator
activateWindow, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, checkImage, checkImage, clickForPopup, clickForPopup, clickForPopup, clickForPopup, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, contains, contains, createImage, createImage, dispatchEvent, doLayout, dragMouse, dragMouse, dragMouse, dragNDrop, dragNDrop, dragNDrop, enableInputMethods, enterMouse, exitMouse, findComponent, findComponent, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getCenterX, getCenterY, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getContainer, getContainers, getCursor, getDropTarget, getEventDispatcher, getFocus, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getSize, getSource, getToolkit, getTreeLock, getWidth, getWindow, getX, getY, hasFocus, imageUpdate, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, list, list, list, list, list, makeComponentVisible, moveMouse, paint, paintAll, prepareImage, prepareImage, pressKey, pressKey, pressMouse, pressMouse, print, printAll, pushKey, pushKey, releaseKey, releaseKey, releaseMouse, releaseMouse, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, transferFocus, typeKey, typeKey, typeKey, update, validate, waitComponent, waitComponent, waitComponent, waitComponent, waitComponentEnabled, waitComponentShowing, waitComponentVisible, waitHasFocus, wtComponentEnabled
 
Methods inherited from class org.netbeans.jemmy.operators.Operator
addOperatorPackage, addToDump, addToDump, createOperator, getCharBindingMap, getCharKey, getCharModifiers, getCharsKeys, getCharsKeys, getCharsModifiers, getCharsModifiers, getComparator, getDefaultComponentVisualizer, getDefaultMouseButton, getDefaultPathParser, getDefaultStringComparator, getDefaultVerification, getEnvironmentOperator, getParentPath, getParentPath, getPathParser, getPopupMouseButton, getProperties, getQueueTool, getVerification, getVisualizer, isCaptionEqual, isCaptionEqual, isCaptionEqual, lockQueue, parseString, parseString, printDump, produceNoBlocking, produceNoBlocking, produceTimeRestricted, produceTimeRestricted, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, setCharBindingMap, setComparator, setDefaultComponentVisualizer, setDefaultPathParser, setDefaultStringComparator, setDefaultVerification, setPathParser, setProperties, setVerification, setVisualizer, toStringSource, unlockAndThrow, unlockQueue, waitState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEXT_DPROP

public static final java.lang.String TEXT_DPROP
Identifier for a "text" property.

See Also:
getDump(), Constant Field Values

ITEM_PREFIX_DPROP

public static final java.lang.String ITEM_PREFIX_DPROP
Identifier for a "item" property values.

See Also:
getDump(), Constant Field Values
Constructor Detail

JComboBoxOperator

public JComboBoxOperator(javax.swing.JComboBox b)
Constructs a JComboBoxOperator object.

Parameters:
b - a component

JComboBoxOperator

public JComboBoxOperator(ContainerOperator cont,
                         ComponentChooser chooser,
                         int index)
Constructs a JComboBoxOperator object.

Parameters:
cont - a container
chooser - a component chooser specifying searching criteria.
index - an index between appropriate ones.

JComboBoxOperator

public JComboBoxOperator(ContainerOperator cont,
                         ComponentChooser chooser)
Constructs a JComboBoxOperator object.

Parameters:
cont - a container
chooser - a component chooser specifying searching criteria.

JComboBoxOperator

public JComboBoxOperator(ContainerOperator cont,
                         java.lang.String text,
                         int index)
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.

Parameters:
cont - a container
text - Text of item which is currently selected.
index - Ordinal component index.
Throws:
TimeoutExpiredException
See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)

JComboBoxOperator

public JComboBoxOperator(ContainerOperator cont,
                         java.lang.String text)
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.

Parameters:
cont - a container
text - Text of item which is currently selected.
Throws:
TimeoutExpiredException
See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)

JComboBoxOperator

public JComboBoxOperator(ContainerOperator cont,
                         int index)
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.

Parameters:
cont - a container
index - Ordinal component index.
Throws:
TimeoutExpiredException

JComboBoxOperator

public JComboBoxOperator(ContainerOperator cont)
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.

Parameters:
cont - a container
Throws:
TimeoutExpiredException
Method Detail

findJComboBox

public static javax.swing.JComboBox findJComboBox(java.awt.Container cont,
                                                  ComponentChooser chooser,
                                                  int index)
Searches JComboBox in container.

Parameters:
cont - Container to search component in.
chooser - org.netbeans.jemmy.ComponentChooser implementation.
index - Ordinal component index.
Returns:
JComboBox instance or null if component was not found.

findJComboBox

public static javax.swing.JComboBox findJComboBox(java.awt.Container cont,
                                                  ComponentChooser chooser)
Searches 0'th JComboBox in container.

Parameters:
cont - Container to search component in.
chooser - org.netbeans.jemmy.ComponentChooser implementation.
Returns:
JComboBox instance or null if component was not found.

findJComboBox

public static javax.swing.JComboBox findJComboBox(java.awt.Container cont,
                                                  java.lang.String text,
                                                  boolean ce,
                                                  boolean ccs,
                                                  int itemIndex,
                                                  int index)
Searches JComboBox by item.

Parameters:
cont - Container to search component in.
text - Item text. If null, contents is not checked.
ce - Compare text exactly.
ccs - Compare text case sensitively.
itemIndex - Index of item to compare text. If -1, selected item is checked.
index - Ordinal component index.
Returns:
JComboBox instance or null if component was not found.
See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)

findJComboBox

public static javax.swing.JComboBox findJComboBox(java.awt.Container cont,
                                                  java.lang.String text,
                                                  boolean ce,
                                                  boolean ccs,
                                                  int itemIndex)
Searches JComboBox by item.

Parameters:
cont - Container to search component in.
text - Item text. If null, contents is not checked.
ce - Compare text exactly.
ccs - Compare text case sensitively.
itemIndex - Index of item to compare text. If -1, selected item is checked.
Returns:
JComboBox instance or null if component was not found.
See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)

waitJComboBox

public static javax.swing.JComboBox waitJComboBox(java.awt.Container cont,
                                                  ComponentChooser chooser,
                                                  int index)
Waits JComboBox in container.

Parameters:
cont - Container to search component in.
chooser - org.netbeans.jemmy.ComponentChooser implementation.
index - Ordinal component index.
Returns:
JComboBox instance or null if component was not found.
Throws:
TimeoutExpiredException

waitJComboBox

public static javax.swing.JComboBox waitJComboBox(java.awt.Container cont,
                                                  ComponentChooser chooser)
Waits 0'th JComboBox in container.

Parameters:
cont - Container to search component in.
chooser - org.netbeans.jemmy.ComponentChooser implementation.
Returns:
JComboBox instance or null if component was not found.
Throws:
TimeoutExpiredException

waitJComboBox

public static javax.swing.JComboBox waitJComboBox(java.awt.Container cont,
                                                  java.lang.String text,
                                                  boolean ce,
                                                  boolean ccs,
                                                  int itemIndex,
                                                  int index)
Waits JComboBox by item.

Parameters:
cont - Container to search component in.
text - Item text. If null, contents is not checked.
ce - Compare text exactly.
ccs - Compare text case sensitively.
itemIndex - Index of item to compare text. If -1, selected item is checked.
index - Ordinal component index.
Returns:
JComboBox instance or null if component was not found.
Throws:
TimeoutExpiredException
See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)

waitJComboBox

public static javax.swing.JComboBox waitJComboBox(java.awt.Container cont,
                                                  java.lang.String text,
                                                  boolean ce,
                                                  boolean ccs,
                                                  int itemIndex)
Waits JComboBox by item.

Parameters:
cont - Container to search component in.
text - Item text. If null, contents is not checked.
ce - Compare text exactly.
ccs - Compare text case sensitively.
itemIndex - Index of item to compare text. If -1, selected item is checked.
Returns:
JComboBox instance or null if component was not found.
Throws:
TimeoutExpiredException
See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)

setTimeouts

public void setTimeouts(Timeouts timeouts)
Description copied from interface: Timeoutable
Defines current timeouts.

Specified by:
setTimeouts in interface Timeoutable
Overrides:
setTimeouts in class JComponentOperator
Parameters:
timeouts - A collection of timeout assignments.
See Also:
Timeoutable.getTimeouts()

getTimeouts

public Timeouts getTimeouts()
Description copied from interface: Timeoutable
Return current timeouts.

Specified by:
getTimeouts in interface Timeoutable
Overrides:
getTimeouts in class JComponentOperator
Returns:
the collection of current timeout assignments.
See Also:
Timeoutable.setTimeouts(org.netbeans.jemmy.Timeouts)

setOutput

public void setOutput(TestOut output)
Description copied from interface: Outputable
Defines print output streams or writers.

Specified by:
setOutput in interface Outputable
Overrides:
setOutput in class JComponentOperator
Parameters:
output - Identify the streams or writers used for print output.
See Also:
Outputable.getOutput()

getOutput

public TestOut getOutput()
Description copied from interface: Outputable
Returns print output streams or writers.

Specified by:
getOutput in interface Outputable
Overrides:
getOutput in class JComponentOperator
Returns:
an object that contains references to objects for printing to output and err streams.
See Also:
Outputable.setOutput(org.netbeans.jemmy.TestOut)

copyEnvironment

public void copyEnvironment(Operator anotherOperator)
Description copied from class: Operator
Copies all environment (output, timeouts, visualizer) from another operator.

Overrides:
copyEnvironment in class ComponentOperator
Parameters:
anotherOperator - an operator to copy the environment to.

findJButton

public javax.swing.JButton findJButton()
Searches JButton inside component.

Returns:
JButton which is used to expand this JComboBox.

findJTextField

public javax.swing.JTextField findJTextField()
Searches JTextField inside component.

Returns:
JTextField if JComboBox is editable, null otherwise.

getButton

public JButtonOperator getButton()
Creates an operator for button returned by findJButton() method.

Returns:
new JButtonOperator instance.

getTextField

public JTextFieldOperator getTextField()
Creates an operator for button returned by findJTextField() method.

Returns:
new JTextField instance.

waitList

public javax.swing.JList waitList()
Waits combobox's list to be displayed.

Returns:
JList object if it was displayed in JComboBoxOperator.WaitListTimeout millisecont, null otherwise.
Throws:
TimeoutExpiredException

pushComboButton

public void pushComboButton()
Push combobox's button to expand or collapse combobox.

Throws:
TimeoutExpiredException

findItemIndex

public int findItemIndex(java.lang.String item,
                         Operator.StringComparator comparator)
Finds an item between list items.

Parameters:
item - a text pattern.
comparator - a searching criteria.
Returns:
an item index.

waitItem

public int waitItem(java.lang.String item,
                    Operator.StringComparator comparator)
Waits for an item available between list items.

Parameters:
item - a text pattern.
comparator - a searching criteria.
Returns:
an item index or throws TimeoutExpiredException if item not found.

waitItem

public int waitItem(int itemIndex)
Waits for an item of given index available between list items.

Parameters:
itemIndex - index of desired item
Returns:
an item index or throws TimeoutExpiredException if item not found.

selectItem

public void selectItem(java.lang.String item,
                       Operator.StringComparator comparator)
Selects an item by text.

Parameters:
item - a text pattern.
comparator - a searching criteria.

selectItem

public void selectItem(java.lang.String item,
                       boolean ce,
                       boolean cc)
Deprecated. Use selectItem(String) or selectItem(String, StringComparator)

Selects combobox item.

Parameters:
item - Item text.
ce - Compare exactly.
cc - Compare case sensitivelly.
Throws:
TimeoutExpiredException
See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)

selectItem

public void selectItem(java.lang.String item)
Selects combobox item. Uses StringComparator assigned to this object.

Parameters:
item - Item text.
Throws:
TimeoutExpiredException

selectItem

public void selectItem(int index)
Selects combobox item. If verification mode is on, checks that right item has been selected.

Parameters:
index - Item index.
Throws:
TimeoutExpiredException

typeText

public void typeText(java.lang.String text)
Types text in the editable combobox. If combobox has no focus, does simple mouse click on it first.

Parameters:
text - text to type.
Throws:
TimeoutExpiredException

clearText

public void clearText()
Clears text in the editable combobox using left-arrow and delete keys. If combobox has no focus, does simple mouse click on it first.

Throws:
TimeoutExpiredException

enterText

public void enterText(java.lang.String text)
Requests a focus, clears text, types new one and pushes Enter.

Parameters:
text - New text value. Shouln't include final '\n'.
Throws:
TimeoutExpiredException

waitItemSelected

public void waitItemSelected(int index)
Waits for item to be selected.

Parameters:
index - Item index.

waitItemSelected

public void waitItemSelected(java.lang.String item)
Waits for item to be selected. Uses getComparator() comparator.

Parameters:
item - wait an item to be selected.

getDump

public java.util.Hashtable getDump()
Returns information about component.

Overrides:
getDump in class JComponentOperator
Returns:
a Hashtable containing name-value pairs.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent actionEvent)
Maps JComboBox.actionPerformed(ActionEvent) through queue


addActionListener

public void addActionListener(java.awt.event.ActionListener actionListener)
Maps JComboBox.addActionListener(ActionListener) through queue


addItem

public void addItem(java.lang.Object object)
Maps JComboBox.addItem(Object) through queue


addItemListener

public void addItemListener(java.awt.event.ItemListener itemListener)
Maps JComboBox.addItemListener(ItemListener) through queue


configureEditor

public void configureEditor(javax.swing.ComboBoxEditor comboBoxEditor,
                            java.lang.Object object)
Maps JComboBox.configureEditor(ComboBoxEditor, Object) through queue


contentsChanged

public void contentsChanged(javax.swing.event.ListDataEvent listDataEvent)
Maps JComboBox.contentsChanged(ListDataEvent) through queue


getActionCommand

public java.lang.String getActionCommand()
Maps JComboBox.getActionCommand() through queue


getEditor

public javax.swing.ComboBoxEditor getEditor()
Maps JComboBox.getEditor() through queue


getItemAt

public java.lang.Object getItemAt(int i)
Maps JComboBox.getItemAt(int) through queue


getItemCount

public int getItemCount()
Maps JComboBox.getItemCount() through queue


getKeySelectionManager

public javax.swing.JComboBox.KeySelectionManager getKeySelectionManager()
Maps JComboBox.getKeySelectionManager() through queue


getMaximumRowCount

public int getMaximumRowCount()
Maps JComboBox.getMaximumRowCount() through queue


getModel

public javax.swing.ComboBoxModel getModel()
Maps JComboBox.getModel() through queue


getRenderer

public javax.swing.ListCellRenderer getRenderer()
Maps JComboBox.getRenderer() through queue


getSelectedIndex

public int getSelectedIndex()
Maps JComboBox.getSelectedIndex() through queue


getSelectedItem

public java.lang.Object getSelectedItem()
Maps JComboBox.getSelectedItem() through queue


getSelectedObjects

public java.lang.Object[] getSelectedObjects()
Maps JComboBox.getSelectedObjects() through queue


getUI

public javax.swing.plaf.ComboBoxUI getUI()
Maps JComboBox.getUI() through queue


hidePopup

public void hidePopup()
Maps JComboBox.hidePopup() through queue


insertItemAt

public void insertItemAt(java.lang.Object object,
                         int i)
Maps JComboBox.insertItemAt(Object, int) through queue


intervalAdded

public void intervalAdded(javax.swing.event.ListDataEvent listDataEvent)
Maps JComboBox.intervalAdded(ListDataEvent) through queue


intervalRemoved

public void intervalRemoved(javax.swing.event.ListDataEvent listDataEvent)
Maps JComboBox.intervalRemoved(ListDataEvent) through queue


isEditable

public boolean isEditable()
Maps JComboBox.isEditable() through queue


isLightWeightPopupEnabled

public boolean isLightWeightPopupEnabled()
Maps JComboBox.isLightWeightPopupEnabled() through queue


isPopupVisible

public boolean isPopupVisible()
Maps JComboBox.isPopupVisible() through queue


processKeyEvent

public void processKeyEvent(java.awt.event.KeyEvent keyEvent)
Maps JComboBox.processKeyEvent(KeyEvent) through queue


removeActionListener

public void removeActionListener(java.awt.event.ActionListener actionListener)
Maps JComboBox.removeActionListener(ActionListener) through queue


removeAllItems

public void removeAllItems()
Maps JComboBox.removeAllItems() through queue


removeItem

public void removeItem(java.lang.Object object)
Maps JComboBox.removeItem(Object) through queue


removeItemAt

public void removeItemAt(int i)
Maps JComboBox.removeItemAt(int) through queue


removeItemListener

public void removeItemListener(java.awt.event.ItemListener itemListener)
Maps JComboBox.removeItemListener(ItemListener) through queue


selectWithKeyChar

public boolean selectWithKeyChar(char c)
Maps JComboBox.selectWithKeyChar(char) through queue


setActionCommand

public void setActionCommand(java.lang.String string)
Maps JComboBox.setActionCommand(String) through queue


setEditable

public void setEditable(boolean b)
Maps JComboBox.setEditable(boolean) through queue


setEditor

public void setEditor(javax.swing.ComboBoxEditor comboBoxEditor)
Maps JComboBox.setEditor(ComboBoxEditor) through queue


setKeySelectionManager

public void setKeySelectionManager(javax.swing.JComboBox.KeySelectionManager keySelectionManager)
Maps JComboBox.setKeySelectionManager(KeySelectionManager) through queue


setLightWeightPopupEnabled

public void setLightWeightPopupEnabled(boolean b)
Maps JComboBox.setLightWeightPopupEnabled(boolean) through queue


setMaximumRowCount

public void setMaximumRowCount(int i)
Maps JComboBox.setMaximumRowCount(int) through queue


setModel

public void setModel(javax.swing.ComboBoxModel comboBoxModel)
Maps JComboBox.setModel(ComboBoxModel) through queue


setPopupVisible

public void setPopupVisible(boolean b)
Maps JComboBox.setPopupVisible(boolean) through queue


setRenderer

public void setRenderer(javax.swing.ListCellRenderer listCellRenderer)
Maps JComboBox.setRenderer(ListCellRenderer) through queue


setSelectedIndex

public void setSelectedIndex(int i)
Maps JComboBox.setSelectedIndex(int) through queue


setSelectedItem

public void setSelectedItem(java.lang.Object object)
Maps JComboBox.setSelectedItem(Object) through queue


setUI

public void setUI(javax.swing.plaf.ComboBoxUI comboBoxUI)
Maps JComboBox.setUI(ComboBoxUI) through queue


showPopup

public void showPopup()
Maps JComboBox.showPopup() through queue