dialog.setTitle(NewWizardMessages.getString("LibrariesWorkbookPage.JARArchiveDialog.new.title")); dialog.setMessage(NewWizardMessages.getString("LibrariesWorkbookPage.JARArchiveDialog.new.description"));
dialog.setTitle(NewWizardMessages.getString("BuildPathDialogAccess.JARArchiveDialog.new.title")); dialog.setMessage(NewWizardMessages.getString("BuildPathDialogAccess.JARArchiveDialog.new.description"));
	public static IPath[] chooseJAREntries(Shell shell, IPath initialSelection, IPath[] usedEntries) {		if (usedEntries == null) {			throw new IllegalArgumentException();		}				Class[] acceptedClasses= new Class[] { IFile.class };		TypedElementSelectionValidator validator= new TypedElementSelectionValidator(acceptedClasses, true);		ArrayList usedJars= new ArrayList(usedEntries.length);		IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();		for (int i= 0; i < usedEntries.length; i++) {			IResource resource= root.findMember(usedEntries[i]);			if (resource instanceof IFile) {				usedJars.add(resource);			}		}		IResource focus= initialSelection != null ? root.findMember(initialSelection) : null;				ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(shell, new WorkbenchLabelProvider(), new WorkbenchContentProvider());		dialog.setValidator(validator);		dialog.setTitle(NewWizardMessages.getString("LibrariesWorkbookPage.JARArchiveDialog.new.title")); //$NON-NLS-1$		dialog.setMessage(NewWizardMessages.getString("LibrariesWorkbookPage.JARArchiveDialog.new.description")); //$NON-NLS-1$		dialog.addFilter(new ArchiveFileFilter(usedJars, true));		dialog.setInput(root);		dialog.setSorter(new ResourceSorter(ResourceSorter.NAME));		dialog.setInitialSelection(focus);		if (dialog.open() == Window.OK) {			Object[] elements= dialog.getResult();			IPath[] res= new IPath[elements.length];			for (int i= 0; i < res.length; i++) {				IResource elem= (IResource)elements[i];				res[i]= elem.getFullPath();			}			return res;		}		return null;	}