Class JInternalFrameOperator

  • All Implemented Interfaces:
    Outputable, Timeoutable

    public class JInternalFrameOperator
    extends JComponentOperator
    implements Outputable, Timeoutable
    Class provides necessary functionality to operate with javax.swing.JInternalFrame component. Some methods can throw WrongInternalFrameStateException exception.

    Timeouts used:
    ComponentOperator.WaitComponentTimeout - time to wait component displayed
    ComponentOperator.MouseClickTimeout - time between mouse pressing and releasing
    AbstractButtonOperator.PushButtonTimeout - time between button pressing and releasing
    JScrollBarOperator.WholeScrollTimeout - time for the whole scrolling
    .
    Author:
    Alexandre Iline (alexandre.iline@sun.com)
    See Also:
    Timeouts, JInternalFrameOperator.WrongInternalFrameStateException
    • Field Detail

      • STATE_NORMAL_DPROP_VALUE

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

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

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

        public static final java.lang.String STATE_MAXIMAZED_DPROP_VALUE
        Identifier for a "maximized" value of "state" property.
        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
      • IS_SELECTED_DPROP

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

      • JInternalFrameOperator

        public JInternalFrameOperator​(javax.swing.JInternalFrame b)
        Constructor.
        Parameters:
        b - a component
      • JInternalFrameOperator

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

        public JInternalFrameOperator​(ContainerOperator cont,
                                      ComponentChooser chooser)
        Constructs a JInternalFrameOperator object.
        Parameters:
        cont - a container
        chooser - a component chooser specifying searching criteria.
      • JInternalFrameOperator

        public JInternalFrameOperator​(ContainerOperator cont,
                                      java.lang.String text,
                                      int index)
        Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.
        Parameters:
        cont - a container
        text - Button text.
        index - Ordinal component index.
        See Also:
        Operator.isCaptionEqual(String, String, boolean, boolean)
      • JInternalFrameOperator

        public JInternalFrameOperator​(ContainerOperator cont,
                                      int index)
        Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.
        Parameters:
        cont - a container
        index - Ordinal component index.
      • JInternalFrameOperator

        public JInternalFrameOperator​(ContainerOperator cont)
        Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.
        Parameters:
        cont - a container
    • Method Detail

      • findJInternalFrame

        public static javax.swing.JInternalFrame findJInternalFrame​(java.awt.Container cont,
                                                                    ComponentChooser chooser,
                                                                    int index)
        Searches JInternalframe in container.
        Parameters:
        cont - Container to search component in.
        chooser - a component chooser specifying searching criteria.
        index - Ordinal component index.
        Returns:
        JInternalframe instance or null if component was not found.
      • findJInternalFrame

        public static javax.swing.JInternalFrame findJInternalFrame​(java.awt.Container cont,
                                                                    ComponentChooser chooser)
        Searches JInternalframe in container.
        Parameters:
        cont - Container to search component in.
        chooser - a component chooser specifying searching criteria.
        Returns:
        JInternalframe instance or null if component was not found.
      • findJInternalFrame

        public static javax.swing.JInternalFrame findJInternalFrame​(java.awt.Container cont,
                                                                    java.lang.String text,
                                                                    boolean ce,
                                                                    boolean ccs,
                                                                    int index)
        Searches JInternalframe by title.
        Parameters:
        cont - Container to search component in.
        text - Component text.
        ce - Compare text exactly.
        ccs - Compare text case sensitively.
        index - Ordinal component index.
        Returns:
        JInternalframe instance or null if component was not found.
        See Also:
        Operator.isCaptionEqual(String, String, boolean, boolean)
      • findJInternalFrame

        public static javax.swing.JInternalFrame findJInternalFrame​(java.awt.Container cont,
                                                                    java.lang.String text,
                                                                    boolean ce,
                                                                    boolean ccs)
        Searches JInternalframe by title.
        Parameters:
        cont - Container to search component in.
        text - Component text.
        ce - Compare text exactly.
        ccs - Compare text case sensitively.
        Returns:
        JInternalframe instance or null if component was not found.
        See Also:
        Operator.isCaptionEqual(String, String, boolean, boolean)
      • findJInternalFrameUnder

        public static javax.swing.JInternalFrame findJInternalFrameUnder​(java.awt.Component comp,
                                                                         ComponentChooser chooser)
        Searches JInternalFrame object which component lies on.
        Parameters:
        comp - Component to find JInternalFrame under.
        chooser - org.netbeans.jemmy.ComponentChooser implementation.
        Returns:
        JInternalFrame instance or null if component was not found.
      • findJInternalFrameUnder

        public static javax.swing.JInternalFrame findJInternalFrameUnder​(java.awt.Component comp)
        Searches JInternalFrame object which component lies on.
        Parameters:
        comp - Component to find JInternalFrame under.
        Returns:
        JInternalFrame instance or null if component was not found.
      • waitJInternalFrame

        public static javax.swing.JInternalFrame waitJInternalFrame​(java.awt.Container cont,
                                                                    ComponentChooser chooser,
                                                                    int index)
        Waits JInternalframe in container.
        Parameters:
        cont - Container to search component in.
        chooser - a component chooser specifying searching criteria.
        index - Ordinal component index.
        Returns:
        JInternalframe instance.
      • waitJInternalFrame

        public static javax.swing.JInternalFrame waitJInternalFrame​(java.awt.Container cont,
                                                                    ComponentChooser chooser)
        Waits JInternalframe in container.
        Parameters:
        cont - Container to search component in.
        chooser - a component chooser specifying searching criteria.
        Returns:
        JInternalframe instance.
      • waitJInternalFrame

        public static javax.swing.JInternalFrame waitJInternalFrame​(java.awt.Container cont,
                                                                    java.lang.String text,
                                                                    boolean ce,
                                                                    boolean ccs,
                                                                    int index)
        Waits JInternalframe by title.
        Parameters:
        cont - Container to search component in.
        text - Component text.
        ce - Compare text exactly.
        ccs - Compare text case sensitively.
        index - Ordinal component index.
        Returns:
        JInternalframe instance.
        See Also:
        Operator.isCaptionEqual(String, String, boolean, boolean)
      • waitJInternalFrame

        public static javax.swing.JInternalFrame waitJInternalFrame​(java.awt.Container cont,
                                                                    java.lang.String text,
                                                                    boolean ce,
                                                                    boolean ccs)
        Waits JInternalframe by title.
        Parameters:
        cont - Container to search component in.
        text - Component text.
        ce - Compare text exactly.
        ccs - Compare text case sensitively.
        Returns:
        JInternalframe instance.
        See Also:
        Operator.isCaptionEqual(String, String, boolean, boolean)
      • close

        public void close()
        Closes the frame.
      • scrollToRectangle

        public void scrollToRectangle​(int x,
                                      int y,
                                      int width,
                                      int height)
        Scrolls to internal frame's rectangle.
        Parameters:
        x - Horizontal rectangle coordinate
        y - Vertical rectangle coordinate
        width - rectangle width
        height - rectangle height
      • scrollToRectangle

        public void scrollToRectangle​(java.awt.Rectangle rect)
        Scrolls to internal frame's rectangle.
        Parameters:
        rect - a rectangle to scroll to.
      • scrollToFrame

        public void scrollToFrame()
        Scrolls to internal frame.
      • getMinimizeButton

        public JButtonOperator getMinimizeButton()
        Waits for a minimize button inside the title pane.
        Returns:
        a button operator
      • getMaximizeButton

        public JButtonOperator getMaximizeButton()
        Waits for a maximize button inside the title pane.
        Returns:
        a button operator
      • getCloseButton

        public JButtonOperator getCloseButton()
        Waits for a close button inside the title pane.
        Returns:
        a button operator
      • getTitleOperator

        public ContainerOperator getTitleOperator()
        Waits for the title pane.
        Returns:
        a button operator
      • waitIcon

        public void waitIcon​(boolean icon)
        Waits for the frame to be iconified or deiconified.
        Parameters:
        icon - whether the frame needs to be iconified.
      • waitMaximum

        public void waitMaximum​(boolean maximum)
        Waits for the frame to be maximized or demaximized.
        Parameters:
        maximum - whether the frame needs to be maximized.
      • getDump

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

        public void addInternalFrameListener​(javax.swing.event.InternalFrameListener internalFrameListener)
        Maps JInternalFrame.addInternalFrameListener(InternalFrameListener) through queue
      • dispose

        public void dispose()
        Maps JInternalFrame.dispose() through queue
      • getContentPane

        public java.awt.Container getContentPane()
        Maps JInternalFrame.getContentPane() through queue
      • getDefaultCloseOperation

        public int getDefaultCloseOperation()
        Maps JInternalFrame.getDefaultCloseOperation() through queue
      • getDesktopIcon

        public javax.swing.JInternalFrame.JDesktopIcon getDesktopIcon()
        Maps JInternalFrame.getDesktopIcon() through queue
      • getDesktopPane

        public javax.swing.JDesktopPane getDesktopPane()
        Maps JInternalFrame.getDesktopPane() through queue
      • getFrameIcon

        public javax.swing.Icon getFrameIcon()
        Maps JInternalFrame.getFrameIcon() through queue
      • getGlassPane

        public java.awt.Component getGlassPane()
        Maps JInternalFrame.getGlassPane() through queue
      • getJMenuBar

        public javax.swing.JMenuBar getJMenuBar()
        Maps JInternalFrame.getJMenuBar() through queue
      • getLayer

        public int getLayer()
        Maps JInternalFrame.getLayer() through queue
      • getLayeredPane

        public javax.swing.JLayeredPane getLayeredPane()
        Maps JInternalFrame.getLayeredPane() through queue
      • getTitle

        public java.lang.String getTitle()
        Maps JInternalFrame.getTitle() through queue
      • getUI

        public javax.swing.plaf.InternalFrameUI getUI()
        Maps JInternalFrame.getUI() through queue
      • getWarningString

        public java.lang.String getWarningString()
        Maps JInternalFrame.getWarningString() through queue
      • isClosable

        public boolean isClosable()
        Maps JInternalFrame.isClosable() through queue
      • isClosed

        public boolean isClosed()
        Maps JInternalFrame.isClosed() through queue
      • isIcon

        public boolean isIcon()
        Maps JInternalFrame.isIcon() through queue
      • isIconifiable

        public boolean isIconifiable()
        Maps JInternalFrame.isIconifiable() through queue
      • isMaximizable

        public boolean isMaximizable()
        Maps JInternalFrame.isMaximizable() through queue
      • isMaximum

        public boolean isMaximum()
        Maps JInternalFrame.isMaximum() through queue
      • isResizable

        public boolean isResizable()
        Maps JInternalFrame.isResizable() through queue
      • isSelected

        public boolean isSelected()
        Maps JInternalFrame.isSelected() through queue
      • moveToBack

        public void moveToBack()
        Maps JInternalFrame.moveToBack() through queue
      • moveToFront

        public void moveToFront()
        Maps JInternalFrame.moveToFront() through queue
      • pack

        public void pack()
        Maps JInternalFrame.pack() through queue
      • removeInternalFrameListener

        public void removeInternalFrameListener​(javax.swing.event.InternalFrameListener internalFrameListener)
        Maps JInternalFrame.removeInternalFrameListener(InternalFrameListener) through queue
      • setClosable

        public void setClosable​(boolean b)
        Maps JInternalFrame.setClosable(boolean) through queue
      • setClosed

        public void setClosed​(boolean b)
        Maps JInternalFrame.setClosed(boolean) through queue
      • setContentPane

        public void setContentPane​(java.awt.Container container)
        Maps JInternalFrame.setContentPane(Container) through queue
      • setDefaultCloseOperation

        public void setDefaultCloseOperation​(int i)
        Maps JInternalFrame.setDefaultCloseOperation(int) through queue
      • setDesktopIcon

        public void setDesktopIcon​(javax.swing.JInternalFrame.JDesktopIcon jDesktopIcon)
        Maps JInternalFrame.setDesktopIcon(JDesktopIcon) through queue
      • setFrameIcon

        public void setFrameIcon​(javax.swing.Icon icon)
        Maps JInternalFrame.setFrameIcon(Icon) through queue
      • setGlassPane

        public void setGlassPane​(java.awt.Component component)
        Maps JInternalFrame.setGlassPane(Component) through queue
      • setIcon

        public void setIcon​(boolean b)
        Maps JInternalFrame.setIcon(boolean) through queue
      • setIconifiable

        public void setIconifiable​(boolean b)
        Maps JInternalFrame.setIconifiable(boolean) through queue
      • setJMenuBar

        public void setJMenuBar​(javax.swing.JMenuBar jMenuBar)
        Maps JInternalFrame.setJMenuBar(JMenuBar) through queue
      • setLayer

        public void setLayer​(java.lang.Integer integer)
        Maps JInternalFrame.setLayer(Integer) through queue
      • setLayeredPane

        public void setLayeredPane​(javax.swing.JLayeredPane jLayeredPane)
        Maps JInternalFrame.setLayeredPane(JLayeredPane) through queue
      • setMaximizable

        public void setMaximizable​(boolean b)
        Maps JInternalFrame.setMaximizable(boolean) through queue
      • setMaximum

        public void setMaximum​(boolean b)
        Maps JInternalFrame.setMaximum(boolean) through queue
      • setResizable

        public void setResizable​(boolean b)
        Maps JInternalFrame.setResizable(boolean) through queue
      • setSelected

        public void setSelected​(boolean b)
        Maps JInternalFrame.setSelected(boolean) through queue
      • setTitle

        public void setTitle​(java.lang.String string)
        Maps JInternalFrame.setTitle(String) through queue
      • setUI

        public void setUI​(javax.swing.plaf.InternalFrameUI internalFrameUI)
        Maps JInternalFrame.setUI(InternalFrameUI) through queue
      • toBack

        public void toBack()
        Maps JInternalFrame.toBack() through queue
      • toFront

        public void toFront()
        Maps JInternalFrame.toFront() through queue
      • findTitlePane

        protected java.awt.Container findTitlePane()
        Uses InternalframeDriver to get a title pane.
        Returns:
        a title pane.
      • initOperators

        protected void initOperators()
        Initiaites suboperators.