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 classAllows to find component by label.static classChecks component type.Nested classes/interfaces inherited from class 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 StringIdentifier for a items properties.static final StringIdentifier for a selected item property.Fields inherited from class ComponentOperator
HEIGHT_DPROP, IS_SHOWING_DPROP, IS_VISIBLE_DPROP, NAME_DPROP, WIDTH_DPROP, X_DPROP, Y_DPROPFields inherited from class 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 TypeMethodDescriptionvoidMapsChoice.add(String)through queuevoidaddItemListener(ItemListener itemListener) MapsChoice.addItemListener(ItemListener)through queuevoidMapsChoice.addNotify()through queuevoidcopyEnvironment(Operator anotherOperator) Copies all environment (output, timeouts, visualizer) from another operator.static ChoicefindChoice(Container cont, String text, boolean ce, boolean ccs) Searches Choice by text.static ChoicefindChoice(Container cont, String text, boolean ce, boolean ccs, int index) Searches Choice by text.static ChoicefindChoice(Container cont, ComponentChooser chooser) Searches 0'th Choice in container.static ChoicefindChoice(Container cont, ComponentChooser chooser, int index) Searches Choice in container.intfindItemIndex(String item) Finds an item between choice items.intfindItemIndex(String item, int index) Finds an item between choice items.getDump()Returns information about component.getItem(int index) MapsChoice.getItem(int)through queueintMapsChoice.getItemCount()through queueReturns print output streams or writers.intMapsChoice.getSelectedIndex()through queueMapsChoice.getSelectedItem()through queuevoidMapsChoice.insert(String)through queuevoidremove(int position) MapsChoice.remove(int)through queuevoidMapsChoice.remove(String)through queuevoidMapsChoice.removeAll()through queuevoidremoveItemListener(ItemListener itemListener) MapsChoice.removeItemListener(ItemListener)through queuevoidselect(int pos) MapsChoice.select(int)through queuevoidselectItem(int index) Selects an item by index.voidselectItem(String item) Selects an item by text.voidselectItem(String item, int index) Selects an item by text.void/////////////////////////////////////////////////////voidMapsChoice.select(String)through queuestatic ChoicewaitChoice(Container cont, String text, boolean ce, boolean ccs) Waits Choice by text.static ChoicewaitChoice(Container cont, String text, boolean ce, boolean ccs, int index) Waits Choice by text.static ChoicewaitChoice(Container cont, ComponentChooser chooser) Waits 0'th Choice in container.static ChoicewaitChoice(Container cont, ComponentChooser chooser, int index) Waits Choice in container.voidwaitItemSelected(int index) Waits for item to be selected.Methods inherited from class 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, wtComponentEnabledMethods inherited from class 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
-
ITEM_PREFIX_DPROP
-
-
Constructor Details
-
ChoiceOperator
-
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 class:ComponentOperator/////////////////////////////////////////////////////- Specified by:
setOutputin interfaceOutputable- Overrides:
setOutputin classComponentOperator- Parameters:
out- Identify the streams or writers used for print output.- See Also:
-
getOutput
Description copied from interface:OutputableReturns print output streams or writers.- Specified by:
getOutputin interfaceOutputable- Overrides:
getOutputin classComponentOperator- Returns:
- an object that contains references to objects for printing to output and err streams.
- See Also:
-
copyEnvironment
Description copied from class:OperatorCopies all environment (output, timeouts, visualizer) from another operator.- Overrides:
copyEnvironmentin 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
-
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:
getDumpin 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:
addNotifyin 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
-