17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package org.jemmy.lookup; 27 28 import java.io.PrintStream; 29 import org.jemmy.interfaces.*; 30 import org.jemmy.control.Wrap; 31 import org.jemmy.env.Environment; 32 import org.jemmy.env.Timeout; 33 34 35 /** 36 * A searcheable container of a set on UI controls. 37 * @param <CONTROL> 38 * @author shura 39 */ 40 public interface Lookup<CONTROL> extends Parent<CONTROL> { 41 /** 42 * Default wait control timeout. 43 * @see Timeout 44 * @see Environment 45 */ 46 public static final Timeout WAIT_CONTROL_TIMEOUT = new Timeout("wait.control", 10000); 47 /** 48 * Reruns the search until the number of found components is equal or greater 49 * than required. 50 * @param count 51 * @return this or another Lookup instance. 52 */ 53 public Lookup<? extends CONTROL> wait(int count); 54 /** 55 * Creates an instance of the Wrap class for one of the found UI controls. 56 * @see Wrap 57 * @param index 58 * @return 59 */ 60 public Wrap<? extends CONTROL> wrap(int index); 61 /** 62 * Same as <code>wrap(0)</code> 63 * @see #wrap(int) 64 * @return 65 */ 66 public Wrap<? extends CONTROL> wrap(); 67 68 /** 69 * Returns one of the found UI controls itself. 70 * @param index 71 * @return 72 */ 73 public CONTROL get(int index); 74 /** 75 * Same as <code>get(0)</code> 76 * @see #get(int) 77 * @return 78 */ 79 public CONTROL get(); 80 81 /** 82 * Same as <code>wrap(index).as(interfaceClass)</code> 83 * @param <INTERFACE> 84 * @param index 85 * @param interfaceClass 86 * @return 87 * @see #wrap(int) 88 * @see Wrap#as(java.lang.Class) 89 */ 90 public <INTERFACE extends ControlInterface> INTERFACE as(int index, Class<INTERFACE> interfaceClass); 91 /** 92 * Same as <code>wrap().as(interfaceClass)</code> 93 * @param <INTERFACE> 94 * @param interfaceClass 95 * @return 96 * @see #wrap() 97 * @see Wrap#as(java.lang.Class) 98 */ 99 public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> interfaceClass); 100 /** 101 * Same as <code>wrap(index).as(interfaceClass, type)</code> 102 * @param <TYPE> 103 * @param <INTERFACE> 104 * @param index 105 * @param interfaceClass 106 * @param type 107 * @return 108 * @see #wrap(int) 109 * @see Wrap#as(java.lang.Class, java.lang.Class) 110 */ 111 public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(int index, Class<INTERFACE> interfaceClass, Class<TYPE> type); 112 /** 113 * Same as <code>wrap().as(interfaceClass, type)</code> 114 * @param <TYPE> 115 * @param <INTERFACE> 116 * @param interfaceClass 117 * @param type 118 * @return 119 * @see #wrap(int) 120 * @see Wrap#as(java.lang.Class, java.lang.Class) 121 */ 122 public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type); 123 124 /** 125 * 126 * @return 127 */ 128 public int size(); 129 130 /** 131 * 132 * @param out 133 */ 134 public void dump(PrintStream out); 135 } | 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package org.jemmy.lookup; 27 28 import java.io.PrintStream; 29 import org.jemmy.interfaces.*; 30 import org.jemmy.control.Wrap; 31 import org.jemmy.env.Environment; 32 import org.jemmy.env.Timeout; 33 34 35 /** 36 * A searcheable container of a set on UI controls. 37 * 38 * @author shura 39 */ 40 public interface Lookup<CONTROL> extends Parent<CONTROL> { 41 /** 42 * Default wait control timeout. 43 * @see Timeout 44 * @see Environment 45 */ 46 public static final Timeout WAIT_CONTROL_TIMEOUT = new Timeout("wait.control", 10000); 47 /** 48 * Reruns the search until the number of found components is equal or greater 49 * than required. 50 * @param count todo document 51 * @return this or another Lookup instance. 52 */ 53 public Lookup<? extends CONTROL> wait(int count); 54 /** 55 * Creates an instance of the Wrap class for one of the found UI controls. 56 * @see Wrap 57 * @param index todo document 58 * @return todo document 59 */ 60 public Wrap<? extends CONTROL> wrap(int index); 61 /** 62 * Same as <code>wrap(0)</code> 63 * @see #wrap(int) 64 * @return todo document 65 */ 66 public Wrap<? extends CONTROL> wrap(); 67 68 /** 69 * Returns one of the found UI controls itself. 70 * @param index todo document 71 * @return todo document 72 */ 73 public CONTROL get(int index); 74 /** 75 * Same as <code>get(0)</code> 76 * @see #get(int) 77 * @return todo document 78 */ 79 public CONTROL get(); 80 81 /** 82 * Same as <code>wrap(index).as(interfaceClass)</code> 83 * @param <INTERFACE> todo document 84 * @param index todo document 85 * @param interfaceClass todo document 86 * @return todo document 87 * @see #wrap(int) 88 * @see Wrap#as(java.lang.Class) 89 */ 90 public <INTERFACE extends ControlInterface> INTERFACE as(int index, Class<INTERFACE> interfaceClass); 91 /** 92 * Same as <code>wrap().as(interfaceClass)</code> 93 * @param <INTERFACE> todo document 94 * @param interfaceClass todo document 95 * @return todo document 96 * @see #wrap() 97 * @see Wrap#as(java.lang.Class) 98 */ 99 public <INTERFACE extends ControlInterface> INTERFACE as(Class<INTERFACE> interfaceClass); 100 /** 101 * Same as <code>wrap(index).as(interfaceClass, type)</code> 102 * @param <TYPE> todo document 103 * @param <INTERFACE> todo document 104 * @param index todo document 105 * @param interfaceClass todo document 106 * @param type todo document 107 * @return todo document 108 * @see #wrap(int) 109 * @see Wrap#as(java.lang.Class, java.lang.Class) 110 */ 111 public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(int index, Class<INTERFACE> interfaceClass, Class<TYPE> type); 112 /** 113 * Same as <code>wrap().as(interfaceClass, type)</code> 114 * @param <TYPE> todo document 115 * @param <INTERFACE> todo document 116 * @param interfaceClass todo document 117 * @param type todo document 118 * @return todo document 119 * @see #wrap(int) 120 * @see Wrap#as(java.lang.Class, java.lang.Class) 121 */ 122 public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE as(Class<INTERFACE> interfaceClass, Class<TYPE> type); 123 124 public int size(); 125 126 public void dump(PrintStream out); 127 } |