Coverage Report - org.eclipse.swtbot.swt.finder.waits.WaitForWidgetInParent
 
Classes in this File Line Coverage Branch Coverage Complexity
WaitForWidgetInParent
100%
5/5
N/A
1
 
 1  
 /*******************************************************************************
 2  
  * Copyright (c) 2008 Ketan Padegaonkar and others.
 3  
  * All rights reserved. This program and the accompanying materials
 4  
  * are made available under the terms of the Eclipse Public License v1.0
 5  
  * which accompanies this distribution, and is available at
 6  
  * http://www.eclipse.org/legal/epl-v10.html
 7  
  *
 8  
  * Contributors:
 9  
  *     Ketan Padegaonkar - initial API and implementation
 10  
  *******************************************************************************/
 11  
 package org.eclipse.swtbot.swt.finder.waits;
 12  
 
 13  
 import java.util.List;
 14  
 
 15  
 import org.eclipse.swt.widgets.Widget;
 16  
 import org.hamcrest.Matcher;
 17  
 
 18  
 /**
 19  
  * @author Ketan Padegaonkar <KetanPadegaonkar [at] gmail [dot] com>
 20  
  * @see Conditions
 21  
  * @version $Id$
 22  
  * @since 2.0
 23  
  */
 24  
 class WaitForWidgetInParent<T extends Widget> extends WaitForObjectCondition<T> {
 25  
 
 26  
         private final Widget        parent;
 27  
 
 28  
         WaitForWidgetInParent(Matcher<T> matcher, Widget parent) {
 29  14
                 super(matcher);
 30  14
                 this.parent = parent;
 31  14
         }
 32  
 
 33  
         public String getFailureMessage() {
 34  1
                 return "Could not find widget matching: " + matcher; //$NON-NLS-1$
 35  
         }
 36  
 
 37  
         protected List<T> findMatches() {
 38  24
                 return bot.getFinder().findControls(parent, matcher, true);
 39  
         }
 40  
 
 41  
 }