Class FrameWaiter

  • All Implemented Interfaces:
    Outputable, Timeoutable, Waitable

    public class FrameWaiter
    extends WindowWaiter
    implements Timeoutable, Outputable
    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.
    Author:
    Alexandre Iline (alexandre.iline@sun.com)
    See Also:
    Timeouts
    • Constructor Detail

      • FrameWaiter

        public FrameWaiter()
        Constructor.
    • Method Detail

      • getFrame

        public static Frame getFrame​(ComponentChooser cc)
        Searches for a Frame. Search among the currently showing Frames for one that meets the search criteria applied by the ComponentChooser 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

        public static Frame getFrame​(ComponentChooser cc,
                                     int index)
        Searches for a Frame. The search proceeds among the currently showing Frames for the index+1'th Frame that meets the criteria defined and applied by the ComonentChooser 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 than index+1 Frames, a null reference is returned.
      • getFrame

        public static Frame getFrame​(String title,
                                     boolean ce,
                                     boolean cc)
        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 - If true and the search is case sensitive, then a match occurs when the title argument is a substring of a Frame title. If false and the search is case sensitive, then the title argument and the Frame title must be the same. If true and the search is case insensitive, then a match occurs when the title argument is a substring of the Frame title after changing both to upper case. If false and the search is case insensitive, then a match occurs when the title argument is a substring of the Frame title after changing both to upper case.
        cc - If true 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

        public static Frame getFrame​(String title,
                                     boolean ce,
                                     boolean cc,
                                     int index)
        Searches for a Frame by title. The search is for the index+1'th Frame among the currently showing Frames that possess a suitable title.
        Parameters:
        title - Frame title or subtitle.
        ce - If true and the search is case sensitive, then a match occurs when the title argument is a substring of a Frame title. If false and the search is case sensitive, then the title argument and the Frame title must be the same. If true and the search is case insensitive, then a match occurs when the title argument is a substring of the Frame title after changing both to upper case. If false and the search is case insensitive, then a match occurs when the title argument is a substring of the Frame title after changing both to upper case.
        cc - If true 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 than index+1 Frames, a null reference is returned.
      • waitFrame

        public Frame waitFrame​(ComponentChooser ch,
                               int index)
                        throws InterruptedException
        Waits for a Frame to show. Wait for the index+1'th Frame that meets the criteria defined and applied by the ComonentChooser 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 than index+1 Frames show up in the allotted time period then a null reference is returned.
        Throws:
        TimeoutExpiredException
        InterruptedException
        See Also:
        WindowWaiter.actionProduced(Object)
      • waitFrame

        public Frame waitFrame​(String title,
                               boolean compareExactly,
                               boolean compareCaseSensitive,
                               int index)
                        throws InterruptedException
        Waits for a Frame to show. Wait for the index+1'th Frame to show with a suitable title.
        Parameters:
        title - Frame title or subtitle.
        compareExactly - If true and the search is case sensitive, then a match occurs when the title argument is a substring of a Frame title. If false and the search is case sensitive, then the title argument and the Frame title must be the same. If true and the search is case insensitive, then a match occurs when the title argument is a substring of the Frame title after changing both to upper case. If false and the search is case insensitive, then a match occurs when the title argument is a substring of the Frame title after changing both to upper case.
        compareCaseSensitive - If true 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, a null reference is returned.
        Throws:
        TimeoutExpiredException
        InterruptedException
        See Also:
        WindowWaiter.actionProduced(Object)
      • 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 - If true and the search is case sensitive, then a match occurs when the title argument is a substring of a Frame title. If false and the search is case sensitive, then the title argument and the Frame title must be the same. If true and the search is case insensitive, then a match occurs when the title argument is a substring of the Frame title after changing both to upper case. If false and the search is case insensitive, then a match occurs when the title argument is a substring of the Frame title after changing both to upper case.
        compareCaseSensitive - If true 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:
        WindowWaiter.actionProduced(Object)