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
    • Constructor Detail

      • JInternalFrameOperator

        public JInternalFrameOperator​(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,
                                      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 JInternalFrame findJInternalFrame​(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 JInternalFrame findJInternalFrame​(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 JInternalFrame findJInternalFrame​(Container cont,
                                                        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 JInternalFrame findJInternalFrame​(Container cont,
                                                        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 JInternalFrame findJInternalFrameUnder​(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 JInternalFrame findJInternalFrameUnder​(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 JInternalFrame waitJInternalFrame​(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 JInternalFrame waitJInternalFrame​(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 JInternalFrame waitJInternalFrame​(Container cont,
                                                        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)
      • 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​(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 Hashtable getDump()
        Returns information about component.
        Overrides:
        getDump in class JComponentOperator
        Returns:
        a Hashtable containing name-value pairs.
      • addInternalFrameListener

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

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

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

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

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

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

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

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

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

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

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

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

        public 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​(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​(Container container)
        Maps JInternalFrame.setContentPane(Container) through queue
      • setDefaultCloseOperation

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

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

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

        public void setGlassPane​(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​(JMenuBar jMenuBar)
        Maps JInternalFrame.setJMenuBar(JMenuBar) through queue
      • setLayer

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

        public void setLayeredPane​(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​(String string)
        Maps JInternalFrame.setTitle(String) through queue
      • setUI

        public void setUI​(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 Container findTitlePane()
        Uses InternalframeDriver to get a title pane.
        Returns:
        a title pane.
      • initOperators

        protected void initOperators()
        Initiaites suboperators.