Assert.isTrue((style | IJavaElementSearchConstants.CONSIDER_BINARIES) == IJavaElementSearchConstants.CONSIDER_BINARIES); IPackageFragmentRoot[] roots= project.getPackageFragmentRoots();
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(); }
	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();		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()); // XXX inefficient		dialog.setFilter(filter);		return dialog;	}