Bug 6412 API Request - Package selection dialog including pre-reqs
The Java debugger requires the ability to specify a "pacakge to run in" in the snippet editor. To do this, we use the API on JavaUI to create a package selection dialog for a project. However, we need to be able to choose from packages in pre-req projects/jars as well. Currently the API only specifies packages in a single project.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaUI.java
* @param project the Java project
	 * @param style flags defining the style of the dialog; the only valid flag is
	 *   <code>IJavaElementSearchConstants.CONSIDER_BINARIES</code>, indicating that 
	 *   packages from binary package fragment roots should be included in addition
	 *   to those from source package fragment roots
	 * @param filter the filter
	 * @return a new selection dialog
	 * @exception JavaModelException if the selection dialog could not be opened
	 */
	public static SelectionDialog createPackageDialog(Shell parent, IJavaProject project, int style, String filter) throws JavaModelException {
		Assert.isTrue((style | IJavaElementSearchConstants.CONSIDER_BINARIES) == IJavaElementSearchConstants.CONSIDER_BINARIES);
		IPackageFragmentRoot[] roots= project.getPackageFragmentRoots();	
		List consideredRoots= null;
		if ((style & IJavaElementSearchConstants.CONSIDER_BINARIES) != 0) {
			consideredRoots= Arrays.asList(roots);
		} else {
			consideredRoots= new ArrayList(roots.length);
			for (int i= 0; i < roots.length; i++) {
				IPackageFragmentRoot root= roots[i];
				if (root.getKind() != IPackageFragmentRoot.K_BINARY)
					consideredRoots.add(root);
					
			}
		}
		
		int flags= JavaElementLabelProvider.SHOW_DEFAULT;
		if (consideredRoots.size() > 1)
			flags= flags | JavaElementLabelProvider.SHOW_ROOT;
		List packages= new ArrayList();
		Iterator iter= consideredRoots.iterator();