RefClass (RefEntity element) { while (!(element instanceof RefClass) && element instanceof RefJavaElement) { element = element.getOwner(); } return (element instanceof RefClass) ? (RefClass)element : null; }