< prev index next >

SWT/JemmySWT/src/org/jemmy/swt/lookup/ByItemLookup.java

Print this page




  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 package org.jemmy.swt.lookup;
  26 
  27 import org.eclipse.swt.custom.CTabFolder;
  28 import org.eclipse.swt.widgets.Combo;
  29 import org.eclipse.swt.widgets.Composite;
  30 import org.eclipse.swt.widgets.Item;
  31 import org.eclipse.swt.widgets.TabFolder;
  32 import org.eclipse.swt.widgets.Table;
  33 import org.eclipse.swt.widgets.ToolBar;
  34 import org.eclipse.swt.widgets.Tree;
  35 import org.jemmy.resources.StringComparePolicy;
  36 
  37 /**
  38  *
  39  * @param <T>
  40  * @author klara, erikgreijus
  41  */
  42 public class ByItemLookup<T extends Composite> extends QueueLookup<T> {
  43 
  44     private final StringComparePolicy policy;
  45     private final String text;
  46 
  47     public ByItemLookup(String text) {
  48         this(text, StringComparePolicy.SUBSTRING);
  49     }
  50 
  51     public ByItemLookup(String text, StringComparePolicy policy) {
  52         this.policy = policy;
  53         this.text = text;
  54     }
  55 
  56     @Override
  57     public boolean doCheck(final T control) {
  58         Object[] items = null;
  59         if (Tree.class.isInstance(control)) {
  60             items = Tree.class.cast(control).getItems();




  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 package org.jemmy.swt.lookup;
  26 
  27 import org.eclipse.swt.custom.CTabFolder;
  28 import org.eclipse.swt.widgets.Combo;
  29 import org.eclipse.swt.widgets.Composite;
  30 import org.eclipse.swt.widgets.Item;
  31 import org.eclipse.swt.widgets.TabFolder;
  32 import org.eclipse.swt.widgets.Table;
  33 import org.eclipse.swt.widgets.ToolBar;
  34 import org.eclipse.swt.widgets.Tree;
  35 import org.jemmy.resources.StringComparePolicy;
  36 
  37 /**
  38  * @author shura
  39  * @author erikgreijus

  40  */
  41 public class ByItemLookup<T extends Composite> extends QueueLookup<T> {
  42 
  43     private final StringComparePolicy policy;
  44     private final String text;
  45 
  46     public ByItemLookup(String text) {
  47         this(text, StringComparePolicy.SUBSTRING);
  48     }
  49 
  50     public ByItemLookup(String text, StringComparePolicy policy) {
  51         this.policy = policy;
  52         this.text = text;
  53     }
  54 
  55     @Override
  56     public boolean doCheck(final T control) {
  57         Object[] items = null;
  58         if (Tree.class.isInstance(control)) {
  59             items = Tree.class.cast(control).getItems();


< prev index next >