< prev index next >

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

Print this page




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




  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 package org.jemmy.swt.lookup;
  26 
  27 import java.lang.reflect.Method;
  28 
  29 import org.eclipse.swt.custom.CTabFolder;
  30 import org.eclipse.swt.widgets.Composite;
  31 import org.eclipse.swt.widgets.Item;
  32 import org.eclipse.swt.widgets.TabFolder;
  33 import org.eclipse.swt.widgets.ToolBar;
  34 import org.jemmy.resources.StringComparePolicy;
  35 
  36 /**


  37  * @author klara
  38  */
  39 public class ByItemToolTipLookup<T extends Composite> extends QueueLookup<T> {
  40 
  41     private final StringComparePolicy policy;
  42     private final String text;
  43 
  44     public ByItemToolTipLookup(String text) {
  45         this(text, StringComparePolicy.SUBSTRING);
  46     }
  47 
  48     protected ByItemToolTipLookup(String text, StringComparePolicy policy) {
  49         this.policy = policy;
  50         this.text = text;
  51     }
  52 
  53     public boolean doCheck(final T control) {
  54         Item[] items = null;
  55         if (ToolBar.class.isInstance(control)) {
  56             items = ToolBar.class.cast(control).getItems();


< prev index next >