Package org.netbeans.jemmy
Class FrameWaiter
java.lang.Object
org.netbeans.jemmy.Waiter
org.netbeans.jemmy.WindowWaiter
org.netbeans.jemmy.FrameWaiter
- All Implemented Interfaces:
Outputable
,Timeoutable
,Waitable
Contains methods to search and wait Frame.
A FrameWaiter is a utility class used to look or wait for Frames.
It contains methods to search for a Frame among the currently
showing Frames as well as methods that wait for a Frame to show
within an allotted time period.
Timeouts used:
FrameWaiter.WaitFrameTimeout - time to wait frame displayed.
FrameWaiter.AfterFrameTimeout - time to sleep after frame has been displayed.
Timeouts used:
FrameWaiter.WaitFrameTimeout - time to wait frame displayed.
FrameWaiter.AfterFrameTimeout - time to sleep after frame has been displayed.
- Author:
- Alexandre Iline (alexandre.iline@sun.com)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
getActionProducedMessage
(long timeSpent, Object result) Overrides WindowWaiter.getActionProducedMessage.static Frame
Searches for a Frame by title.static Frame
Searches for a Frame by title.static Frame
Searches for a Frame.static Frame
getFrame
(ComponentChooser cc, int index) Searches for a Frame.protected String
Returns message to be printed int golden output when waiting has been successfully finished.protected String
Returns message to be printed int golden output when waiting timeout has been expired.protected String
Returns message to be printed int golden output before waiting start.Returns print output streams or writers.protected String
getTimeoutExpiredMessage
(long timeSpent) Overrides WindowWaiter.getTimeoutExpiredMessage.Return current timeouts.protected String
Returns message to be printed before waiting start.void
Defines print output streams or writers.void
setTimeouts
(Timeouts timeouts) Defines current timeouts.Waits for a Frame to show.Waits for a Frame to show.Waits for a Frame to show.waitFrame
(ComponentChooser ch, int index) Waits for a Frame to show.Methods inherited from class org.netbeans.jemmy.WindowWaiter
actionProduced, getComponentChooser, getDescription, getOwner, getWindow, getWindow, getWindow, getWindow, setComponentChooser, setOwner, waitWindow, waitWindow, waitWindow, waitWindow
Methods inherited from class org.netbeans.jemmy.Waiter
setTimeoutsToCloneOf, setWaitingTimeOrigin, timeFromStart, waitAction
-
Constructor Details
-
FrameWaiter
public FrameWaiter()Constructor.
-
-
Method Details
-
getFrame
Searches for a Frame. Search among the currently showing Frames for one that meets the search criteria applied by theComponentChooser
parameter.- Parameters:
cc
- A component chooser used to define and apply the search criteria.- Returns:
- a reference to the first Frame that is showing and that
meets the search criteria. If no such Frame can be found, a
null
reference is returned.
-
getFrame
Searches for a Frame. The search proceeds among the currently showing Frames for theindex+1
'th Frame that meets the criteria defined and applied by theComonentChooser
parameter.- Parameters:
cc
- A component chooser used to define and apply the search criteria.index
- The ordinal index of the Frame in the set of currently displayed Frames. The first index is 0.- Returns:
- a reference to the
index+1
'th Frame that is showing and that meets the search criteria. If there are fewer thanindex+1
Frames, anull
reference is returned.
-
getFrame
Searches for a Frame by title. The search proceeds among the currently showing Frames for the first with a suitable title.- Parameters:
title
- Frame title or subtitle.ce
- Iftrue
and the search is case sensitive, then a match occurs when thetitle
argument is a substring of a Frame title. Iffalse
and the search is case sensitive, then thetitle
argument and the Frame title must be the same. Iftrue
and the search is case insensitive, then a match occurs when thetitle
argument is a substring of the Frame title after changing both to upper case. Iffalse
and the search is case insensitive, then a match occurs when thetitle
argument is a substring of the Frame title after changing both to upper case.cc
- Iftrue
the search is case sensitive; otherwise, the search is case insensitive.- Returns:
- a reference to the first Frame that is showing and that has a
suitable title. If no such Frame can be found, a
null
reference is returned.
-
getFrame
Searches for a Frame by title. The search is for theindex+1
'th Frame among the currently showing Frames that possess a suitable title.- Parameters:
title
- Frame title or subtitle.ce
- Iftrue
and the search is case sensitive, then a match occurs when thetitle
argument is a substring of a Frame title. Iffalse
and the search is case sensitive, then thetitle
argument and the Frame title must be the same. Iftrue
and the search is case insensitive, then a match occurs when thetitle
argument is a substring of the Frame title after changing both to upper case. Iffalse
and the search is case insensitive, then a match occurs when thetitle
argument is a substring of the Frame title after changing both to upper case.cc
- Iftrue
the search is case sensitive; otherwise, the search is case insensitive.index
- The ordinal index of the Frame in the set of currently displayed Frames. The first index is 0.- Returns:
- a reference to the
index+1
'th Frame that is showing and that has a suitable title. If there are fewer thanindex+1
Frames, anull
reference is returned.
-
setTimeouts
Defines current timeouts.- Specified by:
setTimeouts
in interfaceTimeoutable
- Overrides:
setTimeouts
in classWindowWaiter
- Parameters:
timeouts
- A collection of timeout assignments.- See Also:
-
getTimeouts
Return current timeouts.- Specified by:
getTimeouts
in interfaceTimeoutable
- Overrides:
getTimeouts
in classWindowWaiter
- Returns:
- the collection of current timeout assignments.
- See Also:
-
setOutput
Defines print output streams or writers.- Specified by:
setOutput
in interfaceOutputable
- Overrides:
setOutput
in classWaiter
- Parameters:
output
- Identify the streams or writers used for print output.- See Also:
-
getOutput
Returns print output streams or writers.- Specified by:
getOutput
in interfaceOutputable
- Overrides:
getOutput
in classWaiter
- Returns:
- an object that contains references to objects for printing to output and err streams.
- See Also:
-
waitFrame
Waits for a Frame to show. Wait for theindex+1
'th Frame that meets the criteria defined and applied by theComonentChooser
parameter to show up.- Parameters:
ch
- A component chooser used to define and apply the search criteria.index
- The ordinal index of the Frame in the set of currently displayed Frames. The first index is 0.- Returns:
- a reference to the
index+1
'th Frame that shows and that meets the search criteria. If fewer thanindex+1
Frames show up in the allotted time period then anull
reference is returned. - Throws:
TimeoutExpiredException
InterruptedException
- See Also:
-
waitFrame
Waits for a Frame to show. Wait for a Frame that meets the search criteria applied by theComponentChooser
parameter to show up.- Parameters:
ch
- A component chooser used to define and apply the search criteria.- Returns:
- a reference to the first Frame that shows and that
meets the search criteria. If no such Frame can be found within the
time period allotted, a
null
reference is returned. - Throws:
TimeoutExpiredException
InterruptedException
- See Also:
-
waitFrame
public Frame waitFrame(String title, boolean compareExactly, boolean compareCaseSensitive, int index) throws InterruptedException Waits for a Frame to show. Wait for theindex+1
'th Frame to show with a suitable title.- Parameters:
title
- Frame title or subtitle.compareExactly
- Iftrue
and the search is case sensitive, then a match occurs when thetitle
argument is a substring of a Frame title. Iffalse
and the search is case sensitive, then thetitle
argument and the Frame title must be the same. Iftrue
and the search is case insensitive, then a match occurs when thetitle
argument is a substring of the Frame title after changing both to upper case. Iffalse
and the search is case insensitive, then a match occurs when thetitle
argument is a substring of the Frame title after changing both to upper case.compareCaseSensitive
- Iftrue
the search is case sensitive; otherwise, the search is case insensitive.index
- The ordinal index of the Frame in the set of currently displayed Frames with the proper window ownership and a suitable title. The first index is 0.- Returns:
- a reference to the
index+1
'th Frame to show and that has a suitable title. If no such Frame can be found within the time period allotted, anull
reference is returned. - Throws:
TimeoutExpiredException
InterruptedException
- See Also:
-
waitFrame
public Frame waitFrame(String title, boolean compareExactly, boolean compareCaseSensitive) throws InterruptedException Waits for a Frame to show. Wait for the first Frame to show with a suitable title.- Parameters:
title
- Frame title or subtitle.compareExactly
- Iftrue
and the search is case sensitive, then a match occurs when thetitle
argument is a substring of a Frame title. Iffalse
and the search is case sensitive, then thetitle
argument and the Frame title must be the same. Iftrue
and the search is case insensitive, then a match occurs when thetitle
argument is a substring of the Frame title after changing both to upper case. Iffalse
and the search is case insensitive, then a match occurs when thetitle
argument is a substring of the Frame title after changing both to upper case.compareCaseSensitive
- Iftrue
the search is case sensitive; otherwise, the search is case insensitive.- Returns:
- a reference to the first Frame to show and that has a
suitable title. If no such Frame can be found within the time period
allotted, a
null
reference is returned. - Throws:
TimeoutExpiredException
InterruptedException
- See Also:
-
getWaitingStartedMessage
Description copied from class:Waiter
Returns message to be printed before waiting start.- Overrides:
getWaitingStartedMessage
in classWindowWaiter
- Returns:
- a message.
- See Also:
-
getTimeoutExpiredMessage
Overrides WindowWaiter.getTimeoutExpiredMessage. Returns the timeout expired message value.- Overrides:
getTimeoutExpiredMessage
in classWindowWaiter
- Parameters:
timeSpent
- Time spent for waiting- Returns:
- a message tring
- See Also:
-
getActionProducedMessage
Overrides WindowWaiter.getActionProducedMessage. Returns the action produced message value.- Overrides:
getActionProducedMessage
in classWindowWaiter
- Parameters:
timeSpent
- Time spent for waiting.result
- A message string.- Returns:
- a message tring
- See Also:
-
getGoldenWaitingStartedMessage
Description copied from class:Waiter
Returns message to be printed int golden output before waiting start.- Overrides:
getGoldenWaitingStartedMessage
in classWindowWaiter
- Returns:
- a message.
- See Also:
-
getGoldenTimeoutExpiredMessage
Description copied from class:Waiter
Returns message to be printed int golden output when waiting timeout has been expired.- Overrides:
getGoldenTimeoutExpiredMessage
in classWindowWaiter
- Returns:
- a message.
- See Also:
-
getGoldenActionProducedMessage
Description copied from class:Waiter
Returns message to be printed int golden output when waiting has been successfully finished.- Overrides:
getGoldenActionProducedMessage
in classWindowWaiter
- Returns:
- a message.
- See Also:
-