Class ButtonOperator
java.lang.Object
org.netbeans.jemmy.operators.Operator
org.netbeans.jemmy.operators.ComponentOperator
org.netbeans.jemmy.operators.ButtonOperator
- All Implemented Interfaces:
Outputable, Timeoutable
Timeouts used:
ButtonOperator.PushButtonTimeout - time between button pressing and releasing
ComponentOperator.WaitComponentTimeout - time to wait button displayed
ComponentOperator.WaitComponentEnabledTimeout - time to wait button 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
FieldsFields 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.ButtonOperator(ContainerOperator cont, int index) Constructor.ButtonOperator(ContainerOperator cont, String text) Constructor.ButtonOperator(ContainerOperator cont, String text, int index) Constructor.ButtonOperator(ContainerOperator cont, ComponentChooser chooser) Constructs a ButtonOperator object.ButtonOperator(ContainerOperator cont, ComponentChooser chooser, int index) Constructs a ButtonOperator object. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddActionListener(ActionListener actionListener) MapsButton.addActionListener(ActionListener)through queuevoidcopyEnvironment(Operator anotherOperator) Copies all environment (output, timeouts, visualizer) from another operator.static ButtonfindButton(Container cont, String text, boolean ce, boolean ccs) Searches Button by text.static ButtonfindButton(Container cont, String text, boolean ce, boolean ccs, int index) Searches Button by text.static ButtonfindButton(Container cont, ComponentChooser chooser) Searches for the first Button in a container.static ButtonfindButton(Container cont, ComponentChooser chooser, int index) Searches Button in a container.MapsButton.getActionCommand()through queuegetDump()Returns information about component.getLabel()MapsButton.getLabel()through queueReturns print output streams or writers.Return current timeouts.voidpress()Press the button by mouse.voidpush()Pushes the button by mouse click.voidRunspush()method in a separate thread.voidrelease()Releases the button by mouse.voidremoveActionListener(ActionListener actionListener) MapsButton.removeActionListener(ActionListener)through queuevoidsetActionCommand(String string) MapsButton.setActionCommand(String)through queuevoidMapsButton.setLabel(String)through queuevoid/////////////////////////////////////////////////////voidsetTimeouts(Timeouts timeouts) Defines current timeouts.static ButtonwaitButton(Container cont, String text, boolean ce, boolean ccs) Waits Button by text.static ButtonwaitButton(Container cont, String text, boolean ce, boolean ccs, int index) Waits Button by text.static ButtonwaitButton(Container cont, ComponentChooser chooser) Waits 0'th Button in container.static ButtonwaitButton(Container cont, ComponentChooser chooser, int index) Waits Button in container.Methods inherited from class 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, 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, 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
-
TEXT_DPROP
-
-
Constructor Details
-
ButtonOperator
Constructor.- Parameters:
b- Thejava.awt.Buttonmanaged by this instance.
-
ButtonOperator
Constructs a ButtonOperator object.- Parameters:
cont- containerchooser- a component chooser specifying searching criteria.index- an index between appropriate ones.
-
ButtonOperator
Constructs a ButtonOperator object.- Parameters:
cont- containerchooser- a component chooser specifying searching criteria.
-
ButtonOperator
Constructor. Waits for a component in a container to show. The component is identified as theindex+1'thjava.awt.Buttonthat shows, lies below the container in the display containment hierarchy, and that has the desired text. Uses cont's timeout and output for waiting and to init this operator.- Parameters:
cont- The operator for a container containing the sought for button.text- Button text.index- Ordinal component index. The first component hasindex0.- Throws:
TimeoutExpiredException- See Also:
-
ButtonOperator
Constructor. Waits for a component in a container to show. The component is identified as the firstjava.awt.Buttonthat shows, lies below the container in the display containment hierarchy, and that has the desired text. Uses cont's timeout and output for waiting and to init this operator.- Parameters:
cont- The operator for a container containing the sought for button.text- Button text.- Throws:
TimeoutExpiredException- See Also:
-
ButtonOperator
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.- Parameters:
cont- The operator for a container containing the sought for button.index- Ordinal component index.- Throws:
TimeoutExpiredException- See Also:
-
ButtonOperator
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.- Parameters:
cont- The operator for a container containing the sought for button.- Throws:
TimeoutExpiredException- See Also:
-
-
Method Details
-
findButton
Searches Button in a container.- Parameters:
cont- Container in which to search for the component. The container lies above the component in the display containment hierarchy. The containment need not be direct.chooser- org.netbeans.jemmy.ComponentChooser implementation, defining and applying search criteria.index- Ordinal component index. The firstindexis 0.- Returns:
- Button instance or null if component was not found.
-
findButton
Searches for the first Button in a container.- Parameters:
cont- Container in which to search for the component. The container lies above the component in the display containment hierarchy. The containment need not be direct.chooser- org.netbeans.jemmy.ComponentChooser implementation, defining and applying search criteria.- Returns:
- Button instance or null if component was not found.
-
findButton
Searches Button by text.- Parameters:
cont- Container to search component in.text- Button text. If null, contents is not checked.ce- Compare text exactly.ccs- Compare text case sensitively.index- Ordinal component index.- Returns:
- Button instance or null if component was not found.
- See Also:
-
findButton
Searches Button by text.- Parameters:
cont- Container to search component in.text- Button text. If null, contents is not checked.ce- Compare text exactly.ccs- Compare text case sensitively.- Returns:
- Button instance or null if component was not found.
- See Also:
-
waitButton
Waits Button in container.- Parameters:
cont- Container to search component in.chooser- org.netbeans.jemmy.ComponentChooser implementation.index- Ordinal component index.- Returns:
- Button instance.
- Throws:
TimeoutExpiredException
-
waitButton
Waits 0'th Button in container.- Parameters:
cont- Container to search component in.chooser- org.netbeans.jemmy.ComponentChooser implementation.- Returns:
- Button instance.
- Throws:
TimeoutExpiredException
-
waitButton
Waits Button by text.- Parameters:
cont- Container to search component in.text- Button text. If null, contents is not checked.ce- Compare text exactly.ccs- Compare text case sensitively.index- Ordinal component index.- Returns:
- Button instance.
- Throws:
TimeoutExpiredException- See Also:
-
waitButton
Waits Button by text.- Parameters:
cont- Container to search component in.text- Button text. If null, contents is not checked.ce- Compare text exactly.ccs- Compare text case sensitively.- Returns:
- Button instance.
- Throws:
TimeoutExpiredException- See Also:
-
setTimeouts
Description copied from interface:TimeoutableDefines current timeouts.- Specified by:
setTimeoutsin interfaceTimeoutable- Overrides:
setTimeoutsin classComponentOperator- Parameters:
timeouts- A collection of timeout assignments.- See Also:
-
getTimeouts
Description copied from interface:TimeoutableReturn current timeouts.- Specified by:
getTimeoutsin interfaceTimeoutable- Overrides:
getTimeoutsin classComponentOperator- Returns:
- the collection of current timeout assignments.
- 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.
-
push
-
pushNoBlock
public void pushNoBlock()Runspush()method in a separate thread. -
press
-
release
-
getDump
Returns information about component.- Overrides:
getDumpin classComponentOperator- Returns:
- a Hashtable containing name-value pairs.
-
addActionListener
MapsButton.addActionListener(ActionListener)through queue -
getActionCommand
MapsButton.getActionCommand()through queue -
getLabel
MapsButton.getLabel()through queue -
removeActionListener
MapsButton.removeActionListener(ActionListener)through queue -
setActionCommand
MapsButton.setActionCommand(String)through queue -
setLabel
MapsButton.setLabel(String)through queue
-