Bug 124338 [Dialogs] ResourceSelectionDialog should allow to implement custom acceptance criteria
I suggest to refactor ResourceSelectionDialog so there will be methods to access checked items and enable OK button respectively. This should allow to implement custom strategy to accept selected elements.
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/ResourceSearcher.java
SearcherProgressMonitor monitor) throws CoreException {
			SearcherProgressMonitor progress = new SearcherProgressMonitor(
					monitor, model);
			if (progress != null)
				progress.beginTask("", container.members().length); 
			container.accept(new ResourceProxyVisitor(model, progress,
					(ResourceHistory) this.history, container), IResource.NONE);
			if (progress != null)
				progress.done();
			ArrayList resources = new ArrayList(Arrays.asList(this.model
					.getElements()));
			resourceSearcher.rememberResult(fTicket, resources);
		}
	}
	/**
	 * ResourceComparator to caompare resources and mark duplicates.
	 * 
	 * @since 3.3
	 * 
	 */
	public static class ResourceComparator implements Comparator {
		/*
		 * (non-Javadoc)
		 * 
		 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
		 */
		public int compare(Object o1, Object o2) {
			final ResourceSearchItem resourceDecorator1 = ((ResourceSearchItem) o1);
			final ResourceSearchItem resourceDecorator2 = ((ResourceSearchItem) o2);
			final IResource resource1 = resourceDecorator1.getResource();