Class JDialogOperator

  • All Implemented Interfaces:
    Outputable, Timeoutable

    public class JDialogOperator
    extends DialogOperator


    Timeouts used:
    DialogWaiter.WaitDialogTimeout - time to wait dialog displayed
    DialogWaiter.AfterDialogTimeout - time to sleep after dialog has been dispayed
    .
    Author:
    Alexandre Iline (alexandre.iline@sun.com)
    See Also:
    Timeouts
    • Constructor Detail

      • JDialogOperator

        public JDialogOperator​(JDialog w)
        Constructor.
        Parameters:
        w - a component
      • JDialogOperator

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

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

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

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

        public JDialogOperator​(WindowOperator owner,
                               ComponentChooser chooser)
        Constructs a JDialogOperator object.
        Parameters:
        owner - window - owner
        chooser - a component chooser specifying searching criteria.
      • JDialogOperator

        public JDialogOperator​(WindowOperator owner,
                               String title,
                               int index)
        Constructor. Waits for the dialog with "title" subtitle. Uses owner's timeout and output for waiting and to init operator.
        Parameters:
        owner - Operator pointing to a window owner.
        title - The desired title.
        index - Ordinal index. The first dialog has index 0.
        See Also:
        Operator.isCaptionEqual(String, String, boolean, boolean)
      • JDialogOperator

        public JDialogOperator​(WindowOperator owner,
                               int index)
        Constructor. Waits for the index'th dialog between owner's children. Uses owner'th timeout and output for waiting and to init operator.
        Parameters:
        owner - Operator pointing to a window owner.
        index - Ordinal component index.
      • JDialogOperator

        public JDialogOperator​(WindowOperator owner)
        Constructor. Waits for the first dialog between owner's children. Uses owner'th timeout and output for waiting and to init operator.
        Parameters:
        owner - Operator pointing to a window owner.
      • JDialogOperator

        public JDialogOperator​(String title,
                               int index,
                               Operator env)
        Constructor. Waits for the dialog 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.
        See Also:
        Operator.isCaptionEqual(String, String, boolean, boolean)
      • JDialogOperator

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

        public JDialogOperator()
        Constructor. Waits for the first dialog. Uses current timeout and output for waiting and to init operator.
    • Method Detail

      • findJDialog

        public static JDialog findJDialog​(ComponentChooser chooser,
                                          int index)
        Searches an index'th dialog.
        Parameters:
        chooser - a component chooser specifying searching criteria.
        index - an index between appropriate ones.
        Returns:
        JDialog instance or null if component was not found.
      • findJDialog

        public static JDialog findJDialog​(ComponentChooser chooser)
        Searches a dialog.
        Parameters:
        chooser - a component chooser specifying searching criteria.
        Returns:
        JDialog instance or null if component was not found.
      • findJDialog

        public static JDialog findJDialog​(String title,
                                          boolean ce,
                                          boolean cc,
                                          int index)
        Searches an index'th dialog by title.
        Parameters:
        title - Dialog title
        ce - Compare exactly. If true, text can be a substring of caption.
        cc - Compare case sensitively. If true, both text and caption are
        index - an index between appropriate ones.
        Returns:
        JDialog instance or null if component was not found.
      • findJDialog

        public static JDialog findJDialog​(String title,
                                          boolean ce,
                                          boolean cc)
        Searches a dialog by title.
        Parameters:
        title - Dialog title
        ce - Compare exactly. If true, text can be a substring of caption.
        cc - Compare case sensitively. If true, both text and caption are
        Returns:
        JDialog instance or null if component was not found.
      • findJDialog

        public static JDialog findJDialog​(Window owner,
                                          ComponentChooser chooser,
                                          int index)
        Searches an index'th dialog between owner's owned windows.
        Parameters:
        owner - Window - dialog owner.
        chooser - a component chooser specifying searching criteria.
        index - an index between appropriate ones.
        Returns:
        JDialog instance or null if component was not found.
      • findJDialog

        public static JDialog findJDialog​(Window owner,
                                          ComponentChooser chooser)
        Searches a dialog between owner's owned windows.
        Parameters:
        owner - Window - dialog owner.
        chooser - a component chooser specifying searching criteria.
        Returns:
        JDialog instance or null if component was not found.
      • findJDialog

        public static JDialog findJDialog​(Window owner,
                                          String title,
                                          boolean ce,
                                          boolean cc,
                                          int index)
        Searches an index'th dialog by title between owner's owned windows.
        Parameters:
        owner - Window - dialog owner.
        title - Dialog title
        ce - Compare exactly. If true, text can be a substring of caption.
        cc - Compare case sensitively. If true, both text and caption are
        index - an index between appropriate ones.
        Returns:
        JDialog instance or null if component was not found.
      • findJDialog

        public static JDialog findJDialog​(Window owner,
                                          String title,
                                          boolean ce,
                                          boolean cc)
        Searches a dialog by title between owner's owned windows.
        Parameters:
        owner - Window - dialog owner.
        title - Dialog title
        ce - Compare exactly. If true, text can be a substring of caption.
        cc - Compare case sensitively. If true, both text and caption are
        Returns:
        JDialog instance or null if component was not found.
      • waitJDialog

        public static JDialog waitJDialog​(ComponentChooser chooser,
                                          int index)
        Waits an index'th dialog.
        Parameters:
        chooser - a component chooser specifying searching criteria.
        index - an index between appropriate ones.
        Returns:
        JDialog instance or null if component was not found.
      • waitJDialog

        public static JDialog waitJDialog​(ComponentChooser chooser)
        Waits a dialog.
        Parameters:
        chooser - a component chooser specifying searching criteria.
        Returns:
        JDialog instance or null if component was not found.
      • waitJDialog

        public static JDialog waitJDialog​(String title,
                                          boolean ce,
                                          boolean cc,
                                          int index)
        Waits an index'th dialog by title.
        Parameters:
        title - Dialog title
        ce - Compare exactly. If true, text can be a substring of caption.
        cc - Compare case sensitively. If true, both text and caption are
        index - an index between appropriate ones.
        Returns:
        JDialog instance or null if component was not found.
      • waitJDialog

        public static JDialog waitJDialog​(String title,
                                          boolean ce,
                                          boolean cc)
        Waits a dialog by title.
        Parameters:
        title - Dialog title
        ce - Compare exactly. If true, text can be a substring of caption.
        cc - Compare case sensitively. If true, both text and caption are
        Returns:
        JDialog instance or null if component was not found.
      • waitJDialog

        public static JDialog waitJDialog​(Window owner,
                                          ComponentChooser chooser,
                                          int index)
        Waits an index'th dialog between owner's owned windows.
        Parameters:
        owner - Window - dialog owner.
        chooser - a component chooser specifying searching criteria.
        index - an index between appropriate ones.
        Returns:
        JDialog instance or null if component was not found.
      • waitJDialog

        public static JDialog waitJDialog​(Window owner,
                                          ComponentChooser chooser)
        Waits a dialog between owner's owned windows.
        Parameters:
        owner - Window - dialog owner.
        chooser - a component chooser specifying searching criteria.
        Returns:
        JDialog instance or null if component was not found.
      • waitJDialog

        public static JDialog waitJDialog​(Window owner,
                                          String title,
                                          boolean ce,
                                          boolean cc,
                                          int index)
        Waits an index'th dialog by title between owner's owned windows.
        Parameters:
        owner - Window - dialog owner.
        title - Dialog title
        ce - Compare exactly. If true, text can be a substring of caption.
        cc - Compare case sensitively. If true, both text and caption are
        index - an index between appropriate ones.
        Returns:
        JDialog instance or null if component was not found.
      • waitJDialog

        public static JDialog waitJDialog​(Window owner,
                                          String title,
                                          boolean ce,
                                          boolean cc)
        Waits a dialog by title between owner's owned windows.
        Parameters:
        owner - Window - dialog owner.
        title - Dialog title
        ce - Compare exactly. If true, text can be a substring of caption.
        cc - Compare case sensitively. If true, both text and caption are
        Returns:
        JDialog instance or null if component was not found.
      • getTopModalDialog

        public static Dialog getTopModalDialog()
        Searhs for modal dialog currently staying on top.
        Returns:
        dialog or null if no modal dialog is currently displayed.
      • getAccessibleContext

        public AccessibleContext getAccessibleContext()
        Maps JDialog.getAccessibleContext() through queue
      • getContentPane

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

        public int getDefaultCloseOperation()
        Maps JDialog.getDefaultCloseOperation() through queue
      • getGlassPane

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

        public JMenuBar getJMenuBar()
        Maps JDialog.getJMenuBar() through queue
      • getLayeredPane

        public JLayeredPane getLayeredPane()
        Maps JDialog.getLayeredPane() through queue
      • getRootPane

        public JRootPane getRootPane()
        Maps JDialog.getRootPane() through queue
      • setContentPane

        public void setContentPane​(Container container)
        Maps JDialog.setContentPane(Container) through queue
      • setDefaultCloseOperation

        public void setDefaultCloseOperation​(int i)
        Maps JDialog.setDefaultCloseOperation(int) through queue
      • setGlassPane

        public void setGlassPane​(Component component)
        Maps JDialog.setGlassPane(Component) through queue
      • setJMenuBar

        public void setJMenuBar​(JMenuBar jMenuBar)
        Maps JDialog.setJMenuBar(JMenuBar) through queue
      • setLayeredPane

        public void setLayeredPane​(JLayeredPane jLayeredPane)
        Maps JDialog.setLayeredPane(JLayeredPane) through queue
      • setLocationRelativeTo

        public void setLocationRelativeTo​(Component component)
        Maps JDialog.setLocationRelativeTo(Component) through queue
      • waitJDialog

        protected static JDialog waitJDialog​(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.
      • waitJDialog

        protected static JDialog waitJDialog​(WindowOperator owner,
                                             ComponentChooser chooser,
                                             int index)
        A method to be used from subclasses. Uses owner's timeouts and output during the waiting.
        Parameters:
        owner - a window - dialog owner.
        chooser - org.netbeans.jemmy.ComponentChooser implementation.
        index - Ordinal component index.
        Returns:
        Component instance or null if component was not found.
        Throws:
        TimeoutExpiredException
      • waitJDialog

        protected static JDialog waitJDialog​(Window owner,
                                             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:
        owner - a window - dialog owner.
        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.