else if (element instanceof IJavaElement) { IJavaProject jp= ((IJavaElement)element).getJavaProject(); if (jp == null) return false; return isSharedProject(jp.getProject()); } else
IJavaProject jp= null; if (element instanceof IJavaElement) { jp= ((IJavaElement)element).getJavaProject();  } else if (element instanceof ClassPathContainer) { ClassPathContainer container= (ClassPathContainer) element; jp= container.getJavaProject(); } if (jp == null)
	public boolean select(Viewer viewer, Object parent, Object element) {		if (element instanceof IResource)			return isSharedProject(((IResource)element).getProject());		else if (element instanceof IJavaElement) {			IJavaProject jp= ((IJavaElement)element).getJavaProject();			if (jp == null)				return false;			return isSharedProject(jp.getProject());		} else			return false;	}