public static SelectionDialog createPackageDialog(Shell parent, IJavaProject project, int style) throws JavaModelException { return createPackageDialog(parent, project, style, "A");
public static SelectionDialog createPackageDialog(Shell parent, IJavaProject project, int style, String filter) throws JavaModelException { Assert.isTrue((style | IJavaElementSearchConstants.CONSIDER_BINARIES | IJavaElementSearchConstants.CONSIDER_REQUIRED_PROJECTS) == (IJavaElementSearchConstants.CONSIDER_BINARIES | IJavaElementSearchConstants.CONSIDER_REQUIRED_PROJECTS));  IPackageFragmentRoot[] roots= null; if ((style & IJavaElementSearchConstants.CONSIDER_REQUIRED_PROJECTS) != 0) { roots= project.getAllPackageFragmentRoots(); } else { 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(); while(iter.hasNext()) { IPackageFragmentRoot root= (IPackageFragmentRoot)iter.next(); packages.addAll(Arrays.asList(root.getChildren())); } ElementListSelectionDialog dialog= new ElementListSelectionDialog(parent, new JavaElementLabelProvider(flags)); dialog.setIgnoreCase(false); dialog.setElements(packages.toArray()); dialog.setFilter(filter); return dialog;
	public static SelectionDialog createPackageDialog(Shell parent, IJavaProject project, int style) throws JavaModelException {		return createPackageDialog(parent, project, style, "A"); //$NON-NLS-1$	}