Package 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
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Allows to find component by label.static class
Checks component type.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
FieldsModifier and TypeFieldDescriptionstatic final String
Identifier for a items properties.static final String
Identifier for a selected item property.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
ConstructorsConstructorDescriptionConstructor.Constructor.ChoiceOperator
(ContainerOperator cont, int index) Constructor.ChoiceOperator
(ContainerOperator cont, String text) Constructor.ChoiceOperator
(ContainerOperator cont, String text, int index) Constructor.ChoiceOperator
(ContainerOperator cont, ComponentChooser chooser) Constructs a ChoiceOperator object.ChoiceOperator
(ContainerOperator cont, ComponentChooser chooser, int index) Constructs a ChoiceOperator object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
MapsChoice.add(String)
through queuevoid
addItemListener
(ItemListener itemListener) MapsChoice.addItemListener(ItemListener)
through queuevoid
MapsChoice.addNotify()
through queuevoid
copyEnvironment
(Operator anotherOperator) Copies all environment (output, timeouts, visualizer) from another operator.static Choice
findChoice
(Container cont, String text, boolean ce, boolean ccs) Searches Choice by text.static Choice
findChoice
(Container cont, String text, boolean ce, boolean ccs, int index) Searches Choice by text.static Choice
findChoice
(Container cont, ComponentChooser chooser) Searches 0'th Choice in container.static Choice
findChoice
(Container cont, ComponentChooser chooser, int index) Searches Choice in container.int
findItemIndex
(String item) Finds an item between choice items.int
findItemIndex
(String item, int index) Finds an item between choice items.getDump()
Returns information about component.getItem
(int index) MapsChoice.getItem(int)
through queueint
MapsChoice.getItemCount()
through queueReturns print output streams or writers.int
MapsChoice.getSelectedIndex()
through queueMapsChoice.getSelectedItem()
through queuevoid
MapsChoice.insert(String)
through queuevoid
remove
(int position) MapsChoice.remove(int)
through queuevoid
MapsChoice.remove(String)
through queuevoid
MapsChoice.removeAll()
through queuevoid
removeItemListener
(ItemListener itemListener) MapsChoice.removeItemListener(ItemListener)
through queuevoid
select
(int pos) MapsChoice.select(int)
through queuevoid
selectItem
(int index) Selects an item by index.void
selectItem
(String item) Selects an item by text.void
selectItem
(String item, int index) Selects an item by text.void
Defines print output streams or writers.void
MapsChoice.select(String)
through queuestatic Choice
waitChoice
(Container cont, String text, boolean ce, boolean ccs) Waits Choice by text.static Choice
waitChoice
(Container cont, String text, boolean ce, boolean ccs, int index) Waits Choice by text.static Choice
waitChoice
(Container cont, ComponentChooser chooser) Waits 0'th Choice in container.static Choice
waitChoice
(Container cont, ComponentChooser chooser, int index) Waits Choice in container.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, 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
-
Field Details
-
SELECTED_ITEM_DPROP
Identifier for a selected item property.- See Also:
-
ITEM_PREFIX_DPROP
Identifier for a items properties.- See Also:
-
-
Constructor Details
-
ChoiceOperator
Constructor.- Parameters:
b
- a component
-
ChoiceOperator
Constructs a ChoiceOperator object.- Parameters:
cont
- containerchooser
- a component chooser specifying searching criteria.index
- an index between appropriate ones.
-
ChoiceOperator
Constructs a ChoiceOperator object.- Parameters:
cont
- containerchooser
- a component chooser specifying searching criteria.
-
ChoiceOperator
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.- Parameters:
cont
- containertext
- Choice text.index
- Ordinal component index.- Throws:
TimeoutExpiredException
- See Also:
-
ChoiceOperator
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.- Parameters:
cont
- containertext
- Choice text.- Throws:
TimeoutExpiredException
- See Also:
-
ChoiceOperator
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.- Parameters:
cont
- containerindex
- Ordinal component index.- Throws:
TimeoutExpiredException
-
ChoiceOperator
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.- Parameters:
cont
- container- Throws:
TimeoutExpiredException
-
-
Method Details
-
findChoice
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
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
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:
-
findChoice
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:
-
waitChoice
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
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
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:
-
waitChoice
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:
-
setOutput
Description copied from interface:Outputable
Defines print output streams or writers.- Specified by:
setOutput
in interfaceOutputable
- Overrides:
setOutput
in classComponentOperator
- Parameters:
out
- Identify the streams or writers used for print output.- See Also:
-
getOutput
Description copied from interface:Outputable
Returns print output streams or writers.- Specified by:
getOutput
in interfaceOutputable
- Overrides:
getOutput
in classComponentOperator
- Returns:
- an object that contains references to objects for printing to output and err streams.
- See Also:
-
copyEnvironment
Description copied from class:Operator
Copies all environment (output, timeouts, visualizer) from another operator.- Overrides:
copyEnvironment
in classComponentOperator
- Parameters:
anotherOperator
- an operator to copy the environment to.
-
findItemIndex
Finds an item between choice items.- Parameters:
item
- a text pattern.index
- an ordinal index between appropriate items.- Returns:
- an item index.
-
findItemIndex
Finds an item between choice items.- Parameters:
item
- a text pattern.- Returns:
- an item index.
-
selectItem
Selects an item by text.- Parameters:
item
- a text pattern.index
- an ordinal index between appropriate items.
-
selectItem
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
Returns information about component.- Overrides:
getDump
in classComponentOperator
- Returns:
- a Hashtable containing name-value pairs.
-
add
MapsChoice.add(String)
through queue -
addItemListener
MapsChoice.addItemListener(ItemListener)
through queue -
addNotify
public void addNotify()MapsChoice.addNotify()
through queue- Overrides:
addNotify
in classComponentOperator
-
getItem
MapsChoice.getItem(int)
through queue -
getItemCount
public int getItemCount()MapsChoice.getItemCount()
through queue -
getSelectedIndex
public int getSelectedIndex()MapsChoice.getSelectedIndex()
through queue -
getSelectedItem
MapsChoice.getSelectedItem()
through queue -
insert
MapsChoice.insert(String)
through queue -
remove
public void remove(int position) MapsChoice.remove(int)
through queue -
remove
MapsChoice.remove(String)
through queue -
removeAll
public void removeAll()MapsChoice.removeAll()
through queue -
removeItemListener
MapsChoice.removeItemListener(ItemListener)
through queue -
select
public void select(int pos) MapsChoice.select(int)
through queue -
setState
MapsChoice.select(String)
through queue
-