Package org.netbeans.jemmy.operators
Class JDialogOperator
-
- All Implemented Interfaces:
Outputable
,Timeoutable
public class JDialogOperator extends DialogOperator
Timeouts used:
DialogWaiter.WaitDialogTimeout - time to wait dialog displayed
DialogWaiter.AfterDialogTimeout - time to sleep after dialog has been dispayed
.- Author:
- Alexandre Iline (alexandre.iline@sun.com)
- See Also:
Timeouts
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JDialogOperator.JDialogFinder
Checks component type.-
Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.DialogOperator
DialogOperator.DialogByTitleFinder, DialogOperator.DialogFinder
-
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
-
Fields inherited from class org.netbeans.jemmy.operators.DialogOperator
IS_MODAL_DPROP, IS_RESIZABLE_DPROP, TITLE_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
Constructors Constructor Description JDialogOperator()
Constructor.JDialogOperator(int index)
Constructor.JDialogOperator(String title)
Constructor.JDialogOperator(String title, int index)
Constructor.JDialogOperator(String title, int index, Operator env)
Constructor.JDialogOperator(JDialog w)
Constructor.JDialogOperator(ComponentChooser chooser)
Constructs a JDialogOperator object.JDialogOperator(ComponentChooser chooser, int index)
Constructs a JDialogOperator object.JDialogOperator(ComponentChooser chooser, int index, Operator env)
Constructs a JDialogOperator object.JDialogOperator(WindowOperator owner)
Constructor.JDialogOperator(WindowOperator owner, int index)
Constructor.JDialogOperator(WindowOperator owner, String title)
Constructor.JDialogOperator(WindowOperator owner, String title, int index)
Constructor.JDialogOperator(WindowOperator owner, ComponentChooser chooser)
Constructs a JDialogOperator object.JDialogOperator(WindowOperator owner, ComponentChooser chooser, int index)
Constructs a JDialogOperator object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JDialog
findJDialog(Window owner, String title, boolean ce, boolean cc)
Searches a dialog by title between owner's owned windows.static JDialog
findJDialog(Window owner, String title, boolean ce, boolean cc, int index)
Searches an index'th dialog by title between owner's owned windows.static JDialog
findJDialog(Window owner, ComponentChooser chooser)
Searches a dialog between owner's owned windows.static JDialog
findJDialog(Window owner, ComponentChooser chooser, int index)
Searches an index'th dialog between owner's owned windows.static JDialog
findJDialog(String title, boolean ce, boolean cc)
Searches a dialog by title.static JDialog
findJDialog(String title, boolean ce, boolean cc, int index)
Searches an index'th dialog by title.static JDialog
findJDialog(ComponentChooser chooser)
Searches a dialog.static JDialog
findJDialog(ComponentChooser chooser, int index)
Searches an index'th dialog.AccessibleContext
getAccessibleContext()
MapsJDialog.getAccessibleContext()
through queueContainer
getContentPane()
MapsJDialog.getContentPane()
through queueint
getDefaultCloseOperation()
MapsJDialog.getDefaultCloseOperation()
through queueComponent
getGlassPane()
MapsJDialog.getGlassPane()
through queueJMenuBar
getJMenuBar()
MapsJDialog.getJMenuBar()
through queueJLayeredPane
getLayeredPane()
MapsJDialog.getLayeredPane()
through queueJRootPane
getRootPane()
MapsJDialog.getRootPane()
through queuestatic Dialog
getTopModalDialog()
Searhs for modal dialog currently staying on top.void
setContentPane(Container container)
MapsJDialog.setContentPane(Container)
through queuevoid
setDefaultCloseOperation(int i)
MapsJDialog.setDefaultCloseOperation(int)
through queuevoid
setGlassPane(Component component)
MapsJDialog.setGlassPane(Component)
through queuevoid
setJMenuBar(JMenuBar jMenuBar)
MapsJDialog.setJMenuBar(JMenuBar)
through queuevoid
setLayeredPane(JLayeredPane jLayeredPane)
MapsJDialog.setLayeredPane(JLayeredPane)
through queuevoid
setLocationRelativeTo(Component component)
MapsJDialog.setLocationRelativeTo(Component)
through queuestatic JDialog
waitJDialog(Window owner, String title, boolean ce, boolean cc)
Waits a dialog by title between owner's owned windows.static JDialog
waitJDialog(Window owner, String title, boolean ce, boolean cc, int index)
Waits an index'th dialog by title between owner's owned windows.static JDialog
waitJDialog(Window owner, ComponentChooser chooser)
Waits a dialog between owner's owned windows.static JDialog
waitJDialog(Window owner, ComponentChooser chooser, int index)
Waits an index'th dialog between owner's owned windows.protected static JDialog
waitJDialog(Window owner, ComponentChooser chooser, int index, Timeouts timeouts, TestOut output)
A method to be used from subclasses.static JDialog
waitJDialog(String title, boolean ce, boolean cc)
Waits a dialog by title.static JDialog
waitJDialog(String title, boolean ce, boolean cc, int index)
Waits an index'th dialog by title.static JDialog
waitJDialog(ComponentChooser chooser)
Waits a dialog.static JDialog
waitJDialog(ComponentChooser chooser, int index)
Waits an index'th dialog.protected static JDialog
waitJDialog(ComponentChooser chooser, int index, Timeouts timeouts, TestOut output)
A method to be used from subclasses.protected static JDialog
waitJDialog(WindowOperator owner, ComponentChooser chooser, int index)
A method to be used from subclasses.-
Methods inherited from class org.netbeans.jemmy.operators.DialogOperator
getDump, getTitle, isModal, isResizable, setModal, setResizable, setTitle, waitDialog, waitDialog, waitDialog, waitTitle
-
Methods inherited from class org.netbeans.jemmy.operators.WindowOperator
activate, addWindowListener, applyResourceBundle, applyResourceBundle, close, copyEnvironment, dispose, findSubWindow, findSubWindow, findWindow, findWindow, findWindow, findWindow, getFocusOwner, getOutput, getOwnedWindows, getOwner, getWarningString, isActive, isFocused, move, pack, removeWindowListener, requestClose, requestCloseAndThenHide, resize, setOutput, toBack, toFront, waitClosed, waitSubWindow, waitSubWindow, waitWindow, waitWindow, waitWindow, waitWindow, waitWindow, waitWindow, waitWindow
-
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, getTimeouts, isAncestorOf, paintComponents, printComponents, remove, remove, removeAll, removeContainerListener, setLayout, setTimeouts, 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, 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, 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
-
JDialogOperator
public JDialogOperator(JDialog w)
Constructor.- Parameters:
w
- a component
-
JDialogOperator
public JDialogOperator(ComponentChooser chooser, int index, Operator env)
Constructs a JDialogOperator object.- Parameters:
chooser
- a component chooser specifying searching criteria.index
- an index between appropriate ones.env
- an operator to copy environment from.
-
JDialogOperator
public JDialogOperator(ComponentChooser chooser, int index)
Constructs a JDialogOperator object.- Parameters:
chooser
- a component chooser specifying searching criteria.index
- an index between appropriate ones.
-
JDialogOperator
public JDialogOperator(ComponentChooser chooser)
Constructs a JDialogOperator object.- Parameters:
chooser
- a component chooser specifying searching criteria.
-
JDialogOperator
public JDialogOperator(WindowOperator owner, ComponentChooser chooser, int index)
Constructs a JDialogOperator object.- Parameters:
owner
- window - ownerchooser
- a component chooser specifying searching criteria.index
- an index between appropriate ones.
-
JDialogOperator
public JDialogOperator(WindowOperator owner, ComponentChooser chooser)
Constructs a JDialogOperator object.- Parameters:
owner
- window - ownerchooser
- a component chooser specifying searching criteria.
-
JDialogOperator
public JDialogOperator(WindowOperator owner, String title, int index)
Constructor. Waits for the dialog with "title" subtitle. Uses owner's timeout and output for waiting and to init operator.- Parameters:
owner
- Operator pointing to a window owner.title
- The desired title.index
- Ordinal index. The first dialog hasindex
0.- See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)
-
JDialogOperator
public JDialogOperator(WindowOperator owner, String title)
Constructor. Waits for the dialog with "title" subtitle. Uses owner's timeout and output for waiting and to init operator.- Parameters:
owner
- Operator pointing to a window owner.title
- The desired title.- See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)
-
JDialogOperator
public JDialogOperator(WindowOperator owner, int index)
Constructor. Waits for the index'th dialog between owner's children. Uses owner'th timeout and output for waiting and to init operator.- Parameters:
owner
- Operator pointing to a window owner.index
- Ordinal component index.
-
JDialogOperator
public JDialogOperator(WindowOperator owner)
Constructor. Waits for the first dialog between owner's children. Uses owner'th timeout and output for waiting and to init operator.- Parameters:
owner
- Operator pointing to a window owner.
-
JDialogOperator
public JDialogOperator(String title, int index, Operator env)
Constructor. Waits for the dialog with "title" subtitle. Constructor can be used in complicated cases when output or timeouts should differ from default.- Parameters:
title
- a window titleindex
- Ordinal component index.env
- an operator to copy environment from.- See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)
-
JDialogOperator
public JDialogOperator(String title, int index)
Constructor. Waits for the dialog with "title" subtitle. Uses current timeouts and output values.- Parameters:
title
- a window titleindex
- Ordinal component index.- See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)
,JemmyProperties.getCurrentTimeouts()
,JemmyProperties.getCurrentOutput()
-
JDialogOperator
public JDialogOperator(String title)
Constructor. Waits for the dialog with "title" subtitle. Uses current timeouts and output values.- Parameters:
title
- a window title- See Also:
Operator.isCaptionEqual(String, String, boolean, boolean)
,JemmyProperties.getCurrentTimeouts()
,JemmyProperties.getCurrentOutput()
-
JDialogOperator
public JDialogOperator(int index)
Constructor. Waits for the index'th dialog. Uses current timeout and output for waiting and to init operator.- Parameters:
index
- Ordinal component index.
-
JDialogOperator
public JDialogOperator()
Constructor. Waits for the first dialog. Uses current timeout and output for waiting and to init operator.
-
-
Method Detail
-
findJDialog
public static JDialog findJDialog(ComponentChooser chooser, int index)
Searches an index'th dialog.- Parameters:
chooser
- a component chooser specifying searching criteria.index
- an index between appropriate ones.- Returns:
- JDialog instance or null if component was not found.
-
findJDialog
public static JDialog findJDialog(ComponentChooser chooser)
Searches a dialog.- Parameters:
chooser
- a component chooser specifying searching criteria.- Returns:
- JDialog instance or null if component was not found.
-
findJDialog
public static JDialog findJDialog(String title, boolean ce, boolean cc, int index)
Searches an index'th dialog by title.- Parameters:
title
- Dialog titlece
- Compare exactly. If true, text can be a substring of caption.cc
- Compare case sensitively. If true, both text and caption areindex
- an index between appropriate ones.- Returns:
- JDialog instance or null if component was not found.
-
findJDialog
public static JDialog findJDialog(String title, boolean ce, boolean cc)
Searches a dialog by title.- Parameters:
title
- Dialog titlece
- Compare exactly. If true, text can be a substring of caption.cc
- Compare case sensitively. If true, both text and caption are- Returns:
- JDialog instance or null if component was not found.
-
findJDialog
public static JDialog findJDialog(Window owner, ComponentChooser chooser, int index)
Searches an index'th dialog between owner's owned windows.- Parameters:
owner
- Window - dialog owner.chooser
- a component chooser specifying searching criteria.index
- an index between appropriate ones.- Returns:
- JDialog instance or null if component was not found.
-
findJDialog
public static JDialog findJDialog(Window owner, ComponentChooser chooser)
Searches a dialog between owner's owned windows.- Parameters:
owner
- Window - dialog owner.chooser
- a component chooser specifying searching criteria.- Returns:
- JDialog instance or null if component was not found.
-
findJDialog
public static JDialog findJDialog(Window owner, String title, boolean ce, boolean cc, int index)
Searches an index'th dialog by title between owner's owned windows.- Parameters:
owner
- Window - dialog owner.title
- Dialog titlece
- Compare exactly. If true, text can be a substring of caption.cc
- Compare case sensitively. If true, both text and caption areindex
- an index between appropriate ones.- Returns:
- JDialog instance or null if component was not found.
-
findJDialog
public static JDialog findJDialog(Window owner, String title, boolean ce, boolean cc)
Searches a dialog by title between owner's owned windows.- Parameters:
owner
- Window - dialog owner.title
- Dialog titlece
- Compare exactly. If true, text can be a substring of caption.cc
- Compare case sensitively. If true, both text and caption are- Returns:
- JDialog instance or null if component was not found.
-
waitJDialog
public static JDialog waitJDialog(ComponentChooser chooser, int index)
Waits an index'th dialog.- Parameters:
chooser
- a component chooser specifying searching criteria.index
- an index between appropriate ones.- Returns:
- JDialog instance or null if component was not found.
-
waitJDialog
public static JDialog waitJDialog(ComponentChooser chooser)
Waits a dialog.- Parameters:
chooser
- a component chooser specifying searching criteria.- Returns:
- JDialog instance or null if component was not found.
-
waitJDialog
public static JDialog waitJDialog(String title, boolean ce, boolean cc, int index)
Waits an index'th dialog by title.- Parameters:
title
- Dialog titlece
- Compare exactly. If true, text can be a substring of caption.cc
- Compare case sensitively. If true, both text and caption areindex
- an index between appropriate ones.- Returns:
- JDialog instance or null if component was not found.
-
waitJDialog
public static JDialog waitJDialog(String title, boolean ce, boolean cc)
Waits a dialog by title.- Parameters:
title
- Dialog titlece
- Compare exactly. If true, text can be a substring of caption.cc
- Compare case sensitively. If true, both text and caption are- Returns:
- JDialog instance or null if component was not found.
-
waitJDialog
public static JDialog waitJDialog(Window owner, ComponentChooser chooser, int index)
Waits an index'th dialog between owner's owned windows.- Parameters:
owner
- Window - dialog owner.chooser
- a component chooser specifying searching criteria.index
- an index between appropriate ones.- Returns:
- JDialog instance or null if component was not found.
-
waitJDialog
public static JDialog waitJDialog(Window owner, ComponentChooser chooser)
Waits a dialog between owner's owned windows.- Parameters:
owner
- Window - dialog owner.chooser
- a component chooser specifying searching criteria.- Returns:
- JDialog instance or null if component was not found.
-
waitJDialog
public static JDialog waitJDialog(Window owner, String title, boolean ce, boolean cc, int index)
Waits an index'th dialog by title between owner's owned windows.- Parameters:
owner
- Window - dialog owner.title
- Dialog titlece
- Compare exactly. If true, text can be a substring of caption.cc
- Compare case sensitively. If true, both text and caption areindex
- an index between appropriate ones.- Returns:
- JDialog instance or null if component was not found.
-
waitJDialog
public static JDialog waitJDialog(Window owner, String title, boolean ce, boolean cc)
Waits a dialog by title between owner's owned windows.- Parameters:
owner
- Window - dialog owner.title
- Dialog titlece
- Compare exactly. If true, text can be a substring of caption.cc
- Compare case sensitively. If true, both text and caption are- Returns:
- JDialog instance or null if component was not found.
-
getTopModalDialog
public static Dialog getTopModalDialog()
Searhs for modal dialog currently staying on top.- Returns:
- dialog or null if no modal dialog is currently displayed.
-
getAccessibleContext
public AccessibleContext getAccessibleContext()
MapsJDialog.getAccessibleContext()
through queue
-
getContentPane
public Container getContentPane()
MapsJDialog.getContentPane()
through queue
-
getDefaultCloseOperation
public int getDefaultCloseOperation()
MapsJDialog.getDefaultCloseOperation()
through queue
-
getGlassPane
public Component getGlassPane()
MapsJDialog.getGlassPane()
through queue
-
getJMenuBar
public JMenuBar getJMenuBar()
MapsJDialog.getJMenuBar()
through queue
-
getLayeredPane
public JLayeredPane getLayeredPane()
MapsJDialog.getLayeredPane()
through queue
-
getRootPane
public JRootPane getRootPane()
MapsJDialog.getRootPane()
through queue
-
setContentPane
public void setContentPane(Container container)
MapsJDialog.setContentPane(Container)
through queue
-
setDefaultCloseOperation
public void setDefaultCloseOperation(int i)
MapsJDialog.setDefaultCloseOperation(int)
through queue
-
setGlassPane
public void setGlassPane(Component component)
MapsJDialog.setGlassPane(Component)
through queue
-
setJMenuBar
public void setJMenuBar(JMenuBar jMenuBar)
MapsJDialog.setJMenuBar(JMenuBar)
through queue
-
setLayeredPane
public void setLayeredPane(JLayeredPane jLayeredPane)
MapsJDialog.setLayeredPane(JLayeredPane)
through queue
-
setLocationRelativeTo
public void setLocationRelativeTo(Component component)
MapsJDialog.setLocationRelativeTo(Component)
through queue
-
waitJDialog
protected static JDialog waitJDialog(ComponentChooser chooser, int index, Timeouts timeouts, TestOut output)
A method to be used from subclasses. Uses timeouts and output passed as parameters during the waiting.- Parameters:
chooser
- org.netbeans.jemmy.ComponentChooser implementation.index
- Ordinal component index.timeouts
- timeouts to be used during the waiting.output
- an output to be used during the waiting.- Returns:
- Component instance or null if component was not found.
-
waitJDialog
protected static JDialog waitJDialog(WindowOperator owner, ComponentChooser chooser, int index)
A method to be used from subclasses. Usesowner
's timeouts and output during the waiting.- Parameters:
owner
- a window - dialog owner.chooser
- org.netbeans.jemmy.ComponentChooser implementation.index
- Ordinal component index.- Returns:
- Component instance or null if component was not found.
- Throws:
TimeoutExpiredException
-
waitJDialog
protected static JDialog waitJDialog(Window owner, ComponentChooser chooser, int index, Timeouts timeouts, TestOut output)
A method to be used from subclasses. Uses timeouts and output passed as parameters during the waiting.- Parameters:
owner
- a window - dialog owner.chooser
- org.netbeans.jemmy.ComponentChooser implementation.index
- Ordinal component index.timeouts
- timeouts to be used during the waiting.output
- an output to be used during the waiting.- Returns:
- Component instance or null if component was not found.
-
-