Package org.netbeans.jemmy.operators
Class JSpinnerOperator
java.lang.Object
org.netbeans.jemmy.operators.Operator
org.netbeans.jemmy.operators.ComponentOperator
org.netbeans.jemmy.operators.ContainerOperator
org.netbeans.jemmy.operators.JComponentOperator
org.netbeans.jemmy.operators.JSpinnerOperator
- All Implemented Interfaces:
Outputable
,Timeoutable
- Direct Known Subclasses:
JSpinnerOperator.DateSpinnerOperator
,JSpinnerOperator.ListSpinnerOperator
,JSpinnerOperator.NumberSpinnerOperator
Provides methods to work with
javax.swing.JSpinner
component - Author:
- Alexandre Iline (alexandre.iline@sun.com)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
AScrollAdjuster
to be used forJSpinner
component havingSpinnerDateModel
model.class
Provides some specific functionality forJSpinner
components havingSpinnerDateModel
model.static class
Class for a scrolling of a spinner having unknown model type.static class
Allows to find component by text.static class
Checks component type.static class
AScrollAdjuster
to be used forJSpinner
component havingSpinnerListModel
model.class
Provides some specific functionality forJSpinner
components havingSpinnerListModel
model.static class
AScrollAdjuster
to be used forJSpinner
component havingSpinnerNumberModel
model.class
Provides some specific functionality forJSpinner
components havingSpinnerNumberModel
model.static class
Abstract class for a scrolling of a spinner having unknown model type.static class
Exception is thown whenever spinner model is threated wrong.static class
Class for a scrolling of a spinner having unknown model type.Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.JComponentOperator
JComponentOperator.JComponentByTipFinder, JComponentOperator.JComponentFinder
Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.ContainerOperator
ContainerOperator.ContainerFinder
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
FieldsFields inherited from class org.netbeans.jemmy.operators.JComponentOperator
A11Y_DATA, A11Y_DESCRIPTION_DPROP, A11Y_NAME_DPROP, TOOLTIP_TEXT_DPROP
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.JSpinnerOperator
(ContainerOperator cont, int index) Constructor.JSpinnerOperator
(ContainerOperator cont, String text) Constructs a JSpinnerOperator object.JSpinnerOperator
(ContainerOperator cont, String text, int index) Constructs a JSpinnerOperator object.JSpinnerOperator
(ContainerOperator cont, ComponentChooser chooser) Constructs a JSpinnerOperator object.JSpinnerOperator
(ContainerOperator cont, ComponentChooser chooser, int index) Constructs a JSpinnerOperator object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChangeListener
(ChangeListener changeListener) MapsJSpinner.addChangeListener(ChangeListener)
through queuestatic void
checkModel
(JSpinnerOperator oper, Class modelClass) Checks operator's model type.void
MapsJSpinner.commitEdit()
through queuestatic JSpinner
findJSpinner
(Container cont) Searches 0'th JSpinner in container.static JSpinner
findJSpinner
(Container cont, int index) Searches JSpinner in container.static JSpinner
findJSpinner
(Container cont, ComponentChooser chooser) Searches 0'th JSpinner in container.static JSpinner
findJSpinner
(Container cont, ComponentChooser chooser, int index) Searches JSpinner in container.MapsJSpinner.getChangeListeners()
through queueReturns an instance ofDateSpinnerOperator
operator, the operator used forJSpinner
havingSpinnerDateModel
model.Returns an operator for a button used for value decreasing.getDump()
Returns information about component.MapsJSpinner.getEditor()
through queueReturns an operator for a button used for value increasing.Returns an instance ofListSpinnerOperator
operator, the operator used forJSpinner
havingSpinnerListModel
model.Returns a maximal value.Returns a minimal value.getModel()
MapsJSpinner.getModel()
through queueMapsJSpinner.getNextValue()
through queueReturns an instance ofNumberSpinnerOperator
operator, the operator used forJSpinner
havingSpinnerNumberModel
model.Returns print output streams or writers.MapsJSpinner.getPreviousValue()
through queueReturn current timeouts.getUI()
MapsJSpinner.getUI()
through queuegetValue()
MapsJSpinner.getValue()
through queuevoid
removeChangeListener
(ChangeListener changeListener) MapsJSpinner.removeChangeListener(ChangeListener)
through queuevoid
scrollTo
(ScrollAdjuster adj) Scrolls to reach a condition specified byScrollAdjuster
void
Scrolls to maximum value.void
Scrolls to minimum value.void
scrollToObject
(Object value, int direction) Scrolls to exact match of a spinner value to the specified value.void
scrollToString
(String pattern, int direction) Scrolls to matching ofgetValue().toString()
with the pattern.void
scrollToString
(String pattern, Operator.StringComparator comparator, int direction) Scrolls to matching ofgetValue().toString() with the pattern.
void
setEditor
(JComponent jComponent) MapsJSpinner.setEditor(JComponent)
through queuevoid
setModel
(SpinnerModel spinnerModel) MapsJSpinner.setModel(SpinnerModel)
through queuevoid
Defines print output streams or writers.void
setTimeouts
(Timeouts timeouts) Defines current timeouts.void
MapsJSpinner.setUI(SpinnerUI)
through queuevoid
MapsJSpinner.setValue(Object)
through queuestatic JSpinner
waitJSpinner
(Container cont) Waits 0'th JSpinner in container.static JSpinner
waitJSpinner
(Container cont, int index) Waits JSpinner in container.static JSpinner
waitJSpinner
(Container cont, ComponentChooser chooser) Waits 0'th JSpinner in container.static JSpinner
waitJSpinner
(Container cont, ComponentChooser chooser, int index) Waits JSpinner in container.Methods inherited from class org.netbeans.jemmy.operators.JComponentOperator
addAncestorListener, addVetoableChangeListener, computeVisibleRect, createToolTip, findJComponent, findJComponent, findJComponent, findJComponent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getAutoscrolls, getBorder, getCenterXForClick, getCenterYForClick, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getInsets, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVisibleRect, getWindowContainerOperator, grabFocus, isFocusCycleRoot, isManagingFocus, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, requestDefaultFocus, resetKeyboardActions, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, showToolTip, unregisterKeyboardAction, updateUI, waitJComponent, waitJComponent, waitJComponent, waitJComponent, waitToolTip
Methods inherited from class org.netbeans.jemmy.operators.ContainerOperator
add, add, add, add, add, addContainerListener, createSubOperator, createSubOperator, findComponentAt, findComponentAt, findContainer, findContainer, findContainer, findContainer, findContainerUnder, findContainerUnder, findSubComponent, findSubComponent, getComponent, getComponentCount, getComponents, getInsets, getLayout, isAncestorOf, paintComponents, printComponents, remove, remove, removeAll, removeContainerListener, setLayout, waitContainer, waitContainer, waitContainer, waitContainer, waitSubComponent, waitSubComponent
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, copyEnvironment, createImage, createImage, dispatchEvent, doLayout, dragMouse, dragMouse, dragMouse, dragNDrop, dragNDrop, dragNDrop, enableInputMethods, enterMouse, exitMouse, findComponent, findComponent, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getCenterX, getCenterY, 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, 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
-
VALUE_DPROP
Identifier for a "value" property.- See Also:
-
-
Constructor Details
-
JSpinnerOperator
Constructor.- Parameters:
b
- JSpinner component.
-
JSpinnerOperator
Constructs a JSpinnerOperator object.- Parameters:
cont
- a containerchooser
- a component chooser specifying searching criteria.index
- an index between appropriate ones.
-
JSpinnerOperator
Constructs a JSpinnerOperator object.- Parameters:
cont
- a containerchooser
- a component chooser specifying searching criteria.
-
JSpinnerOperator
Constructs a JSpinnerOperator object.- Parameters:
cont
- The operator for a container containing the sought for button.text
- toString() representation of the current spinner value.index
- Ordinal component index. The first component hasindex
0.
-
JSpinnerOperator
Constructs a JSpinnerOperator object.- Parameters:
cont
- The operator for a container containing the sought for button.text
- toString() representation of the current spinner value.
-
JSpinnerOperator
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.- Parameters:
cont
- Operator pointing a container to search component in.index
- Ordinal component index.
-
JSpinnerOperator
Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.- Parameters:
cont
- Operator pointing a container to search component in.
-
-
Method Details
-
findJSpinner
Searches JSpinner in container.- Parameters:
cont
- Container to search component in.chooser
- org.netbeans.jemmy.ComponentChooser implementation.index
- Ordinal component index.- Returns:
- JSpinner instance or null if component was not found.
-
findJSpinner
Searches 0'th JSpinner in container.- Parameters:
cont
- Container to search component in.chooser
- org.netbeans.jemmy.ComponentChooser implementation.- Returns:
- JSpinner instance or null if component was not found.
-
findJSpinner
Searches JSpinner in container.- Parameters:
cont
- Container to search component in.index
- Ordinal component index.- Returns:
- JSpinner instance or null if component was not found.
-
findJSpinner
Searches 0'th JSpinner in container.- Parameters:
cont
- Container to search component in.- Returns:
- JSpinner instance or null if component was not found.
-
waitJSpinner
Waits JSpinner in container.- Parameters:
cont
- Container to search component in.chooser
- org.netbeans.jemmy.ComponentChooser implementation.index
- Ordinal component index.- Returns:
- JSpinner instance or null if component was not displayed.
-
waitJSpinner
Waits 0'th JSpinner in container.- Parameters:
cont
- Container to search component in.chooser
- org.netbeans.jemmy.ComponentChooser implementation.- Returns:
- JSpinner instance or null if component was not displayed.
-
waitJSpinner
Waits JSpinner in container.- Parameters:
cont
- Container to search component in.index
- Ordinal component index.- Returns:
- JSpinner instance or null if component was not displayed.
-
waitJSpinner
Waits 0'th JSpinner in container.- Parameters:
cont
- Container to search component in.- Returns:
- JSpinner instance or null if component was not displayed.
-
checkModel
Checks operator's model type.- Parameters:
oper
- an operator to check modelmodelClass
- a model class.- Throws:
JSpinnerOperator.SpinnerModelException
- if an operator's model is not an instance of specified class.
-
setOutput
Description copied from interface:Outputable
Defines print output streams or writers.- Specified by:
setOutput
in interfaceOutputable
- Overrides:
setOutput
in classJComponentOperator
- 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 classJComponentOperator
- Returns:
- an object that contains references to objects for printing to output and err streams.
- See Also:
-
setTimeouts
Description copied from interface:Timeoutable
Defines current timeouts.- Specified by:
setTimeouts
in interfaceTimeoutable
- Overrides:
setTimeouts
in classJComponentOperator
- Parameters:
timeouts
- A collection of timeout assignments.- See Also:
-
getTimeouts
Description copied from interface:Timeoutable
Return current timeouts.- Specified by:
getTimeouts
in interfaceTimeoutable
- Overrides:
getTimeouts
in classJComponentOperator
- Returns:
- the collection of current timeout assignments.
- See Also:
-
getNumberSpinner
Returns an instance ofNumberSpinnerOperator
operator, the operator used forJSpinner
havingSpinnerNumberModel
model.- Returns:
- a
NumberSpinnerOperator
created for the sameJSpinner
as this operator. - Throws:
JSpinnerOperator.SpinnerModelException
- if an operator's model is not an instance ofSpinnerNumberModel
-
getListSpinner
Returns an instance ofListSpinnerOperator
operator, the operator used forJSpinner
havingSpinnerListModel
model.- Returns:
- a
ListSpinnerOperator
created for the sameJSpinner
as this operator. - Throws:
JSpinnerOperator.SpinnerModelException
- if an operator's model is not an instance ofSpinnerListModel
-
getDateSpinner
Returns an instance ofDateSpinnerOperator
operator, the operator used forJSpinner
havingSpinnerDateModel
model.- Returns:
- a
DateSpinnerOperator
created for the sameJSpinner
as this operator. - Throws:
JSpinnerOperator.SpinnerModelException
- if an operator's model is not an instance ofSpinnerDateModel
-
scrollTo
Scrolls to reach a condition specified byScrollAdjuster
- Parameters:
adj
- scrolling criteria.
-
scrollToMaximum
public void scrollToMaximum()Scrolls to maximum value.- Throws:
JSpinnerOperator.SpinnerModelException
- if an operator's model does not have a maximum value.
-
scrollToMinimum
public void scrollToMinimum()Scrolls to minimum value.- Throws:
JSpinnerOperator.SpinnerModelException
- if an operator's model does not have a minimum value.
-
scrollToObject
Scrolls to exact match of a spinner value to the specified value.- Parameters:
value
- an value to scroll to.direction
- a scrolling direction - one ofScrollAdjuster.*_SCROLL_DIRECTION
fields.
-
scrollToString
Scrolls to matching ofgetValue().toString() with the pattern.
- Parameters:
pattern
- a pattern to compare withcomparator
- a string comparision criteriadirection
- a scrolling direction - one ofScrollAdjuster.*_SCROLL_DIRECTION
fields.
-
scrollToString
Scrolls to matching ofgetValue().toString()
with the pattern. UsesStringComparator
assigned to the operator.- Parameters:
pattern
- a pattern to compare withdirection
- a scrolling direction - one ofScrollAdjuster.*_SCROLL_DIRECTION
fields.
-
getIncreaseOperator
Returns an operator for a button used for value increasing.- Returns:
- an operator for a first
JButton
inside this spinner.
-
getDecreaseOperator
Returns an operator for a button used for value decreasing.- Returns:
- an operator for a second
JButton
inside this spinner.
-
getMinimum
Returns a minimal value. Returns null if model is not one of the following:javax.swing.SpinnerDateModel
,javax.swing.SpinnerListModel
,javax.swing.SpinnerNumberModel
. Also, returns null if the model does not have a minimal value.- Returns:
- a minimal value.
-
getMaximum
Returns a maximal value. Returns null if model is not one of the following:javax.swing.SpinnerDateModel
,javax.swing.SpinnerListModel
,javax.swing.SpinnerNumberModel
. Also, returns null if the model does not have a maximal value.- Returns:
- a maximal value.
-
getDump
Description copied from class:ComponentOperator
Returns information about component.- Overrides:
getDump
in classJComponentOperator
- Returns:
- a Hashtable containing name-value pairs.
-
getValue
MapsJSpinner.getValue()
through queue -
setValue
MapsJSpinner.setValue(Object)
through queue -
getUI
MapsJSpinner.getUI()
through queue -
setUI
MapsJSpinner.setUI(SpinnerUI)
through queue -
setModel
MapsJSpinner.setModel(SpinnerModel)
through queue -
getModel
MapsJSpinner.getModel()
through queue -
getNextValue
MapsJSpinner.getNextValue()
through queue -
addChangeListener
MapsJSpinner.addChangeListener(ChangeListener)
through queue -
removeChangeListener
MapsJSpinner.removeChangeListener(ChangeListener)
through queue -
getChangeListeners
MapsJSpinner.getChangeListeners()
through queue -
getPreviousValue
MapsJSpinner.getPreviousValue()
through queue -
setEditor
MapsJSpinner.setEditor(JComponent)
through queue -
getEditor
MapsJSpinner.getEditor()
through queue -
commitEdit
public void commitEdit()MapsJSpinner.commitEdit()
through queue
-