code: public static <T> T getAncestorOfClass(final Class<T> clazz, final WComponent comp) {
  		if (comp == null || clazz == null) {
  			return null;
  		}
  
  		WComponent parent = comp.getParent();
  		while (parent != null) {
  			if (clazz.isInstance(parent)) {
  				return (T) parent;
  			}
  			parent = parent.getParent();
  		}
  
  		return null;
  	}
docs: Attempts to find a component which is an ancestor of the given component, and that is assignable to the given
  class.
  
  @param clazz the class to look for
  @param comp the component to start at.
  @return the matching ancestor, if found, otherwise null.
  
  @param <T> the ancestor class