Class DialogOperator

All Implemented Interfaces:
Outputable, Timeoutable
Direct Known Subclasses:
JDialogOperator

public class DialogOperator extends WindowOperator


Timeouts used:
DialogWaiter.WaitDialogTimeout - time to wait dialog displayed
DialogWaiter.AfterDialogTimeout - time to sleep after dialog has been dispayed
ComponentOperator.WaitStateTimeout - time to wait for title
.
Author:
Alexandre Iline (alexandre.iline@sun.com)
See Also:
  • Field Details

  • Constructor Details

    • DialogOperator

      public DialogOperator(Dialog w)
      Constructs a DialogOperator object.
      Parameters:
      w - window
    • DialogOperator

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

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

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

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

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

      public DialogOperator(WindowOperator owner, String title, int index)
      Constructor. Waits for a dialog to show. The dialog is identified as the index+1'th java.awt.Dialog that shows, is owned by the window managed by the WindowOperator owner, and that has the desired title. Uses owner's timeout and output for waiting and to init this operator.
      Parameters:
      owner - Operator pointing to a window owner.
      title - The desired title.
      index - Ordinal index. The first dialog has index 0.
      Throws:
      TimeoutExpiredException
      See Also:
    • DialogOperator

      public DialogOperator(WindowOperator owner, String title)
      Uses owner's timeout and output for waiting and to init operator. Waits for a dialog to show. The dialog is identified as the first java.awt.Dialog that shows, is owned by the window managed by the WindowOperator owner, and that has the desired title. Uses owner's timeout and output for waiting and to init this operator.
      Parameters:
      owner - Operator pointing to a window owner.
      title - The desired title.
      Throws:
      TimeoutExpiredException
      See Also:
    • DialogOperator

      public DialogOperator(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.
      Throws:
      TimeoutExpiredException
    • DialogOperator

      public DialogOperator(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.
      Throws:
      TimeoutExpiredException
    • DialogOperator

      public DialogOperator(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.
      Throws:
      TimeoutExpiredException
      See Also:
    • DialogOperator

      public DialogOperator(String title, int index)
      Constructor. Waits for the dialog with "title" subtitle. Uses current timeouts and output values.
      Parameters:
      title - a window title
      index - Ordinal component index.
      Throws:
      TimeoutExpiredException
      See Also:
    • DialogOperator

      public DialogOperator(String title)
      Constructor. Waits for the dialog with "title" subtitle. Uses current timeouts and output values.
      Parameters:
      title - a window title
      Throws:
      TimeoutExpiredException
      See Also:
    • DialogOperator

      public DialogOperator(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.
      Throws:
      TimeoutExpiredException
    • DialogOperator

      public DialogOperator()
      Constructor. Waits for the first dialog. Uses current timeout and output for waiting and to init operator.
      Throws:
      TimeoutExpiredException
  • Method Details

    • waitTitle

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

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

      public String getTitle()
      Maps Dialog.getTitle() through queue
    • isModal

      public boolean isModal()
      Maps Dialog.isModal() through queue
    • isResizable

      public boolean isResizable()
      Maps Dialog.isResizable() through queue
    • setModal

      public void setModal(boolean b)
      Maps Dialog.setModal(boolean) through queue
    • setResizable

      public void setResizable(boolean b)
      Maps Dialog.setResizable(boolean) through queue
    • setTitle

      public void setTitle(String string)
      Maps Dialog.setTitle(String) through queue
    • waitDialog

      protected static Dialog waitDialog(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.
    • waitDialog

      protected static Dialog waitDialog(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.
    • waitDialog

      protected static Dialog waitDialog(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.