setEnabled(!(fElements.length == 0));
}
private IFile[] collectFiles(Iterator resources) {
final Set files = new HashSet();
final AbstractTextSearchResult result = fPage.getInput();
if (result == null)
return new IFile[0];
while (resources.hasNext()) {
IResource resource = (IResource) resources.next();
try {
resource.accept(new IResourceProxyVisitor() {
public boolean visit(IResourceProxy proxy) throws CoreException {
if (proxy.getType() == IResource.FILE) {
IResource file = proxy.requestResource();
if (result.getMatchCount(file) > 0) {
files.add(file);
}
return false;
}
return true;