public class WindowWaiter extends Waiter implements Timeoutable
Timeouts
Constructor and Description |
---|
WindowWaiter()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
actionProduced(java.lang.Object obj)
Action producer--get a window.
|
protected java.lang.String |
getActionProducedMessage(long timeSpent,
java.lang.Object result)
Overrides Waiter.getActionProducedMessage.
|
protected ComponentChooser |
getComponentChooser()
Method can be used by a subclass to define chooser.
|
java.lang.String |
getDescription()
Returns description.
|
protected java.lang.String |
getGoldenActionProducedMessage()
Returns message to be printed int golden output when waiting has been successfully finished.
|
protected java.lang.String |
getGoldenTimeoutExpiredMessage()
Returns message to be printed int golden output when waiting timeout has been expired.
|
protected java.lang.String |
getGoldenWaitingStartedMessage()
Returns message to be printed int golden output before waiting start.
|
protected java.awt.Window |
getOwner()
Method can be used by a subclass to define window owner.
|
protected java.lang.String |
getTimeoutExpiredMessage(long timeSpent)
Overrides Waiter.getTimeoutExpiredMessage.
|
Timeouts |
getTimeouts()
Return current timeouts.
|
protected java.lang.String |
getWaitingStartedMessage()
Returns message to be printed before waiting start.
|
static java.awt.Window |
getWindow(ComponentChooser cc)
Searches for a window.
|
static java.awt.Window |
getWindow(ComponentChooser cc,
int index)
Searches for a window.
|
static java.awt.Window |
getWindow(java.awt.Window owner,
ComponentChooser cc)
Searches for a window.
|
static java.awt.Window |
getWindow(java.awt.Window owner,
ComponentChooser cc,
int index)
Searches for a window.
|
protected void |
setComponentChooser(ComponentChooser ch)
Method can be used by a subclass to define chooser.
|
protected void |
setOwner(java.awt.Window owner)
Method can be used by a subclass to define window owner.
|
void |
setTimeouts(Timeouts timeouts)
Defines current timeouts.
|
java.awt.Window |
waitWindow(ComponentChooser ch)
Waits for a window to show.
|
java.awt.Window |
waitWindow(ComponentChooser ch,
int index)
Waits for a window to show.
|
java.awt.Window |
waitWindow(java.awt.Window o,
ComponentChooser ch)
Waits for a window to show.
|
java.awt.Window |
waitWindow(java.awt.Window o,
ComponentChooser ch,
int index)
Waits for a window to show.
|
getOutput, setOutput, timeFromStart, waitAction
public static java.awt.Window getWindow(java.awt.Window owner, ComponentChooser cc, int index)
index+1
'th window that is both owned by the
java.awt.Window
owner
and that meets the
criteria defined and applied by the ComponentChooser
parameter.owner
- The owner window of all the windows to be searched.cc
- A component chooser used to define and apply the search criteria.index
- The ordinal index of the window in the set of currently displayed
windows with the proper window ownership and a suitable title. The first
index is 0.index+1
'th window that is showing,
has the proper window ownership, and that meets the search criteria.
If there are fewer than index+1
windows, a null
reference is returned.public static java.awt.Window getWindow(java.awt.Window owner, ComponentChooser cc)
java.awt.Window
owner
and that
meets the search criteria applied by the ComponentChooser
parameter.owner
- The owner window of the windows to be searched.cc
- A component chooser used to define and apply the search criteria.null
reference is returned.public static java.awt.Window getWindow(ComponentChooser cc, int index)
index+1
'th window that meets the criteria defined and
applied by the ComonentChooser
parameter.cc
- A component chooser used to define and apply the search criteria.index
- The ordinal index of the window in the set of currently displayed
windows. The first index is 0.index+1
'th window that is showing
and that meets the search criteria. If there are fewer than
index+1
windows, a null
reference is returned.public static java.awt.Window getWindow(ComponentChooser cc)
ComponentChooser
parameter.cc
- A component chooser used to define and apply the search criteria.null
reference is returned.public void setTimeouts(Timeouts timeouts)
setTimeouts
in interface Timeoutable
setTimeouts
in class Waiter
timeouts
- A collection of timeout assignments.Timeoutable
,
Timeouts
,
getTimeouts()
public Timeouts getTimeouts()
getTimeouts
in interface Timeoutable
getTimeouts
in class Waiter
Timeoutable
,
Timeouts
,
setTimeouts(org.netbeans.jemmy.Timeouts)
public java.lang.Object actionProduced(java.lang.Object obj)
org.netbeans.jemmy.ComponentChooser
.actionProduced
in interface Waitable
actionProduced
in class Waiter
obj
- Not used.null
reference is returned.Action
public java.awt.Window waitWindow(ComponentChooser ch, int index) throws java.lang.InterruptedException
index+1
'th window that meets the criteria
defined and applied by the ComonentChooser
parameter to
show up.ch
- A component chooser used to define and apply the search criteria.index
- The ordinal index of the window in the set of currently displayed
windows. The first index is 0.index+1
'th window that shows
and that meets the search criteria. If fewer than
index+1
windows show up in the allotted time period then
a null
reference is returned.TimeoutExpiredException
java.lang.InterruptedException
actionProduced(Object)
public java.awt.Window waitWindow(ComponentChooser ch) throws java.lang.InterruptedException
ComponentChooser
parameter to show up.ch
- A component chooser used to define and apply the search criteria.null
reference is returned.TimeoutExpiredException
java.lang.InterruptedException
actionProduced(Object)
public java.awt.Window waitWindow(java.awt.Window o, ComponentChooser ch, int index) throws java.lang.InterruptedException
index+1
'th window to show that is both owned by the
java.awt.Window
o
and that meets the
criteria defined and applied by the ComponentChooser
parameter.o
- The owner window of all the windows to be searched.ch
- A component chooser used to define and apply the search criteria.index
- The ordinal index of the window in the set of currently displayed
windows with the proper window ownership and a suitable title. The first
index is 0.index+1
'th window to show that
has the proper window ownership, and that meets the search criteria.
If there are fewer than index+1
windows, a null
reference is returned.TimeoutExpiredException
java.lang.InterruptedException
actionProduced(Object)
public java.awt.Window waitWindow(java.awt.Window o, ComponentChooser ch) throws java.lang.InterruptedException
java.awt.Window
o
and that meets the
criteria defined and applied by the ComponentChooser
parameter.o
- The owner window of all the windows to be searched.ch
- A component chooser used to define and apply the search criteria.null
reference is returned.TimeoutExpiredException
java.lang.InterruptedException
actionProduced(Object)
public java.lang.String getDescription()
Waitable
getDescription
in interface Waitable
getDescription
in class Waiter
Waitable
protected void setComponentChooser(ComponentChooser ch)
ch
- a chooser specifying searching criteria.getComponentChooser()
protected ComponentChooser getComponentChooser()
setComponentChooser(org.netbeans.jemmy.ComponentChooser)
protected void setOwner(java.awt.Window owner)
owner
- Window-owner of the set of windows.getOwner()
protected java.awt.Window getOwner()
setOwner(java.awt.Window)
protected java.lang.String getWaitingStartedMessage()
Waiter
getWaitingStartedMessage
in class Waiter
Waiter.getWaitingStartedMessage()
protected java.lang.String getTimeoutExpiredMessage(long timeSpent)
getTimeoutExpiredMessage
in class Waiter
timeSpent
- time from waiting start (milliseconds)Waiter.getTimeoutExpiredMessage(long)
protected java.lang.String getActionProducedMessage(long timeSpent, java.lang.Object result)
getActionProducedMessage
in class Waiter
timeSpent
- time from waiting start (milliseconds)result
- result of Waitable.actionproduced method.Waiter.getActionProducedMessage(long, Object)
protected java.lang.String getGoldenWaitingStartedMessage()
Waiter
getGoldenWaitingStartedMessage
in class Waiter
Waiter.getGoldenWaitingStartedMessage()
protected java.lang.String getGoldenTimeoutExpiredMessage()
Waiter
getGoldenTimeoutExpiredMessage
in class Waiter
Waiter.getGoldenTimeoutExpiredMessage()
protected java.lang.String getGoldenActionProducedMessage()
Waiter
getGoldenActionProducedMessage
in class Waiter
Waiter.getGoldenActionProducedMessage()