code: public static Component findParentByClassname(final Component childComponent,
  		final Class<? extends Component> parentClass)
  	{
  		Component parent = childComponent.getParent();
  		while (parent != null)
  		{
  			if (ClassExtensions.equalsByClassName(parentClass, parent.getClass()))
  			{
  				break;
  			}
  			parent = parent.getParent();
  		}
  		return parent;
  	}
docs: Finds the first parent of the given childComponent from the given parentClass.
  
  @param childComponent
  the child component
  @param parentClass
  the parent class
  @return the component