Class JProgressBarOperator

All Implemented Interfaces:
Outputable, Timeoutable

public class JProgressBarOperator extends JComponentOperator implements Timeoutable, Outputable
Operator is supposed to be used to operate with an instance of javax.swing.JProgressBar class.

Timeouts used:
JProgressBarOperator.WaitValueTimeout - used from waitValue() method
.
Author:
Alexandre Iline (alexandre.iline@sun.com)
See Also:
  • Field Details

  • Constructor Details

    • JProgressBarOperator

      public JProgressBarOperator(JProgressBar b)
      Constructor.
      Parameters:
      b - JProgressBar component.
    • JProgressBarOperator

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

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

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

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

    • findJProgressBar

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

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

      public static JProgressBar findJProgressBar(Container cont, int index)
      Searches JProgressBar in container.
      Parameters:
      cont - Container to search component in.
      index - Ordinal component index.
      Returns:
      JProgressBar instance or null if component was not found.
    • findJProgressBar

      public static JProgressBar findJProgressBar(Container cont)
      Searches 0'th JProgressBar in container.
      Parameters:
      cont - Container to search component in.
      Returns:
      JProgressBar instance or null if component was not found.
    • waitJProgressBar

      public static JProgressBar waitJProgressBar(Container cont, ComponentChooser chooser, int index)
      Waits JProgressBar in container.
      Parameters:
      cont - Container to search component in.
      chooser - org.netbeans.jemmy.ComponentChooser implementation.
      index - Ordinal component index.
      Returns:
      JProgressBar instance or null if component was not displayed.
      Throws:
      TimeoutExpiredException
    • waitJProgressBar

      public static JProgressBar waitJProgressBar(Container cont, ComponentChooser chooser)
      Waits 0'th JProgressBar in container.
      Parameters:
      cont - Container to search component in.
      chooser - org.netbeans.jemmy.ComponentChooser implementation.
      Returns:
      JProgressBar instance or null if component was not displayed.
      Throws:
      TimeoutExpiredException
    • waitJProgressBar

      public static JProgressBar waitJProgressBar(Container cont, int index)
      Waits JProgressBar in container.
      Parameters:
      cont - Container to search component in.
      index - Ordinal component index.
      Returns:
      JProgressBar instance or null if component was not displayed.
      Throws:
      TimeoutExpiredException
    • waitJProgressBar

      public static JProgressBar waitJProgressBar(Container cont)
      Waits 0'th JProgressBar in container.
      Parameters:
      cont - Container to search component in.
      Returns:
      JProgressBar instance or null if component was not displayed.
      Throws:
      TimeoutExpiredException
    • setTimeouts

      public void setTimeouts(Timeouts timeouts)
      Description copied from interface: Timeoutable
      Defines current timeouts.
      Specified by:
      setTimeouts in interface Timeoutable
      Overrides:
      setTimeouts in class JComponentOperator
      Parameters:
      timeouts - 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:
    • 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:
    • waitValue

      public void waitValue(JProgressBarOperator.ValueChooser chooser)
      Deprecated.
      Use waitState(ComponentChooser) instead.
      Waits for criteria defined by chooser to be reached.
      Parameters:
      chooser - an object specifying waiting criteria.
      See Also:
    • waitValue

      public void waitValue(int value)
      Waits progress bar value to be less or equal to value parameter. Can be used for typical progress bar (when value is increasing).
      Parameters:
      value - a value to reach.
      See Also:
    • waitValue

      public void waitValue(String value)
      Waits progress bar string to match value parameter.
      Parameters:
      value - a string value.
      See Also:
    • getDump

      public Hashtable getDump()
      Description copied from class: ComponentOperator
      Returns information about component.
      Overrides:
      getDump in class JComponentOperator
      Returns:
      a Hashtable containing name-value pairs.
    • addChangeListener

      public void addChangeListener(ChangeListener changeListener)
      Maps JProgressBar.addChangeListener(ChangeListener) through queue
    • getMaximum

      public int getMaximum()
      Maps JProgressBar.getMaximum() through queue
    • getMinimum

      public int getMinimum()
      Maps JProgressBar.getMinimum() through queue
    • getModel

      public BoundedRangeModel getModel()
      Maps JProgressBar.getModel() through queue
    • getOrientation

      public int getOrientation()
      Maps JProgressBar.getOrientation() through queue
    • getPercentComplete

      public double getPercentComplete()
      Maps JProgressBar.getPercentComplete() through queue
    • getString

      public String getString()
      Maps JProgressBar.getString() through queue
    • getUI

      public ProgressBarUI getUI()
      Maps JProgressBar.getUI() through queue
    • getValue

      public int getValue()
      Maps JProgressBar.getValue() through queue
    • isBorderPainted

      public boolean isBorderPainted()
      Maps JProgressBar.isBorderPainted() through queue
    • isStringPainted

      public boolean isStringPainted()
      Maps JProgressBar.isStringPainted() through queue
    • removeChangeListener

      public void removeChangeListener(ChangeListener changeListener)
      Maps JProgressBar.removeChangeListener(ChangeListener) through queue
    • setBorderPainted

      public void setBorderPainted(boolean b)
      Maps JProgressBar.setBorderPainted(boolean) through queue
    • setMaximum

      public void setMaximum(int i)
      Maps JProgressBar.setMaximum(int) through queue
    • setMinimum

      public void setMinimum(int i)
      Maps JProgressBar.setMinimum(int) through queue
    • setModel

      public void setModel(BoundedRangeModel boundedRangeModel)
      Maps JProgressBar.setModel(BoundedRangeModel) through queue
    • setOrientation

      public void setOrientation(int i)
      Maps JProgressBar.setOrientation(int) through queue
    • setString

      public void setString(String string)
      Maps JProgressBar.setString(String) through queue
    • setStringPainted

      public void setStringPainted(boolean b)
      Maps JProgressBar.setStringPainted(boolean) through queue
    • setUI

      public void setUI(ProgressBarUI progressBarUI)
      Maps JProgressBar.setUI(ProgressBarUI) through queue
    • setValue

      public void setValue(int i)
      Maps JProgressBar.setValue(int) through queue