Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.netbeans.jemmy.operators
Class ChoiceOperator

    java.lang.Object
      |
      +--org.netbeans.jemmy.operators.Operator
            |
            +--org.netbeans.jemmy.operators.ComponentOperator
                  |
                  +--org.netbeans.jemmy.operators.ChoiceOperator

All Implemented Interfaces:
  Outputable, Timeoutable

public class ChoiceOperator
extends ComponentOperator
implements Outputable

Timeouts used:
ButtonOperator.PushButtonTimeout - time between choice pressing and releasing
ComponentOperator.WaitComponentTimeout - time to wait choice displayed
ComponentOperator.WaitComponentEnabledTimeout - time to wait choice enabled
.

Author:
  Alexandre Iline (alexandre.iline@sun.com)
See Also:
  `Timeouts`

Inner Class Summary
`static class` | `ChoiceOperator.ChoiceBySelectedItemFinder` Allows to find component by label.
`static class` | `ChoiceOperator.ChoiceFinder` Checks component type.

Inner classes 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 items properties.
`static java.lang.String` | `SELECTED_ITEM_DPROP` Identifier for a selected item property.

Fields inherited from class org.netbeans.jemmy.operators.ComponentOperator
`HEIGHT_DPROP, IS_SHOWING_DPROP, IS_VISIBLE_DPROP, WIDTH_DPROP, X_DPROP, Y_DPROP`

Fields inherited from class org.netbeans.jemmy.operators.Operator
`CLASS_DPROP, TO_STRING_DPROP`

Constructor Summary
`ChoiceOperator(java.awt.Choice b)` Constructor.
`ChoiceOperator(ContainerOperator cont)` Constructor.
`ChoiceOperator(ContainerOperator cont, ComponentChooser chooser)` Constructs a ChoiceOperator object.
`ChoiceOperator(ContainerOperator cont, ComponentChooser chooser, int index)` Constructs a ChoiceOperator object.
`ChoiceOperator(ContainerOperator cont, int index)` Constructor.
`ChoiceOperator(ContainerOperator cont, java.lang.String text)` Constructor.
`ChoiceOperator(ContainerOperator cont, java.lang.String text, int index)` Constructor.

Method Summary
`void` | `add(java.lang.String item)` Maps `Choice.add(String)` through queue
`void` | `addItemListener(java.awt.event.ItemListener itemListener)` Maps `Choice.addItemListener(ItemListener)` through queue
`void` | `addNotify()` Maps `Choice.addNotify()` through queue
`void` | `copyEnvironment(Operator anotherOperator)` Copies all environment (output, timeouts, visualizer) from another operator.
`static java.awt.Choice` | `findChoice(java.awt.Container cont, ComponentChooser chooser)` Searches 0'th Choice in container.
`static java.awt.Choice` | `findChoice(java.awt.Container cont, ComponentChooser chooser, int index)` Searches Choice in container.
`static java.awt.Choice` | `findChoice(java.awt.Container cont, java.lang.String text, boolean ce, boolean ccs)` Searches Choice by text.
`static java.awt.Choice` | `findChoice(java.awt.Container cont, java.lang.String text, boolean ce, boolean ccs, int index)` Searches Choice by text.
`int` | `findItemIndex(java.lang.String item)` Finds an item between choice items.
`int` | `findItemIndex(java.lang.String item, int index)` Finds an item between choice items.
`java.util.Hashtable` | `getDump()` Returns information about component.
`java.lang.String` | `getItem(int index)` Maps `Choice.getItem(int)` through queue
`int` | `getItemCount()` Maps `Choice.getItemCount()` through queue
`TestOut` | `getOutput()` Returns print output streams or writers.
`int` | `getSelectedIndex()` Maps `Choice.getSelectedIndex()` through queue
`java.lang.String` | `getSelectedItem()` Maps `Choice.getSelectedItem()` through queue
`void` | `insert(java.lang.String item, int index)` Maps `Choice.insert(String)` through queue
`void` | `remove(int position)` Maps `Choice.remove(int)` through queue
`void` | `remove(java.lang.String item)` Maps `Choice.remove(String)` through queue
`void` | `removeAll()` Maps `Choice.removeAll()` through queue
`void` | `removeItemListener(java.awt.event.ItemListener itemListener)` Maps `Choice.removeItemListener(ItemListener)` through queue
`void` | `select(int pos)` Maps `Choice.select(int)` through queue
`void` | `selectItem(int index)` Selects an item by index.
`void` | `selectItem(java.lang.String item)` Selects an item by text.
`void` | `selectItem(java.lang.String item, int index)` Selects an item by text.
`void` | `setOutput(TestOut out)` Defines print output streams or writers.
`void` | `setState(java.lang.String str)` Maps `Choice.select(String)` through queue
`static java.awt.Choice` | `waitChoice(java.awt.Container cont, ComponentChooser chooser)` Waits 0'th Choice in container.
`static java.awt.Choice` | `waitChoice(java.awt.Container cont, ComponentChooser chooser, int index)` Waits Choice in container.
`static java.awt.Choice` | `waitChoice(java.awt.Container cont, java.lang.String text, boolean ce, boolean ccs)` Waits Choice by text.
`static java.awt.Choice` | `waitChoice(java.awt.Container cont, java.lang.String text, boolean ce, boolean ccs, int index)` Waits Choice by text.
`void` | `waitItemSelected(int index)` Waits for item to be selected.

Methods inherited from class org.netbeans.jemmy.operators.ComponentOperator
`activateWindow, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, 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, getCenterXForClick, getCenterY, getCenterYForClick, 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, getTimeouts, 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, setTimeouts, setVisible, transferFocus, typeKey, typeKey, typeKey, update, validate, waitComponent, waitComponent, waitComponent, waitComponent, waitComponentEnabled, waitComponentShowing, waitComponentVisible, waitHasFocus`

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, 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, unlockAndThrow, unlockQueue, waitState`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SELECTED_ITEM_DPROP

    public static final java.lang.String SELECTED_ITEM_DPROP

  Identifier for a selected item property.
  See Also:
    `getDump()`

### ITEM_PREFIX_DPROP

    public static final java.lang.String ITEM_PREFIX_DPROP

  Identifier for a items properties.
  See Also:
    `getDump()`

Constructor Detail

### ChoiceOperator

    public ChoiceOperator(java.awt.Choice b)

  Constructor.
  Parameters:
    `b` - a component

### ChoiceOperator

    public ChoiceOperator(ContainerOperator cont,
                          ComponentChooser chooser,
                          int index)

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

### ChoiceOperator

    public ChoiceOperator(ContainerOperator cont,
                          ComponentChooser chooser)

  Constructs a ChoiceOperator object.
  Parameters:
    `cont` - container
    `chooser` - a component chooser specifying searching criteria.

### ChoiceOperator

    public ChoiceOperator(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` - container
    `text` - Choice text.
    `index` - Ordinal component index.
  Throws:
    `TimeoutExpiredException` -
  See Also:
    `Operator.isCaptionEqual(String, String, boolean, boolean)`

### ChoiceOperator

    public ChoiceOperator(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` - container
    `text` - Choice text.
  Throws:
    `TimeoutExpiredException` -
  See Also:
    `Operator.isCaptionEqual(String, String, boolean, boolean)`

### ChoiceOperator

    public ChoiceOperator(ContainerOperator cont,
                          int index)

  Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.
  Parameters:
    `cont` - container
    `index` - Ordinal component index.
  Throws:
    `TimeoutExpiredException` -

### ChoiceOperator

    public ChoiceOperator(ContainerOperator cont)

  Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.
  Parameters:
    `cont` - container
  Throws:
    `TimeoutExpiredException` -

Method Detail

### findChoice

    public static java.awt.Choice findChoice(java.awt.Container cont,
                                             ComponentChooser chooser,
                                             int index)

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

### findChoice

    public static java.awt.Choice findChoice(java.awt.Container cont,
                                             ComponentChooser chooser)

  Searches 0'th Choice in container.
  Parameters:
    `cont` - Container to search component in.
    `chooser` - org.netbeans.jemmy.ComponentChooser implementation.
  Returns:
    Choice instance or null if component was not found.

### findChoice

    public static java.awt.Choice findChoice(java.awt.Container cont,
                                             java.lang.String text,
                                             boolean ce,
                                             boolean ccs,
                                             int index)

  Searches Choice by text.
  Parameters:
    `cont` - Container to search component in.
    `text` - Choice text. If null, contents is not checked.
    `ce` - Compare text exactly.
    `ccs` - Compare text case sensitively.
    `index` - Ordinal component index.
  Returns:
    Choice instance or null if component was not found.
  See Also:
    `Operator.isCaptionEqual(String, String, boolean, boolean)`

### findChoice

    public static java.awt.Choice findChoice(java.awt.Container cont,
                                             java.lang.String text,
                                             boolean ce,
                                             boolean ccs)

  Searches Choice by text.
  Parameters:
    `cont` - Container to search component in.
    `text` - Choice text. If null, contents is not checked.
    `ce` - Compare text exactly.
    `ccs` - Compare text case sensitively.
  Returns:
    Choice instance or null if component was not found.
  See Also:
    `Operator.isCaptionEqual(String, String, boolean, boolean)`

### waitChoice

    public static java.awt.Choice waitChoice(java.awt.Container cont,
                                             ComponentChooser chooser,
                                             int index)

  Waits Choice in container.
  Parameters:
    `cont` - Container to search component in.
    `chooser` - org.netbeans.jemmy.ComponentChooser implementation.
    `index` - Ordinal component index.
  Returns:
    Choice instance.
  Throws:
    `TimeoutExpiredException` -

### waitChoice

    public static java.awt.Choice waitChoice(java.awt.Container cont,
                                             ComponentChooser chooser)

  Waits 0'th Choice in container.
  Parameters:
    `cont` - Container to search component in.
    `chooser` - org.netbeans.jemmy.ComponentChooser implementation.
  Returns:
    Choice instance.
  Throws:
    `TimeoutExpiredException` -

### waitChoice

    public static java.awt.Choice waitChoice(java.awt.Container cont,
                                             java.lang.String text,
                                             boolean ce,
                                             boolean ccs,
                                             int index)

  Waits Choice by text.
  Parameters:
    `cont` - Container to search component in.
    `text` - Choice text. If null, contents is not checked.
    `ce` - Compare text exactly.
    `ccs` - Compare text case sensitively.
    `index` - Ordinal component index.
  Returns:
    Choice instance.
  Throws:
    `TimeoutExpiredException` -
  See Also:
    `Operator.isCaptionEqual(String, String, boolean, boolean)`

### waitChoice

    public static java.awt.Choice waitChoice(java.awt.Container cont,
                                             java.lang.String text,
                                             boolean ce,
                                             boolean ccs)

  Waits Choice by text.
  Parameters:
    `cont` - Container to search component in.
    `text` - Choice text. If null, contents is not checked.
    `ce` - Compare text exactly.
    `ccs` - Compare text case sensitively.
  Returns:
    Choice instance.
  Throws:
    `TimeoutExpiredException` -
  See Also:
    `Operator.isCaptionEqual(String, String, boolean, boolean)`

### setOutput

    public void setOutput(TestOut out)

  Description copied from interface: `Outputable`
  Defines print output streams or writers.
  Specified by:
    `setOutput` in interface `Outputable`
  Overrides:
    `setOutput` in class `ComponentOperator`
  Following copied from interface: `org.netbeans.jemmy.Outputable`
  Parameters:
    `out` - 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 `ComponentOperator`
  Following copied from interface: `org.netbeans.jemmy.Outputable`
  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`
  Following copied from class: `org.netbeans.jemmy.operators.Operator`
  Parameters:
    `anotherOperator` - an operator to copy the environment to.

### findItemIndex

    public int findItemIndex(java.lang.String item,
                             int index)

  Finds an item between choice items.
  Parameters:
    `item` - a text pattern.
    `index` - an ordinal index between appropriate items.
  Returns:
    an item index.

### findItemIndex

    public int findItemIndex(java.lang.String item)

  Finds an item between choice items.
  Parameters:
    `item` - a text pattern.
  Returns:
    an item index.

### selectItem

    public void selectItem(java.lang.String item,
                           int index)

  Selects an item by text.
  Parameters:
    `item` - a text pattern.
    `index` - an ordinal index between appropriate items.

### selectItem

    public void selectItem(java.lang.String item)

  Selects an item by text.
  Parameters:
    `item` - a text pattern.

### selectItem

    public void selectItem(int index)

  Selects an item by index.
  Parameters:
    `index` - an item index.

### waitItemSelected

    public void waitItemSelected(int index)

  Waits for item to be selected.
  Parameters:
    `index` - Item index.

### getDump

    public java.util.Hashtable getDump()

  Returns information about component.
  Overrides:
    `getDump` in class `ComponentOperator`
  Following copied from class: `org.netbeans.jemmy.operators.Operator`
  Returns:
    a Hashtable containing name-value pairs.

### add

    public void add(java.lang.String item)

  Maps `Choice.add(String)` through queue

### addItemListener

    public void addItemListener(java.awt.event.ItemListener itemListener)

  Maps `Choice.addItemListener(ItemListener)` through queue

### addNotify

    public void addNotify()

  Maps `Choice.addNotify()` through queue
  Overrides:
    `addNotify` in class `ComponentOperator`

### getItem

    public java.lang.String getItem(int index)

  Maps `Choice.getItem(int)` through queue

### getItemCount

    public int getItemCount()

  Maps `Choice.getItemCount()` through queue

### getSelectedIndex

    public int getSelectedIndex()

  Maps `Choice.getSelectedIndex()` through queue

### getSelectedItem

    public java.lang.String getSelectedItem()

  Maps `Choice.getSelectedItem()` through queue

### insert

    public void insert(java.lang.String item,
                       int index)

  Maps `Choice.insert(String)` through queue

### remove

    public void remove(int position)

  Maps `Choice.remove(int)` through queue

### remove

    public void remove(java.lang.String item)

  Maps `Choice.remove(String)` through queue

### removeAll

    public void removeAll()

  Maps `Choice.removeAll()` through queue

### removeItemListener

    public void removeItemListener(java.awt.event.ItemListener itemListener)

  Maps `Choice.removeItemListener(ItemListener)` through queue

### select

    public void select(int pos)

  Maps `Choice.select(int)` through queue

### setState

    public void setState(java.lang.String str)

  Maps `Choice.select(String)` through queue

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD