private static IJavaSearchScope createWorkspaceSourceScope(){ JavaCore javaCore = JavaCore.getJavaCore(); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); List elems= new ArrayList(); for (int i = 0; i < projects.length; i++) { IProject project = projects[i]; if (project.isAccessible()) { IJavaProject jp= javaCore.create(project); try { IPackageFragmentRoot[] roots= jp.getPackageFragmentRoots(); for (int j= 0; j < roots.length; j++) { if (canMoveToTypesDeclaredIn(roots[j])) elems.add(roots[j]); } } catch(JavaModelException e) {  } } } IPackageFragmentRoot[] roots= (IPackageFragmentRoot[]) elems.toArray(new IPackageFragmentRoot[elems.size()]); return SearchEngine.createJavaSearchScope(roots);
private IJavaSearchScope createWorkspaceSourceScope(){ return SearchEngine.createJavaSearchScope(new IJavaElement[]{getMoveRefactoring().getDeclaringType().getJavaProject()}, true);
	private static IJavaSearchScope createWorkspaceSourceScope(){		JavaCore javaCore = JavaCore.getJavaCore();		IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();		List elems= new ArrayList();		for (int i = 0; i < projects.length; i++) {			IProject project = projects[i];			if (project.isAccessible()) {				IJavaProject jp= javaCore.create(project);				try {					IPackageFragmentRoot[] roots= jp.getPackageFragmentRoots();					for (int j= 0; j < roots.length; j++) {						if (canMoveToTypesDeclaredIn(roots[j]))							elems.add(roots[j]);						}				} catch(JavaModelException e) {					//ignore				}			}		}		IPackageFragmentRoot[] roots= (IPackageFragmentRoot[]) elems.toArray(new IPackageFragmentRoot[elems.size()]);		return SearchEngine.createJavaSearchScope(roots);	}