Package org.netbeans.jemmy.operators
Class CheckboxOperator
- java.lang.Object
-
- org.netbeans.jemmy.operators.Operator
-
- org.netbeans.jemmy.operators.ComponentOperator
-
- org.netbeans.jemmy.operators.CheckboxOperator
-
- All Implemented Interfaces:
Outputable
,Timeoutable
public class CheckboxOperator extends ComponentOperator implements Outputable
Timeouts used:
ButtonOperator.PushButtonTimeout - time between checkbox pressing and releasing
ComponentOperator.WaitComponentTimeout - time to wait checkbox displayed
ComponentOperator.WaitComponentEnabledTimeout - time to wait checkbox enabled
.- Author:
- Alexandre Iline (alexandre.iline@sun.com)
- See Also:
Timeouts
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CheckboxOperator.CheckboxByLabelFinder
Allows to find component by label.static class
CheckboxOperator.CheckboxFinder
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
Fields Modifier and Type Field Description static String
TEXT_DPROP
Identifier for a label 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
Constructors Constructor Description CheckboxOperator(Checkbox b)
Constructor.CheckboxOperator(ContainerOperator cont)
Constructor.CheckboxOperator(ContainerOperator cont, int index)
Constructor.CheckboxOperator(ContainerOperator cont, String text)
Constructor.CheckboxOperator(ContainerOperator cont, String text, int index)
Constructor.CheckboxOperator(ContainerOperator cont, ComponentChooser chooser)
Constructs an CheckboxOperator object.CheckboxOperator(ContainerOperator cont, ComponentChooser chooser, int index)
Constructs an CheckboxOperator object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addItemListener(ItemListener itemListener)
MapsCheckbox.addItemListener(ItemListener)
through queuevoid
changeSelection(boolean newValue)
Changes selection if necessary.void
changeSelectionNoBlock(boolean selected)
RunschangeSelection(boolean)
method in a separate thread.void
copyEnvironment(Operator anotherOperator)
Copies all environment (output, timeouts, visualizer) from another operator.static Checkbox
findCheckbox(Container cont, String text, boolean ce, boolean ccs)
Searches Checkbox by text.static Checkbox
findCheckbox(Container cont, String text, boolean ce, boolean ccs, int index)
Searches Checkbox by text.static Checkbox
findCheckbox(Container cont, ComponentChooser chooser)
Searches 0'th Checkbox in container.static Checkbox
findCheckbox(Container cont, ComponentChooser chooser, int index)
Searches Checkbox in container.CheckboxGroup
getCheckboxGroup()
MapsCheckbox.getCheckboxGroup()
through queueHashtable
getDump()
Returns information about component.String
getLabel()
MapsCheckbox.getLabel()
through queueTestOut
getOutput()
Returns print output streams or writers.boolean
getState()
MapsCheckbox.getState()
through queuevoid
removeItemListener(ItemListener itemListener)
MapsCheckbox.removeItemListener(ItemListener)
through queuevoid
setCheckboxGroup(CheckboxGroup grp)
MapsCheckbox.setCheckboxGroup(CheckboxGroup)
through queuevoid
setLabel(String string)
MapsCheckbox.setLabel(String)
through queuevoid
setOutput(TestOut out)
Defines print output streams or writers.void
setState(boolean state)
MapsCheckbox.setState(boolean)
through queuestatic Checkbox
waitCheckbox(Container cont, String text, boolean ce, boolean ccs)
Waits Checkbox by text.static Checkbox
waitCheckbox(Container cont, String text, boolean ce, boolean ccs, int index)
Waits Checkbox by text.static Checkbox
waitCheckbox(Container cont, ComponentChooser chooser)
Waits 0'th Checkbox in container.static Checkbox
waitCheckbox(Container cont, ComponentChooser chooser, int index)
Waits Checkbox in container.void
waitSelected(boolean selected)
Waits for button to be selected.-
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, 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 Detail
-
TEXT_DPROP
public static final String TEXT_DPROP
Identifier for a label property.- See Also:
getDump()
, Constant Field Values
-
-
Constructor Detail
-
CheckboxOperator
public CheckboxOperator(Checkbox b)
Constructor.- Parameters:
b
- a component
-
CheckboxOperator
public CheckboxOperator(ContainerOperator cont, ComponentChooser chooser, int index)
Constructs an CheckboxOperator object.- Parameters:
cont
- containerchooser
- a component chooser specifying searching criteria.index
- an index between appropriate ones.
-
CheckboxOperator
public CheckboxOperator(ContainerOperator cont, ComponentChooser chooser)
Constructs an CheckboxOperator object.- Parameters:
cont
- containerchooser
- a component chooser specifying searching criteria.
-
CheckboxOperator
public CheckboxOperator(ContainerOperator cont, String text, int index)
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.- Parameters:
cont
- containertext
- Checkbox text.index
- Ordinal component index.- Throws:
TimeoutExpiredException
- See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)
-
CheckboxOperator
public CheckboxOperator(ContainerOperator cont, String text)
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.- Parameters:
cont
- containertext
- Checkbox text.- Throws:
TimeoutExpiredException
- See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)
-
CheckboxOperator
public CheckboxOperator(ContainerOperator cont, int index)
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
-
CheckboxOperator
public CheckboxOperator(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
-
findCheckbox
public static Checkbox findCheckbox(Container cont, ComponentChooser chooser, int index)
Searches Checkbox in container.- Parameters:
cont
- Container to search component in.chooser
- org.netbeans.jemmy.ComponentChooser implementation.index
- Ordinal component index.- Returns:
- Checkbox instance or null if component was not found.
-
findCheckbox
public static Checkbox findCheckbox(Container cont, ComponentChooser chooser)
Searches 0'th Checkbox in container.- Parameters:
cont
- Container to search component in.chooser
- org.netbeans.jemmy.ComponentChooser implementation.- Returns:
- Checkbox instance or null if component was not found.
-
findCheckbox
public static Checkbox findCheckbox(Container cont, String text, boolean ce, boolean ccs, int index)
Searches Checkbox by text.- Parameters:
cont
- Container to search component in.text
- Checkbox text. If null, contents is not checked.ce
- Compare text exactly.ccs
- Compare text case sensitively.index
- Ordinal component index.- Returns:
- Checkbox instance or null if component was not found.
- See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)
-
findCheckbox
public static Checkbox findCheckbox(Container cont, String text, boolean ce, boolean ccs)
Searches Checkbox by text.- Parameters:
cont
- Container to search component in.text
- Checkbox text. If null, contents is not checked.ce
- Compare text exactly.ccs
- Compare text case sensitively.- Returns:
- Checkbox instance or null if component was not found.
- See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)
-
waitCheckbox
public static Checkbox waitCheckbox(Container cont, ComponentChooser chooser, int index)
Waits Checkbox in container.- Parameters:
cont
- Container to search component in.chooser
- org.netbeans.jemmy.ComponentChooser implementation.index
- Ordinal component index.- Returns:
- Checkbox instance.
- Throws:
TimeoutExpiredException
-
waitCheckbox
public static Checkbox waitCheckbox(Container cont, ComponentChooser chooser)
Waits 0'th Checkbox in container.- Parameters:
cont
- Container to search component in.chooser
- org.netbeans.jemmy.ComponentChooser implementation.- Returns:
- Checkbox instance.
- Throws:
TimeoutExpiredException
-
waitCheckbox
public static Checkbox waitCheckbox(Container cont, String text, boolean ce, boolean ccs, int index)
Waits Checkbox by text.- Parameters:
cont
- Container to search component in.text
- Checkbox text. If null, contents is not checked.ce
- Compare text exactly.ccs
- Compare text case sensitively.index
- Ordinal component index.- Returns:
- Checkbox instance.
- Throws:
TimeoutExpiredException
- See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)
-
waitCheckbox
public static Checkbox waitCheckbox(Container cont, String text, boolean ce, boolean ccs)
Waits Checkbox by text.- Parameters:
cont
- Container to search component in.text
- Checkbox text. If null, contents is not checked.ce
- Compare text exactly.ccs
- Compare text case sensitively.- Returns:
- Checkbox 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 interfaceOutputable
- Overrides:
setOutput
in classComponentOperator
- 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 interfaceOutputable
- Overrides:
getOutput
in classComponentOperator
- 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 classComponentOperator
- Parameters:
anotherOperator
- an operator to copy the environment to.
-
changeSelection
public void changeSelection(boolean newValue)
Changes selection if necessary. Uses a ButtonDriver registered for this operator.- Parameters:
newValue
- a button selection.
-
changeSelectionNoBlock
public void changeSelectionNoBlock(boolean selected)
RunschangeSelection(boolean)
method in a separate thread.- Parameters:
selected
- a button selection.
-
waitSelected
public void waitSelected(boolean selected)
Waits for button to be selected.- Parameters:
selected
- selection.
-
getDump
public Hashtable getDump()
Returns information about component.- Overrides:
getDump
in classComponentOperator
- Returns:
- a Hashtable containing name-value pairs.
-
addItemListener
public void addItemListener(ItemListener itemListener)
MapsCheckbox.addItemListener(ItemListener)
through queue
-
getCheckboxGroup
public CheckboxGroup getCheckboxGroup()
MapsCheckbox.getCheckboxGroup()
through queue
-
getLabel
public String getLabel()
MapsCheckbox.getLabel()
through queue
-
getState
public boolean getState()
MapsCheckbox.getState()
through queue
-
removeItemListener
public void removeItemListener(ItemListener itemListener)
MapsCheckbox.removeItemListener(ItemListener)
through queue
-
setCheckboxGroup
public void setCheckboxGroup(CheckboxGroup grp)
MapsCheckbox.setCheckboxGroup(CheckboxGroup)
through queue
-
setLabel
public void setLabel(String string)
MapsCheckbox.setLabel(String)
through queue
-
setState
public void setState(boolean state)
MapsCheckbox.setState(boolean)
through queue
-
-