Class JTabbedPaneOperator

All Implemented Interfaces:
Outputable, Timeoutable

public class JTabbedPaneOperator extends JComponentOperator implements Outputable


Timeouts used:
ComponentOperator.WaitComponentTimeout - time to wait component displayed
.
Author:
Alexandre Iline (alexandre.iline@sun.com)
See Also:
  • Field Details

  • Constructor Details

    • JTabbedPaneOperator

      public JTabbedPaneOperator(JTabbedPane b)
      Constructor.
      Parameters:
      b - a component
    • JTabbedPaneOperator

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

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

      public JTabbedPaneOperator(ContainerOperator cont, String text, int tabIndex, int index)
      Constructor. Waits component by tab title first. Uses cont's timeout and output for waiting and to init operator.
      Parameters:
      cont - a container
      text - Tab title.
      tabIndex - a page index to check. if equal to -1, selected page is checked.
      index - Ordinal component index.
      Throws:
      TimeoutExpiredException
      See Also:
    • JTabbedPaneOperator

      public JTabbedPaneOperator(ContainerOperator cont, String text, int index)
      Constructor. Waits component by activetab title first. Uses cont's timeout and output for waiting and to init operator.
      Parameters:
      cont - a container
      text - Title of tab which is currently selected.
      index - Ordinal component index.
      Throws:
      TimeoutExpiredException
      See Also:
    • JTabbedPaneOperator

      public JTabbedPaneOperator(ContainerOperator cont, String text)
      Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.
      Parameters:
      cont - a container
      text - Title of tab which is currently selected.
      Throws:
      TimeoutExpiredException
      See Also:
    • JTabbedPaneOperator

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

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

    • findJTabbedPane

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

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

      public static JTabbedPane findJTabbedPane(Container cont, String text, boolean ce, boolean ccs, int itemIndex, int index)
      Searches JTabbedPane by tab title.
      Parameters:
      cont - Container to search component in.
      text - Tooltip text. If null, contents is not checked.
      ce - Compare text exactly.
      ccs - Compare text case sensitively.
      itemIndex - Tab index. if -1 selected one is checked.
      index - Ordinal component index.
      Returns:
      JTabbedPane instance or null if component was not found.
      See Also:
    • findJTabbedPane

      public static JTabbedPane findJTabbedPane(Container cont, String text, boolean ce, boolean ccs, int itemIndex)
      Searches JTabbedPane by tab title.
      Parameters:
      cont - Container to search component in.
      text - Tooltip text. If null, contents is not checked.
      ce - Compare text exactly.
      ccs - Compare text case sensitively.
      itemIndex - Tab index. if -1 selected one is checked.
      Returns:
      JTabbedPane instance or null if component was not found.
      See Also:
    • findJTabbedPaneUnder

      public static JTabbedPane findJTabbedPaneUnder(Component comp, ComponentChooser chooser)
      Searches JTabbedPane object which component lies on.
      Parameters:
      comp - Component to find JTabbedPane under.
      chooser - org.netbeans.jemmy.ComponentChooser implementation.
      Returns:
      JTabbedPane instance or null if component was not found.
    • findJTabbedPaneUnder

      public static JTabbedPane findJTabbedPaneUnder(Component comp)
      Searches JTabbedPane object which component lies on.
      Parameters:
      comp - Component to find JTabbedPane under.
      Returns:
      JTabbedPane instance or null if component was not found.
    • waitJTabbedPane

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

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

      public static JTabbedPane waitJTabbedPane(Container cont, String text, boolean ce, boolean ccs, int itemIndex, int index)
      Waits JTabbedPane by tab title.
      Parameters:
      cont - Container to search component in.
      text - Tooltip text. If null, contents is not checked.
      ce - Compare text exactly.
      ccs - Compare text case sensitively.
      itemIndex - Tab index. if -1 selected one is checked.
      index - Ordinal component index.
      Returns:
      JTabbedPane instance.
      Throws:
      TimeoutExpiredException
      See Also:
    • waitJTabbedPane

      public static JTabbedPane waitJTabbedPane(Container cont, String text, boolean ce, boolean ccs, int itemIndex)
      Waits JTabbedPane by tab title.
      Parameters:
      cont - Container to search component in.
      text - Tooltip text. If null, contents is not checked.
      ce - Compare text exactly.
      ccs - Compare text case sensitively.
      itemIndex - Tab index. if -1 selected one is checked.
      Returns:
      JTabbedPane instance.
      Throws:
      TimeoutExpiredException
      See Also:
    • setOutput

      public void setOutput(TestOut output)
      Description copied from interface: Outputable
      Defines print output streams or writers.
      Specified by:
      setOutput in interface Outputable
      Overrides:
      setOutput in class JComponentOperator
      Parameters:
      output - 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:
    • 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.
    • findPage

      public int findPage(JTabbedPaneOperator.TabPageChooser chooser)
      Deprecated.
      Use findPage(String) or findPage(String, StringComparator)
      Searches tab index by tab title.
      Parameters:
      chooser - page searching criteria
      Returns:
      a page index.
      See Also:
    • findPage

      public int findPage(String title, Operator.StringComparator comparator)
      Deprecated.
      Use findPage(String) or findPage(String, StringComparator)
      Searches tab index by tab title.
      Parameters:
      title - a page title.
      comparator - a string comparision algorithm
      Returns:
      a page index.
      See Also:
    • findPage

      public int findPage(String title, boolean ce, boolean ccs)
      Deprecated.
      Use findPage(String) or findPage(String, StringComparator)
      Searches tab index by tab title. isCaptionEqual method is used to compare page title with match.
      Parameters:
      title - a page title.
      ce - Compare text exactly.
      ccs - Compare text case sensitively.
      Returns:
      a page index.
      See Also:
    • findPage

      public int findPage(String title)
      Searches tab index by tab title. isCaptionEqual method is used to compare page title with match. Uses StringComparator assigned to this object.
      Parameters:
      title - a page title.
      Returns:
      a page index.
    • selectPage

      public Component selectPage(int index)
      Selects tab.
      Parameters:
      index - a page ordinal index.
      Returns:
      a root corresponding to the page.
    • selectPage

      public Component selectPage(JTabbedPaneOperator.TabPageChooser chooser)
      Selects tab.
      Parameters:
      chooser - page searching criteria
      Returns:
      a root corresponding to the page.
    • selectPage

      public Component selectPage(String title, Operator.StringComparator comparator)
      Selects tab.
      Parameters:
      title - a page title.
      comparator - a string comparision algorithm
      Returns:
      a root corresponding to the page.
    • selectPage

      public Component selectPage(String title, boolean ce, boolean ccs)
      Deprecated.
      Use selectPage(String) or selectPage(String, StringComparator)
      Selects tab by tab title.
      Parameters:
      title - a page title.
      ce - Compare text exactly.
      ccs - Compare text case sensitively.
      Returns:
      a root corresponding to the page.
      See Also:
    • selectPage

      public Component selectPage(String title)
      Selects tab by tab title. Uses StringComparator assigned to this object.
      Parameters:
      title - a page title.
      Returns:
      a root corresponding to the page.
    • waitPage

      public int waitPage(JTabbedPaneOperator.TabPageChooser chooser)
      Wait for a page to exist.
      Parameters:
      chooser - page searching criteria
      Returns:
      a page index.
    • waitPage

      public int waitPage(String title, Operator.StringComparator comparator)
      Wait for a page to exist.
      Parameters:
      title - a page title.
      comparator - a string comparision algorithm
      Returns:
      a page index.
    • waitPage

      public int waitPage(String title)
      Wait for a page to exist.
      Parameters:
      title - a page title.
      Returns:
      a page index.
    • waitSelected

      public void waitSelected(int pageIndex)
      Waits for a page to be selected.
      Parameters:
      pageIndex - an index of a page to be selected.
    • waitSelected

      public void waitSelected(String pageTitle)
      Waits for a page to be selected.
      Parameters:
      pageTitle - a title of a page to be selected.
    • 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 JTabbedPane.addChangeListener(ChangeListener) through queue
    • addTab

      public void addTab(String string, Component component)
      Maps JTabbedPane.addTab(String, Component) through queue
    • addTab

      public void addTab(String string, Icon icon, Component component)
      Maps JTabbedPane.addTab(String, Icon, Component) through queue
    • addTab

      public void addTab(String string, Icon icon, Component component, String string1)
      Maps JTabbedPane.addTab(String, Icon, Component, String) through queue
    • getBackgroundAt

      public Color getBackgroundAt(int i)
      Maps JTabbedPane.getBackgroundAt(int) through queue
    • getBoundsAt

      public Rectangle getBoundsAt(int i)
      Maps JTabbedPane.getBoundsAt(int) through queue
    • getComponentAt

      public Component getComponentAt(int i)
      Maps JTabbedPane.getComponentAt(int) through queue
    • getDisabledIconAt

      public Icon getDisabledIconAt(int i)
      Maps JTabbedPane.getDisabledIconAt(int) through queue
    • getForegroundAt

      public Color getForegroundAt(int i)
      Maps JTabbedPane.getForegroundAt(int) through queue
    • getIconAt

      public Icon getIconAt(int i)
      Maps JTabbedPane.getIconAt(int) through queue
    • getModel

      public SingleSelectionModel getModel()
      Maps JTabbedPane.getModel() through queue
    • getSelectedComponent

      public Component getSelectedComponent()
      Maps JTabbedPane.getSelectedComponent() through queue
    • getSelectedIndex

      public int getSelectedIndex()
      Maps JTabbedPane.getSelectedIndex() through queue
    • getTabCount

      public int getTabCount()
      Maps JTabbedPane.getTabCount() through queue
    • getTabPlacement

      public int getTabPlacement()
      Maps JTabbedPane.getTabPlacement() through queue
    • getTabRunCount

      public int getTabRunCount()
      Maps JTabbedPane.getTabRunCount() through queue
    • getTitleAt

      public String getTitleAt(int i)
      Maps JTabbedPane.getTitleAt(int) through queue
    • getUI

      public TabbedPaneUI getUI()
      Maps JTabbedPane.getUI() through queue
    • indexOfComponent

      public int indexOfComponent(Component component)
      Maps JTabbedPane.indexOfComponent(Component) through queue
    • indexOfTab

      public int indexOfTab(String string)
      Maps JTabbedPane.indexOfTab(String) through queue
    • indexOfTab

      public int indexOfTab(Icon icon)
      Maps JTabbedPane.indexOfTab(Icon) through queue
    • insertTab

      public void insertTab(String string, Icon icon, Component component, String string1, int i)
      Maps JTabbedPane.insertTab(String, Icon, Component, String, int) through queue
    • isEnabledAt

      public boolean isEnabledAt(int i)
      Maps JTabbedPane.isEnabledAt(int) through queue
    • removeChangeListener

      public void removeChangeListener(ChangeListener changeListener)
      Maps JTabbedPane.removeChangeListener(ChangeListener) through queue
    • removeTabAt

      public void removeTabAt(int i)
      Maps JTabbedPane.removeTabAt(int) through queue
    • setBackgroundAt

      public void setBackgroundAt(int i, Color color)
      Maps JTabbedPane.setBackgroundAt(int, Color) through queue
    • setComponentAt

      public void setComponentAt(int i, Component component)
      Maps JTabbedPane.setComponentAt(int, Component) through queue
    • setDisabledIconAt

      public void setDisabledIconAt(int i, Icon icon)
      Maps JTabbedPane.setDisabledIconAt(int, Icon) through queue
    • setEnabledAt

      public void setEnabledAt(int i, boolean b)
      Maps JTabbedPane.setEnabledAt(int, boolean) through queue
    • setForegroundAt

      public void setForegroundAt(int i, Color color)
      Maps JTabbedPane.setForegroundAt(int, Color) through queue
    • setIconAt

      public void setIconAt(int i, Icon icon)
      Maps JTabbedPane.setIconAt(int, Icon) through queue
    • setModel

      public void setModel(SingleSelectionModel singleSelectionModel)
      Maps JTabbedPane.setModel(SingleSelectionModel) through queue
    • setSelectedComponent

      public void setSelectedComponent(Component component)
      Maps JTabbedPane.setSelectedComponent(Component) through queue
    • setSelectedIndex

      public void setSelectedIndex(int i)
      Maps JTabbedPane.setSelectedIndex(int) through queue
    • setTabPlacement

      public void setTabPlacement(int i)
      Maps JTabbedPane.setTabPlacement(int) through queue
    • setTitleAt

      public void setTitleAt(int i, String string)
      Maps JTabbedPane.setTitleAt(int, String) through queue
    • setUI

      public void setUI(TabbedPaneUI tabbedPaneUI)
      Maps JTabbedPane.setUI(TabbedPaneUI) through queue