Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Copyright 2012-2015 the original author or authors.
 
 package org.assertj.swing.conditions;
 
 
A Condition that requires a component to be visible.

Author(s):
Peter Murray
 
 public class ComponentVisibleCondition extends Condition {
 
   private final ComponentFinder _finder;
 
   private final ComponentMatcher _matcher;
 
   private Component _found;

  
Creates a new ComponentVisibleCondition

Parameters:
name The name of the component to find.
type The type of the component to find.
 
   public ComponentVisibleCondition(String nameClass<? extends Componenttype) {
 	this(BasicComponentFinder.finderWithCurrentAwtHierarchy(),
 	     new NameMatcher(nametypetrue));
   }

  
Creates a new ComponentVisibleCondition

Parameters:
name The name of the component to find.
 
   public ComponentVisibleCondition(String name) {
 	this(BasicComponentFinder.finderWithCurrentAwtHierarchy(),
 	     new NameMatcher(nametrue));
   }

  
Creates a new ComponentVisibleCondition

Parameters:
finder performs the component search.
matcher specifies the condition that the component we are looking for needs to match.
 
 	                               ComponentMatcher matcher) {
 	this("Component Visible Condition"findermatcher);
   }

  
Creates a new ComponentVisibleCondition

Parameters:
description the description of this condition.
finder performs the component search.
matcher specifies the condition that the component we are looking for needs to match.
 
   public ComponentVisibleCondition(String description,
 	                               ComponentFinder finder,
 	                               ComponentMatcher matcher) {
 	super(description);
 	 = finder;
 	 = matcher;
   }

  
Returns true if a component that matches the search criteria in this condition's org.assertj.swing.core.ComponentMatcher can be found. Otherwise, this method returns false.

Returns:
true if a matching component can be found, false otherwise.
 
   @Override
   public boolean test() {
 	try {
 	  return .isVisible();
 	} catch (ComponentLookupException e) {
 	}
	return false;
  }
  public Component found() {
	return ;
  }
New to GrepCode? Check out our FAQ X