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
if (!getShowDerived() && proxy.isDerived()) {
				return false;
			}
			IResource res = proxy.requestResource();
			if (this.projects.remove((res.getProject()))) {
				progressMonitor.worked(1);
			}
			int type = proxy.getType();
			if ((typeMask & type) != 0) {
				if (match(proxy.getName())) {
					if (validateSearchedResource(res)) {
						if (!resourceHistory.contains(res))
							model.addElement(new ResourceSearchItem(res));
						return true;
					}
					return false;
				}
			}
			if (type == IResource.FILE) {
				return false;
			}
			return true;
		}
	}
	/**
	 * ResourceHistory store a history of selected resources.
	 * 
	 * @since 3.3
	 */
	private static class ResourceHistory extends SearcherHistory {