Class ScrollbarOperator

All Implemented Interfaces:
Outputable, Timeoutable

public class ScrollbarOperator extends ComponentOperator implements Timeoutable, Outputable


Timeouts used:
ScrollbarOperator.WholeScrollTimeout - time for one scroll click
ComponentOperator.WaitComponentTimeout - time to wait component displayed
.
Author:
Alexandre Iline (alexandre.iline@sun.com)
See Also:
  • Constructor Details

    • ScrollbarOperator

      public ScrollbarOperator(Scrollbar b)
      Constructs a ScrollbarOperator object.
      Parameters:
      b - a component
    • ScrollbarOperator

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

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

      public ScrollbarOperator(ContainerOperator cont, int index)
      Constructs a ScrollbarOperator object.
      Parameters:
      cont - a container
      index - an index between appropriate ones.
    • ScrollbarOperator

      public ScrollbarOperator(ContainerOperator cont)
      Constructs a ScrollbarOperator object.
      Parameters:
      cont - a container
  • Method Details

    • findScrollbar

      public static Scrollbar findScrollbar(Container cont, ComponentChooser chooser, int index)
      Finds a scrollbar.
      Parameters:
      cont - a container
      chooser - a component chooser specifying searching criteria.
      index - an index between appropriate ones.
      Returns:
      the scrollbar fitting searching criteria
    • findScrollbar

      public static Scrollbar findScrollbar(Container cont, ComponentChooser chooser)
      Finds a scrollbar.
      Parameters:
      cont - a container
      chooser - a component chooser specifying searching criteria.
      Returns:
      the scrollbar fitting searching criteria
    • findScrollbar

      public static Scrollbar findScrollbar(Container cont, int index)
      Finds a scrollbar.
      Parameters:
      cont - a container
      index - an index between appropriate ones.
      Returns:
      the scrollbar fitting searching criteria
    • findScrollbar

      public static Scrollbar findScrollbar(Container cont)
      Finds a scrollbar.
      Parameters:
      cont - a container
      Returns:
      the scrollbar fitting searching criteria
    • waitScrollbar

      public static Scrollbar waitScrollbar(Container cont, ComponentChooser chooser, int index)
      Waits a scrollbar.
      Parameters:
      cont - a container
      chooser - a component chooser specifying searching criteria.
      index - an index between appropriate ones.
      Returns:
      the scrollbar fitting searching criteria
    • waitScrollbar

      public static Scrollbar waitScrollbar(Container cont, ComponentChooser chooser)
      Waits a scrollbar.
      Parameters:
      cont - a container
      chooser - a component chooser specifying searching criteria.
      Returns:
      the scrollbar fitting searching criteria
    • waitScrollbar

      public static Scrollbar waitScrollbar(Container cont, int index)
      Waits a scrollbar.
      Parameters:
      cont - a container
      index - an index between appropriate ones.
      Returns:
      the scrollbar fitting searching criteria
    • waitScrollbar

      public static Scrollbar waitScrollbar(Container cont)
      Waits a scrollbar.
      Parameters:
      cont - a container
      Returns:
      the scrollbar fitting searching criteria
    • 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:
    • setTimeouts

      public void setTimeouts(Timeouts timeouts)
      Description copied from interface: Timeoutable
      Defines current timeouts.
      Specified by:
      setTimeouts in interface Timeoutable
      Overrides:
      setTimeouts in class ComponentOperator
      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 ComponentOperator
      Returns:
      the collection of current timeout assignments.
      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.
    • scrollTo

      public void scrollTo(Waitable w, Object waiterParam, boolean increase)
      Scrolls scrollbar to the position defined by w parameter. Uses ScrollDriver registered to this operator type.
      Parameters:
      w - Scrolling is stopped when w.actionProduced(waiterParam) != null
      waiterParam - a waiting parameter.
      increase - a scrolling direction.
      Throws:
      TimeoutExpiredException
    • scrollTo

      public void scrollTo(ScrollAdjuster adj)
      Scrolls scrollbar to the position defined by a ScrollAdjuster implementation.
      Parameters:
      adj - defines scrolling direction, and so on.
      Throws:
      TimeoutExpiredException
    • scrollToValue

      public void scrollToValue(int value)
      Scrolls scroll bar to necessary value.
      Parameters:
      value - Scroll bar value to scroll to.
      Throws:
      TimeoutExpiredException
    • scrollToValue

      public void scrollToValue(double proportionalValue)
      Scrolls scroll bar to necessary proportional value.
      Parameters:
      proportionalValue - Proportional scroll to. Must be >= 0 and <= 1.
      Throws:
      TimeoutExpiredException
    • scrollToMinimum

      public void scrollToMinimum()
      Scrolls to minimum value.
      Throws:
      TimeoutExpiredException
    • scrollToMaximum

      public void scrollToMaximum()
      Scrolls to maximum value.
      Throws:
      TimeoutExpiredException
    • addAdjustmentListener

      public void addAdjustmentListener(AdjustmentListener adjustmentListener)
      Maps Scrollbar.addAdjustmentListener(AdjustmentListener) through queue
    • getBlockIncrement

      public int getBlockIncrement()
      Maps Scrollbar.getBlockIncrement() through queue
    • getMaximum

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

      public int getMinimum()
      Maps Scrollbar.getMinimum() through queue
    • getOrientation

      public int getOrientation()
      Maps Scrollbar.getOrientation() through queue
    • getUnitIncrement

      public int getUnitIncrement()
      Maps Scrollbar.getUnitIncrement() through queue
    • getValue

      public int getValue()
      Maps Scrollbar.getValue() through queue
    • getVisibleAmount

      public int getVisibleAmount()
      Maps Scrollbar.getVisibleAmount() through queue
    • removeAdjustmentListener

      public void removeAdjustmentListener(AdjustmentListener adjustmentListener)
      Maps Scrollbar.removeAdjustmentListener(AdjustmentListener) through queue
    • setBlockIncrement

      public void setBlockIncrement(int i)
      Maps Scrollbar.setBlockIncrement(int) through queue
    • setMaximum

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

      public void setMinimum(int i)
      Maps Scrollbar.setMinimum(int) through queue
    • setOrientation

      public void setOrientation(int i)
      Maps Scrollbar.setOrientation(int) through queue
    • setUnitIncrement

      public void setUnitIncrement(int i)
      Maps Scrollbar.setUnitIncrement(int) through queue
    • setValue

      public void setValue(int i)
      Maps Scrollbar.setValue(int) through queue
    • setValues

      public void setValues(int i, int i1, int i2, int i3)
      Maps Scrollbar.setValues(int, int, int, int) through queue
    • setVisibleAmount

      public void setVisibleAmount(int i)
      Maps Scrollbar.setVisibleAmount(int) through queue