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
private ResourceSearcher resourceSearcher;
		public ResourceSearchEngineJob(int ticket, SearcherModel model,
				ResourceHistory history, ResourceSearcher resourceSearcher) {
			super(ticket, model, history);
			this.resourceSearcher = resourceSearcher;
		}
		public void stop() {
			super.stop();
		}
		protected List getFilteredHistory() {
			List elements = new ArrayList();
			IResource[] matchingResources = ((ResourceHistory) history)
					.getMatchedElements(stringMatcher, container);
			if (matchingResources.length > 0) {
				for (int i = 0; i < matchingResources.length; i++) {
					IResource resource = matchingResources[i];
					if ((!getShowDerived() && resource.isDerived())
							|| ((typeMask & resource.getType()) == 0)) {
						continue;
					}
					elements.add(new ResourceSearchItem(resource, true));
				}
			}
			return elements;
		}
		protected void searchResults(Set filteredHistory,