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:
  • Field Details

  • Constructor Details

    • 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, 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:
    • JInternalFrameOperator

      public JInternalFrameOperator(ContainerOperator cont, String text)
      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.
      See Also:
    • 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 Details

    • 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:
    • 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:
    • 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:
    • waitJInternalFrame

      public static JInternalFrame waitJInternalFrame(Container cont, 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:
    • setOutput

      public void setOutput(TestOut out)
      Description copied from interface: Outputable
      Defines print output streams or writers.
      Specified by:
      setOutput in interface Outputable
      Overrides:
      setOutput in class JComponentOperator
      Parameters:
      out - Identify the streams or writers used for print output.
      See Also:
    • getOutput

      public TestOut getOutput()
      Description copied from interface: Outputable
      Returns print output streams or writers.
      Specified by:
      getOutput in interface Outputable
      Overrides:
      getOutput in class JComponentOperator
      Returns:
      an object that contains references to objects for printing to output and err streams.
      See Also:
    • setTimeouts

      public void setTimeouts(Timeouts times)
      Description copied from interface: Timeoutable
      Defines current timeouts.
      Specified by:
      setTimeouts in interface Timeoutable
      Overrides:
      setTimeouts in class JComponentOperator
      Parameters:
      times - A collection of timeout assignments.
      See Also:
    • getTimeouts

      public Timeouts getTimeouts()
      Description copied from interface: Timeoutable
      Return current timeouts.
      Specified by:
      getTimeouts in interface Timeoutable
      Overrides:
      getTimeouts in class JComponentOperator
      Returns:
      the collection of current timeout assignments.
      See Also:
    • iconify

      public void iconify()
      Iconifies frame. Note: frame should not be iconified and should be iconifiable.
      Throws:
      JInternalFrameOperator.WrongInternalFrameStateException
    • deiconify

      public void deiconify()
      Deiconifies frame. Note: frame should be iconified.
      Throws:
      JInternalFrameOperator.WrongInternalFrameStateException
    • maximize

      public void maximize()
      Maximizes frame. Note: frame should not be iconified.
      Throws:
      JInternalFrameOperator.WrongInternalFrameStateException
    • demaximize

      public void demaximize()
      Demaximizes frame. Note: frame should not be iconified.
      Throws:
      JInternalFrameOperator.WrongInternalFrameStateException
    • move

      public void move(int x, int y)
      Moves frame to new location. Note: frame should not be iconified.
      Parameters:
      x - X coordinate of a new frame location.
      y - Y coordinate of a new frame location.
      Throws:
      JInternalFrameOperator.WrongInternalFrameStateException
    • resize

      public void resize(int width, int height)
      Resizes frame. Note: frame should not be iconified.
      Parameters:
      width - New frame width.
      height - New frame height.
      Throws:
      JInternalFrameOperator.WrongInternalFrameStateException
    • activate

      public void activate()
      Activates frame. Note: frame should not be iconified.
      Throws:
      JInternalFrameOperator.WrongInternalFrameStateException
    • 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
    • getIconOperator

      Creates an operator for an desktop icon.
      Returns:
      an icon 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
    • getDesktopIcon

      public JInternalFrame.JDesktopIcon getDesktopIcon()
      Maps JInternalFrame.getDesktopIcon() 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.