Class CheckboxOperator

All Implemented Interfaces:
Outputable, Timeoutable

public class CheckboxOperator extends ComponentOperator implements Outputable


Timeouts used:
ButtonOperator.PushButtonTimeout - time between checkbox pressing and releasing
ComponentOperator.WaitComponentTimeout - time to wait checkbox displayed
ComponentOperator.WaitComponentEnabledTimeout - time to wait checkbox enabled
.
Author:
Alexandre Iline (alexandre.iline@sun.com)
See Also:
  • Field Details

  • Constructor Details

    • CheckboxOperator

      public CheckboxOperator(Checkbox b)
      Constructor.
      Parameters:
      b - a component
    • CheckboxOperator

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

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

      public CheckboxOperator(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 - container
      text - Checkbox text.
      index - Ordinal component index.
      Throws:
      TimeoutExpiredException
      See Also:
    • CheckboxOperator

      public CheckboxOperator(ContainerOperator cont, String text)
      Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.
      Parameters:
      cont - container
      text - Checkbox text.
      Throws:
      TimeoutExpiredException
      See Also:
    • CheckboxOperator

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

      public CheckboxOperator(ContainerOperator cont)
      Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.
      Parameters:
      cont - container
      Throws:
      TimeoutExpiredException
  • Method Details

    • findCheckbox

      public static Checkbox findCheckbox(Container cont, ComponentChooser chooser, int index)
      Searches Checkbox in container.
      Parameters:
      cont - Container to search component in.
      chooser - org.netbeans.jemmy.ComponentChooser implementation.
      index - Ordinal component index.
      Returns:
      Checkbox instance or null if component was not found.
    • findCheckbox

      public static Checkbox findCheckbox(Container cont, ComponentChooser chooser)
      Searches 0'th Checkbox in container.
      Parameters:
      cont - Container to search component in.
      chooser - org.netbeans.jemmy.ComponentChooser implementation.
      Returns:
      Checkbox instance or null if component was not found.
    • findCheckbox

      public static Checkbox findCheckbox(Container cont, String text, boolean ce, boolean ccs, int index)
      Searches Checkbox by text.
      Parameters:
      cont - Container to search component in.
      text - Checkbox text. If null, contents is not checked.
      ce - Compare text exactly.
      ccs - Compare text case sensitively.
      index - Ordinal component index.
      Returns:
      Checkbox instance or null if component was not found.
      See Also:
    • findCheckbox

      public static Checkbox findCheckbox(Container cont, String text, boolean ce, boolean ccs)
      Searches Checkbox by text.
      Parameters:
      cont - Container to search component in.
      text - Checkbox text. If null, contents is not checked.
      ce - Compare text exactly.
      ccs - Compare text case sensitively.
      Returns:
      Checkbox instance or null if component was not found.
      See Also:
    • waitCheckbox

      public static Checkbox waitCheckbox(Container cont, ComponentChooser chooser, int index)
      Waits Checkbox in container.
      Parameters:
      cont - Container to search component in.
      chooser - org.netbeans.jemmy.ComponentChooser implementation.
      index - Ordinal component index.
      Returns:
      Checkbox instance.
      Throws:
      TimeoutExpiredException
    • waitCheckbox

      public static Checkbox waitCheckbox(Container cont, ComponentChooser chooser)
      Waits 0'th Checkbox in container.
      Parameters:
      cont - Container to search component in.
      chooser - org.netbeans.jemmy.ComponentChooser implementation.
      Returns:
      Checkbox instance.
      Throws:
      TimeoutExpiredException
    • waitCheckbox

      public static Checkbox waitCheckbox(Container cont, String text, boolean ce, boolean ccs, int index)
      Waits Checkbox by text.
      Parameters:
      cont - Container to search component in.
      text - Checkbox text. If null, contents is not checked.
      ce - Compare text exactly.
      ccs - Compare text case sensitively.
      index - Ordinal component index.
      Returns:
      Checkbox instance.
      Throws:
      TimeoutExpiredException
      See Also:
    • waitCheckbox

      public static Checkbox waitCheckbox(Container cont, String text, boolean ce, boolean ccs)
      Waits Checkbox by text.
      Parameters:
      cont - Container to search component in.
      text - Checkbox text. If null, contents is not checked.
      ce - Compare text exactly.
      ccs - Compare text case sensitively.
      Returns:
      Checkbox instance.
      Throws:
      TimeoutExpiredException
      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 ComponentOperator
      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 ComponentOperator
      Returns:
      an object that contains references to objects for printing to output and err streams.
      See Also:
    • copyEnvironment

      public void copyEnvironment(Operator anotherOperator)
      Description copied from class: Operator
      Copies all environment (output, timeouts, visualizer) from another operator.
      Overrides:
      copyEnvironment in class ComponentOperator
      Parameters:
      anotherOperator - an operator to copy the environment to.
    • changeSelection

      public void changeSelection(boolean newValue)
      Changes selection if necessary. Uses a ButtonDriver registered for this operator.
      Parameters:
      newValue - a button selection.
    • changeSelectionNoBlock

      public void changeSelectionNoBlock(boolean selected)
      Runs changeSelection(boolean) method in a separate thread.
      Parameters:
      selected - a button selection.
    • waitSelected

      public void waitSelected(boolean selected)
      Waits for button to be selected.
      Parameters:
      selected - selection.
    • getDump

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

      public void addItemListener(ItemListener itemListener)
      Maps Checkbox.addItemListener(ItemListener) through queue
    • getCheckboxGroup

      public CheckboxGroup getCheckboxGroup()
      Maps Checkbox.getCheckboxGroup() through queue
    • getLabel

      public String getLabel()
      Maps Checkbox.getLabel() through queue
    • getState

      public boolean getState()
      Maps Checkbox.getState() through queue
    • removeItemListener

      public void removeItemListener(ItemListener itemListener)
      Maps Checkbox.removeItemListener(ItemListener) through queue
    • setCheckboxGroup

      public void setCheckboxGroup(CheckboxGroup grp)
      Maps Checkbox.setCheckboxGroup(CheckboxGroup) through queue
    • setLabel

      public void setLabel(String string)
      Maps Checkbox.setLabel(String) through queue
    • setState

      public void setState(boolean state)
      Maps Checkbox.setState(boolean) through queue