Bug 9112 goto type presents items not visible
stable 20020125 In the packages view Choose Go To > Type from the popup The resulting dialog displays things you cannot go to - it shows classes in referenced libraries even if you are not currenrtly showing referenced libraries - it shows classes not in your working set As a result if you pick that class nothing actually happens and you don't know why. Some options (food for thought): - filter the dialog (classes in current view vs. all classes) - let the user pick it then warn him its not in his current view and offer to change the view
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/GotoPackageAction.java
Shell shell= JavaPlugin.getActiveWorkbenchShell();
			SelectionDialog dialog= createAllPackagesDialog(shell);
			dialog.setTitle(PackagesMessages.getString("GotoPackage.dialog.title")); 
			dialog.setMessage(PackagesMessages.getString("GotoPackage.dialog.message")); 
			dialog.open();		
			Object[] res= dialog.getResult();
			if (res != null && res.length == 1) 
				gotoPackage((IPackageFragment)res[0]); 
		} catch (JavaModelException e) {
		}
	}
	
	SelectionDialog createAllPackagesDialog(Shell shell) throws JavaModelException{
		ElementListSelectionDialog dialog= new ElementListSelectionDialog(
			shell, 
			new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_ROOT|JavaElementLabelProvider.SHOW_POST_QUALIFIED)
		);
		dialog.setIgnoreCase(false);
		dialog.setElements(collectPackages()); 
		return dialog;
	}
	
	Object[] collectPackages() throws JavaModelException {
		IWorkspaceRoot wsroot= JavaPlugin.getWorkspace().getRoot();
		IJavaModel model= JavaCore.create(wsroot);
		IJavaProject[] projects= model.getJavaProjects();
		Set set= new HashSet(); 
		List allPackages= new ArrayList();
		for (int i= 0; i < projects.length; i++) {
			IPackageFragmentRoot[] roots= projects[i].getPackageFragmentRoots();