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
model.addElement(resource);
			}
			model.refresh();
		}
		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;
		}
	}
	/**
	 * ResourceSearchEngineJob to search matched resources in indicated reources
	 * container and in resource history. It decorate results and mark
	 * duplicates. During searching this refresh progres Monitor
	 * 
	 * @since 3.2
	 * 
	 */
	private class ResourceSearchEngineJob extends AbstractSearchJob {