Class FrameOperator

  • All Implemented Interfaces:
    Outputable, Timeoutable
    Direct Known Subclasses:
    JFrameOperator

    public class FrameOperator
    extends WindowOperator
    implements Outputable


    Timeouts used:
    FrameWaiter.WaitFrameTimeout - time to wait frame displayed
    FrameWaiter.AfterFrameTimeout - time to sleep after frame has been dispayed
    ComponentOperator.WaitStateTimeout - time to wait for text
    .
    Author:
    Alexandre Iline (alexandre.iline@sun.com)
    See Also:
    Timeouts
    • Field Detail

      • STATE_NORMAL_DPROP_VALUE

        public static final java.lang.String STATE_NORMAL_DPROP_VALUE
        Identifier for a "normal state" state property value.
        See Also:
        getDump(), Constant Field Values
      • STATE_ICONIFIED_DPROP_VALUE

        public static final java.lang.String STATE_ICONIFIED_DPROP_VALUE
        Identifier for a "iconified state" state property value.
        See Also:
        getDump(), Constant Field Values
      • IS_RESIZABLE_DPROP

        public static final java.lang.String IS_RESIZABLE_DPROP
        Identifier for a resizable property.
        See Also:
        getDump(), Constant Field Values
    • Constructor Detail

      • FrameOperator

        public FrameOperator​(java.awt.Frame w)
        Constructs a FrameOperator object.
        Parameters:
        w - window
      • FrameOperator

        public FrameOperator​(ComponentChooser chooser,
                             int index,
                             Operator env)
        Constructs a FrameOperator object.
        Parameters:
        chooser - a component chooser specifying searching criteria.
        index - an index between appropriate ones.
        env - an operator to copy environment from.
      • FrameOperator

        public FrameOperator​(ComponentChooser chooser,
                             int index)
        Constructs a FrameOperator object.
        Parameters:
        chooser - a component chooser specifying searching criteria.
        index - an index between appropriate ones.
      • FrameOperator

        public FrameOperator​(ComponentChooser chooser)
        Constructs a FrameOperator object.
        Parameters:
        chooser - a component chooser specifying searching criteria.
      • FrameOperator

        public FrameOperator​(java.lang.String title,
                             int index,
                             Operator env)
        Constructor. Waits for the frame with "title" subtitle. Constructor can be used in complicated cases when output or timeouts should differ from default.
        Parameters:
        title - a window title
        index - Ordinal component index.
        env - an operator to copy environment from.
        Throws:
        TimeoutExpiredException
        See Also:
        Operator.isCaptionEqual(String, String, boolean, boolean)
      • FrameOperator

        public FrameOperator​(java.lang.String title,
                             int index)
        Constructor. Waits for the frame with "title" subtitle. Uses current timeouts and output values.
        Parameters:
        title - a window title
        index - Ordinal component index.
        Throws:
        TimeoutExpiredException
        See Also:
        Operator.isCaptionEqual(String, String, boolean, boolean), JemmyProperties#getCurrentTimeouts(), JemmyProperties#getCurrentOutput()
      • FrameOperator

        public FrameOperator​(int index)
        Constructor. Waits for the index'th frame. Uses current timeout and output for waiting and to init operator.
        Parameters:
        index - Ordinal component index.
        Throws:
        TimeoutExpiredException
      • FrameOperator

        public FrameOperator()
        Constructor. Waits for the first frame. Uses current timeout and output for waiting and to init operator.
        Throws:
        TimeoutExpiredException
    • Method Detail

      • copyEnvironment

        public void copyEnvironment​(Operator anotherOperator)
        Description copied from class: Operator
        Copies all environment (output, timeouts, visualizer) from another operator.
        Overrides:
        copyEnvironment in class WindowOperator
        Parameters:
        anotherOperator - an operator to copy the environment to.
      • waitTitle

        public void waitTitle​(java.lang.String title)
        Waits for title. Uses getComparator() comparator.
        Parameters:
        title - Title to wait for.
      • iconify

        public void iconify()
        Iconifies the frame.
      • deiconify

        public void deiconify()
        Deiconifies the frame.
      • maximize

        public void maximize()
        Maximizes the frame.
      • demaximize

        public void demaximize()
        Demaximizes the frame.
      • waitState

        public void waitState​(int state)
        Waits for the frame to have a specified state.
        Parameters:
        state - a state for the frame to have.
      • getDump

        public java.util.Hashtable getDump()
        Returns information about component.
        Overrides:
        getDump in class ComponentOperator
        Returns:
        a Hashtable containing name-value pairs.
      • getIconImage

        public java.awt.Image getIconImage()
        Maps Frame.getIconImage() through queue
      • getMenuBar

        public java.awt.MenuBar getMenuBar()
        Maps Frame.getMenuBar() through queue
      • getState

        public int getState()
        Maps Frame.getState() through queue
      • getTitle

        public java.lang.String getTitle()
        Maps Frame.getTitle() through queue
      • isResizable

        public boolean isResizable()
        Maps Frame.isResizable() through queue
      • setIconImage

        public void setIconImage​(java.awt.Image image)
        Maps Frame.setIconImage(Image) through queue
      • setMenuBar

        public void setMenuBar​(java.awt.MenuBar menuBar)
        Maps Frame.setMenuBar(MenuBar) through queue
      • setResizable

        public void setResizable​(boolean b)
        Maps Frame.setResizable(boolean) through queue
      • setState

        public void setState​(int i)
        Maps Frame.setState(int) through queue
      • setTitle

        public void setTitle​(java.lang.String string)
        Maps Frame.setTitle(String) through queue
      • waitFrame

        protected static java.awt.Frame waitFrame​(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.
        Throws:
        TimeoutExpiredException