Package org.netbeans.jemmy.operators
Class ScrollbarOperator
- java.lang.Object
-
- org.netbeans.jemmy.operators.Operator
-
- org.netbeans.jemmy.operators.ComponentOperator
-
- org.netbeans.jemmy.operators.ScrollbarOperator
-
- All Implemented Interfaces:
Outputable,Timeoutable
public class ScrollbarOperator extends ComponentOperator implements Timeoutable, Outputable
Timeouts used:
ScrollbarOperator.WholeScrollTimeout - time for one scroll click
ComponentOperator.WaitComponentTimeout - time to wait component displayed
.- Author:
- Alexandre Iline (alexandre.iline@sun.com)
- See Also:
Timeouts
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classScrollbarOperator.ScrollbarFinderChecks 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 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 ScrollbarOperator(java.awt.Scrollbar b)Constructs a ScrollbarOperator object.ScrollbarOperator(ContainerOperator cont)Constructs a ScrollbarOperator object.ScrollbarOperator(ContainerOperator cont, int index)Constructs a ScrollbarOperator object.ScrollbarOperator(ContainerOperator cont, ComponentChooser chooser)Constructs a ScrollbarOperator object.ScrollbarOperator(ContainerOperator cont, ComponentChooser chooser, int index)Constructs a ScrollbarOperator object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAdjustmentListener(java.awt.event.AdjustmentListener adjustmentListener)MapsScrollbar.addAdjustmentListener(AdjustmentListener)through queuevoidcopyEnvironment(Operator anotherOperator)Copies all environment (output, timeouts, visualizer) from another operator.static java.awt.ScrollbarfindScrollbar(java.awt.Container cont)Finds a scrollbar.static java.awt.ScrollbarfindScrollbar(java.awt.Container cont, int index)Finds a scrollbar.static java.awt.ScrollbarfindScrollbar(java.awt.Container cont, ComponentChooser chooser)Finds a scrollbar.static java.awt.ScrollbarfindScrollbar(java.awt.Container cont, ComponentChooser chooser, int index)Finds a scrollbar.intgetBlockIncrement()MapsScrollbar.getBlockIncrement()through queueintgetMaximum()MapsScrollbar.getMaximum()through queueintgetMinimum()MapsScrollbar.getMinimum()through queueintgetOrientation()MapsScrollbar.getOrientation()through queueTestOutgetOutput()Returns print output streams or writers.TimeoutsgetTimeouts()Return current timeouts.intgetUnitIncrement()MapsScrollbar.getUnitIncrement()through queueintgetValue()MapsScrollbar.getValue()through queueintgetVisibleAmount()MapsScrollbar.getVisibleAmount()through queuevoidremoveAdjustmentListener(java.awt.event.AdjustmentListener adjustmentListener)MapsScrollbar.removeAdjustmentListener(AdjustmentListener)through queuevoidscrollTo(ScrollAdjuster adj)Scrolls scrollbar to the position defined by a ScrollAdjuster implementation.voidscrollTo(Waitable w, java.lang.Object waiterParam, boolean increase)Scrolls scrollbar to the position defined by w parameter.voidscrollToMaximum()Scrolls to maximum value.voidscrollToMinimum()Scrolls to minimum value.voidscrollToValue(double proportionalValue)Scrolls scroll bar to necessary proportional value.voidscrollToValue(int value)Scrolls scroll bar to necessary value.voidsetBlockIncrement(int i)MapsScrollbar.setBlockIncrement(int)through queuevoidsetMaximum(int i)MapsScrollbar.setMaximum(int)through queuevoidsetMinimum(int i)MapsScrollbar.setMinimum(int)through queuevoidsetOrientation(int i)MapsScrollbar.setOrientation(int)through queuevoidsetOutput(TestOut out)Defines print output streams or writers.voidsetTimeouts(Timeouts timeouts)Defines current timeouts.voidsetUnitIncrement(int i)MapsScrollbar.setUnitIncrement(int)through queuevoidsetValue(int i)MapsScrollbar.setValue(int)through queuevoidsetValues(int i, int i1, int i2, int i3)MapsScrollbar.setValues(int, int, int, int)through queuevoidsetVisibleAmount(int i)MapsScrollbar.setVisibleAmount(int)through queuestatic java.awt.ScrollbarwaitScrollbar(java.awt.Container cont)Waits a scrollbar.static java.awt.ScrollbarwaitScrollbar(java.awt.Container cont, int index)Waits a scrollbar.static java.awt.ScrollbarwaitScrollbar(java.awt.Container cont, ComponentChooser chooser)Waits a scrollbar.static java.awt.ScrollbarwaitScrollbar(java.awt.Container cont, ComponentChooser chooser, int index)Waits a scrollbar.-
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, getDump, 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, 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
-
-
-
-
Constructor Detail
-
ScrollbarOperator
public ScrollbarOperator(java.awt.Scrollbar b)
Constructs a ScrollbarOperator object.- Parameters:
b- a component
-
ScrollbarOperator
public ScrollbarOperator(ContainerOperator cont, ComponentChooser chooser, int index)
Constructs a ScrollbarOperator object.- Parameters:
cont- a containerchooser- a component chooser specifying searching criteria.index- an index between appropriate ones.
-
ScrollbarOperator
public ScrollbarOperator(ContainerOperator cont, ComponentChooser chooser)
Constructs a ScrollbarOperator object.- Parameters:
cont- a containerchooser- a component chooser specifying searching criteria.
-
ScrollbarOperator
public ScrollbarOperator(ContainerOperator cont, int index)
Constructs a ScrollbarOperator object.- Parameters:
cont- a containerindex- an index between appropriate ones.
-
ScrollbarOperator
public ScrollbarOperator(ContainerOperator cont)
Constructs a ScrollbarOperator object.- Parameters:
cont- a container
-
-
Method Detail
-
findScrollbar
public static java.awt.Scrollbar findScrollbar(java.awt.Container cont, ComponentChooser chooser, int index)Finds a scrollbar.- Parameters:
cont- a containerchooser- a component chooser specifying searching criteria.index- an index between appropriate ones.- Returns:
- the scrollbar fitting searching criteria
-
findScrollbar
public static java.awt.Scrollbar findScrollbar(java.awt.Container cont, ComponentChooser chooser)Finds a scrollbar.- Parameters:
cont- a containerchooser- a component chooser specifying searching criteria.- Returns:
- the scrollbar fitting searching criteria
-
findScrollbar
public static java.awt.Scrollbar findScrollbar(java.awt.Container cont, int index)Finds a scrollbar.- Parameters:
cont- a containerindex- an index between appropriate ones.- Returns:
- the scrollbar fitting searching criteria
-
findScrollbar
public static java.awt.Scrollbar findScrollbar(java.awt.Container cont)
Finds a scrollbar.- Parameters:
cont- a container- Returns:
- the scrollbar fitting searching criteria
-
waitScrollbar
public static java.awt.Scrollbar waitScrollbar(java.awt.Container cont, ComponentChooser chooser, int index)Waits a scrollbar.- Parameters:
cont- a containerchooser- a component chooser specifying searching criteria.index- an index between appropriate ones.- Returns:
- the scrollbar fitting searching criteria
-
waitScrollbar
public static java.awt.Scrollbar waitScrollbar(java.awt.Container cont, ComponentChooser chooser)Waits a scrollbar.- Parameters:
cont- a containerchooser- a component chooser specifying searching criteria.- Returns:
- the scrollbar fitting searching criteria
-
waitScrollbar
public static java.awt.Scrollbar waitScrollbar(java.awt.Container cont, int index)Waits a scrollbar.- Parameters:
cont- a containerindex- an index between appropriate ones.- Returns:
- the scrollbar fitting searching criteria
-
waitScrollbar
public static java.awt.Scrollbar waitScrollbar(java.awt.Container cont)
Waits a scrollbar.- Parameters:
cont- a container- Returns:
- the scrollbar fitting searching criteria
-
setOutput
public void setOutput(TestOut out)
Description copied from interface:OutputableDefines print output streams or writers.- Specified by:
setOutputin interfaceOutputable- Overrides:
setOutputin classComponentOperator- Parameters:
out- Identify the streams or writers used for print output.- See Also:
Outputable.getOutput()
-
getOutput
public TestOut 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:
Outputable.setOutput(org.netbeans.jemmy.TestOut)
-
setTimeouts
public void setTimeouts(Timeouts timeouts)
Description copied from interface:TimeoutableDefines current timeouts.- Specified by:
setTimeoutsin interfaceTimeoutable- Overrides:
setTimeoutsin classComponentOperator- Parameters:
timeouts- A collection of timeout assignments.- See Also:
Timeoutable.getTimeouts()
-
getTimeouts
public Timeouts getTimeouts()
Description copied from interface:TimeoutableReturn current timeouts.- Specified by:
getTimeoutsin interfaceTimeoutable- Overrides:
getTimeoutsin classComponentOperator- Returns:
- the collection of current timeout assignments.
- See Also:
Timeoutable.setTimeouts(org.netbeans.jemmy.Timeouts)
-
copyEnvironment
public void copyEnvironment(Operator anotherOperator)
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.
-
scrollTo
public void scrollTo(Waitable w, java.lang.Object waiterParam, boolean increase)
Scrolls scrollbar to the position defined by w parameter. Uses ScrollDriver registered to this operator type.- Parameters:
w- Scrolling is stopped when w.actionProduced(waiterParam) != nullwaiterParam- a waiting parameter.increase- a scrolling direction.- Throws:
TimeoutExpiredException
-
scrollTo
public void scrollTo(ScrollAdjuster adj)
Scrolls scrollbar to the position defined by a ScrollAdjuster implementation.- Parameters:
adj- defines scrolling direction, and so on.- Throws:
TimeoutExpiredException
-
scrollToValue
public void scrollToValue(int value)
Scrolls scroll bar to necessary value.- Parameters:
value- Scroll bar value to scroll to.- Throws:
TimeoutExpiredException
-
scrollToValue
public void scrollToValue(double proportionalValue)
Scrolls scroll bar to necessary proportional value.- Parameters:
proportionalValue- Proportional scroll to. Must be >= 0 and <= 1.- Throws:
TimeoutExpiredException
-
scrollToMinimum
public void scrollToMinimum()
Scrolls to minimum value.- Throws:
TimeoutExpiredException
-
scrollToMaximum
public void scrollToMaximum()
Scrolls to maximum value.- Throws:
TimeoutExpiredException
-
addAdjustmentListener
public void addAdjustmentListener(java.awt.event.AdjustmentListener adjustmentListener)
MapsScrollbar.addAdjustmentListener(AdjustmentListener)through queue
-
getBlockIncrement
public int getBlockIncrement()
MapsScrollbar.getBlockIncrement()through queue
-
getMaximum
public int getMaximum()
MapsScrollbar.getMaximum()through queue
-
getMinimum
public int getMinimum()
MapsScrollbar.getMinimum()through queue
-
getOrientation
public int getOrientation()
MapsScrollbar.getOrientation()through queue
-
getUnitIncrement
public int getUnitIncrement()
MapsScrollbar.getUnitIncrement()through queue
-
getValue
public int getValue()
MapsScrollbar.getValue()through queue
-
getVisibleAmount
public int getVisibleAmount()
MapsScrollbar.getVisibleAmount()through queue
-
removeAdjustmentListener
public void removeAdjustmentListener(java.awt.event.AdjustmentListener adjustmentListener)
MapsScrollbar.removeAdjustmentListener(AdjustmentListener)through queue
-
setBlockIncrement
public void setBlockIncrement(int i)
MapsScrollbar.setBlockIncrement(int)through queue
-
setMaximum
public void setMaximum(int i)
MapsScrollbar.setMaximum(int)through queue
-
setMinimum
public void setMinimum(int i)
MapsScrollbar.setMinimum(int)through queue
-
setOrientation
public void setOrientation(int i)
MapsScrollbar.setOrientation(int)through queue
-
setUnitIncrement
public void setUnitIncrement(int i)
MapsScrollbar.setUnitIncrement(int)through queue
-
setValue
public void setValue(int i)
MapsScrollbar.setValue(int)through queue
-
setValues
public void setValues(int i, int i1, int i2, int i3)MapsScrollbar.setValues(int, int, int, int)through queue
-
setVisibleAmount
public void setVisibleAmount(int i)
MapsScrollbar.setVisibleAmount(int)through queue
-
-