code: public static boolean isAncestor(final WComponent component1, final WComponent component2) {
  		for (WComponent parent = component2.getParent(); parent != null; parent = parent.getParent()) {
  			if (parent == component1) {
  				return true;
  			}
  		}
  
  		return false;
  	}
docs: Indicates whether a component is an ancestor of another.
  
  @param component1 a possible ancestor.
  @param component2 the component to check.
  @return true if <code>component1</code> is an ancestor of <code>component2</code>, false otherwise.