public static IEditorInput getEditorInput(Object input) throws JavaModelException { if (input instanceof IJavaElement) return getEditorInput((IJavaElement) input);
private static IEditorInput getEditorInput(IJavaElement element) throws JavaModelException { while (element != null) { if (element instanceof IWorkingCopy && ((IWorkingCopy) element).isWorkingCopy()) element= ((IWorkingCopy) element).getOriginalElement();  if (element instanceof ICompilationUnit) { ICompilationUnit unit= (ICompilationUnit) element; IResource resource= unit.getUnderlyingResource(); if (resource instanceof IFile) return new FileEditorInput((IFile) resource); }
	public static IEditorInput getEditorInput(Object input) throws JavaModelException {		if (input instanceof IJavaElement)			return getEditorInput((IJavaElement) input);					if (input instanceof IFile) 			return new FileEditorInput((IFile) input);				if (input instanceof IStorage) 			return new JarEntryEditorInput((IStorage)input);			return null;	}