public static IType getEnclosingOrPrimaryType(JavaEditor editor) throws JavaModelException { return convertToEnclosingOrPrimaryType(SelectionConverter.resolveEnclosingElement( editor, (ITextSelection)editor.getSelectionProvider().getSelection()));
public static IType getEnclosingOrPrimaryType(JavaTextSelection selection) throws JavaModelException { final IJavaElement element= selection.resolveEnclosingElement(); if (element != null) return convertToEnclosingOrPrimaryType(element); return null;
	public static IType getEnclosingOrPrimaryType(JavaEditor editor) throws JavaModelException {		return convertToEnclosingOrPrimaryType(SelectionConverter.resolveEnclosingElement(			editor, (ITextSelection)editor.getSelectionProvider().getSelection()));	}