Class ListOperator

  • All Implemented Interfaces:
    Outputable, Timeoutable

    public class ListOperator
    extends ComponentOperator
    implements Outputable


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

      • ITEM_PREFIX_DPROP

        public static final java.lang.String ITEM_PREFIX_DPROP
        Identifier for a "item" properties.
        See Also:
        getDump(), Constant Field Values
      • SELECTED_ITEM_PREFIX_DPROP

        public static final java.lang.String SELECTED_ITEM_PREFIX_DPROP
        Identifier for a "selected item" property.
        See Also:
        getDump(), Constant Field Values
    • Constructor Detail

      • ListOperator

        public ListOperator​(java.awt.List b)
        Constructor.
        Parameters:
        b - a component
      • ListOperator

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

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

        public ListOperator​(ContainerOperator cont,
                            java.lang.String text,
                            int itemIndex,
                            int index)
        Constructor. Waits item text first. Uses cont's timeout and output for waiting and to init operator.
        Parameters:
        cont - a container
        text - Text of item which is currently selected.
        itemIndex - Item index.
        index - Ordinal component index.
        Throws:
        TimeoutExpiredException
      • ListOperator

        public ListOperator​(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
      • ListOperator

        public ListOperator​(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 Detail

      • findList

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

        public static java.awt.List findList​(java.awt.Container cont,
                                             ComponentChooser chooser)
        Searches 0'th List in container.
        Parameters:
        cont - Container to search component in.
        chooser - org.netbeans.jemmy.ComponentChooser implementation.
        Returns:
        List instance or null if component was not found.
      • 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.
      • findItemIndex

        public int findItemIndex​(java.lang.String item,
                                 int index)
        Searches an item index.
        Parameters:
        item - item text.
        index - an ordinal index between appropriate ones.
        Returns:
        an index.
      • findItemIndex

        public int findItemIndex​(java.lang.String item)
        Searches an item index.
        Parameters:
        item - item text.
        Returns:
        an index.
      • selectItem

        public void selectItem​(java.lang.String item,
                               int index)
        Selects an item.
        Parameters:
        item - item text.
        index - an ordinal index between appropriate ones.
      • selectItem

        public void selectItem​(java.lang.String item)
        Selects an item.
        Parameters:
        item - item text.
      • selectItem

        public void selectItem​(int index)
        Selects an item.
        Parameters:
        index - an item index.
      • selectItems

        public void selectItems​(int from,
                                int to)
        Selects some items.
        Parameters:
        from - start selection index.
        to - end selection index.
      • waitItemsSelection

        public void waitItemsSelection​(int from,
                                       int to,
                                       boolean selected)
        Waits for items to be selected.
        Parameters:
        from - Start selection inex
        to - End selection inex
        selected - Selected (true) or unselected (false).
      • waitItemSelection

        public void waitItemSelection​(int itemIndex,
                                      boolean selected)
        Waits for item to be selected.
        Parameters:
        itemIndex - an item index to be selected.
        selected - Selected (true) or unselected (false).
      • getDump

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

        public void addActionListener​(java.awt.event.ActionListener actionListener)
        Maps List.addActionListener(ActionListener) through queue
      • addItemListener

        public void addItemListener​(java.awt.event.ItemListener itemListener)
        Maps List.addItemListener(ItemListener) through queue
      • deselect

        public void deselect​(int i)
        Maps List.deselect(int) through queue
      • getItem

        public java.lang.String getItem​(int i)
        Maps List.getItem(int) through queue
      • getItemCount

        public int getItemCount()
        Maps List.getItemCount() through queue
      • getItems

        public java.lang.String[] getItems()
        Maps List.getItems() through queue
      • getMinimumSize

        public java.awt.Dimension getMinimumSize​(int i)
        Maps List.getMinimumSize(int) through queue
      • getPreferredSize

        public java.awt.Dimension getPreferredSize​(int i)
        Maps List.getPreferredSize(int) through queue
      • getRows

        public int getRows()
        Maps List.getRows() through queue
      • getSelectedIndex

        public int getSelectedIndex()
        Maps List.getSelectedIndex() through queue
      • getSelectedIndexes

        public int[] getSelectedIndexes()
        Maps List.getSelectedIndexes() through queue
      • getSelectedItem

        public java.lang.String getSelectedItem()
        Maps List.getSelectedItem() through queue
      • getSelectedItems

        public java.lang.String[] getSelectedItems()
        Maps List.getSelectedItems() through queue
      • getSelectedObjects

        public java.lang.Object[] getSelectedObjects()
        Maps List.getSelectedObjects() through queue
      • getVisibleIndex

        public int getVisibleIndex()
        Maps List.getVisibleIndex() through queue
      • isIndexSelected

        public boolean isIndexSelected​(int i)
        Maps List.isIndexSelected(int) through queue
      • isMultipleMode

        public boolean isMultipleMode()
        Maps List.isMultipleMode() through queue
      • makeVisible

        public void makeVisible​(int i)
        Maps List.makeVisible(int) through queue
      • remove

        public void remove​(int i)
        Maps List.remove(int) through queue
      • remove

        public void remove​(java.lang.String string)
        Maps List.remove(String) through queue
      • removeActionListener

        public void removeActionListener​(java.awt.event.ActionListener actionListener)
        Maps List.removeActionListener(ActionListener) through queue
      • removeAll

        public void removeAll()
        Maps List.removeAll() through queue
      • removeItemListener

        public void removeItemListener​(java.awt.event.ItemListener itemListener)
        Maps List.removeItemListener(ItemListener) through queue
      • replaceItem

        public void replaceItem​(java.lang.String string,
                                int i)
        Maps List.replaceItem(String, int) through queue
      • select

        public void select​(int i)
        Maps List.select(int) through queue
      • setMultipleMode

        public void setMultipleMode​(boolean b)
        Maps List.setMultipleMode(boolean) through queue