Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2002-05-30 12:58:41 +0000
committerDani Megert2002-05-30 12:58:41 +0000
commit90f03c5e4032c506520d0195802787f539dee82f (patch)
tree1fe6c42a6255b2acb12d5d83b17098b5f6306660
parent5953ead38a705e0bbae3c3e0892a743ad8cf9f92 (diff)
downloadeclipse.platform.text-90f03c5e4032c506520d0195802787f539dee82f.tar.gz
eclipse.platform.text-90f03c5e4032c506520d0195802787f539dee82f.tar.xz
eclipse.platform.text-90f03c5e4032c506520d0195802787f539dee82f.zip
Added feature: Ignore
- toBeIgnored (and derived) files for file search - binary files for text search
-rw-r--r--org.eclipse.search/.classpath1
-rw-r--r--org.eclipse.search/.project5
-rw-r--r--org.eclipse.search/.vcm_meta5
-rw-r--r--org.eclipse.search/plugin.xml1
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java10
5 files changed, 18 insertions, 4 deletions
diff --git a/org.eclipse.search/.classpath b/org.eclipse.search/.classpath
index 15ba3b97b..0e77a0434 100644
--- a/org.eclipse.search/.classpath
+++ b/org.eclipse.search/.classpath
@@ -7,5 +7,6 @@
<classpathentry kind="src" path="/org.eclipse.core.resources"/>
<classpathentry kind="src" path="/org.eclipse.ui"/>
<classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/>
+ <classpathentry kind="src" path="/org.eclipse.team.core"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/org.eclipse.search/.project b/org.eclipse.search/.project
index 65a07c335..a19890ebb 100644
--- a/org.eclipse.search/.project
+++ b/org.eclipse.search/.project
@@ -4,11 +4,12 @@
<comment></comment>
<projects>
<project>org.apache.xerces</project>
- <project>org.eclipse.core.resources</project>
- <project>org.eclipse.ui</project>
<project>org.eclipse.core.boot</project>
+ <project>org.eclipse.core.resources</project>
<project>org.eclipse.core.runtime</project>
<project>org.eclipse.swt</project>
+ <project>org.eclipse.team.core</project>
+ <project>org.eclipse.ui</project>
</projects>
<buildSpec>
<buildCommand>
diff --git a/org.eclipse.search/.vcm_meta b/org.eclipse.search/.vcm_meta
index 75a32922c..905df3c05 100644
--- a/org.eclipse.search/.vcm_meta
+++ b/org.eclipse.search/.vcm_meta
@@ -2,11 +2,12 @@
<project-description>
<nature id="org.eclipse.jdt.core.javanature"/>
<reference project-name="org.apache.xerces"/>
- <reference project-name="org.eclipse.core.resources"/>
- <reference project-name="org.eclipse.ui"/>
<reference project-name="org.eclipse.core.boot"/>
+ <reference project-name="org.eclipse.core.resources"/>
<reference project-name="org.eclipse.core.runtime"/>
<reference project-name="org.eclipse.swt"/>
+ <reference project-name="org.eclipse.team.core"/>
+ <reference project-name="org.eclipse.ui"/>
<builder name="org.eclipse.jdt.core.javabuilder">
</builder>
</project-description>
diff --git a/org.eclipse.search/plugin.xml b/org.eclipse.search/plugin.xml
index b7d4b5995..176df3b1e 100644
--- a/org.eclipse.search/plugin.xml
+++ b/org.eclipse.search/plugin.xml
@@ -13,6 +13,7 @@
<requires>
<import plugin="org.apache.xerces"/>
<import plugin="org.eclipse.core.resources"/>
+ <import plugin="org.eclipse.team.core"/>
<import plugin="org.eclipse.ui"/>
</requires>
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java b/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java
index fa80f4e8e..d2ead07a0 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java
@@ -28,6 +28,8 @@ import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
+import org.eclipse.team.core.Team;
+
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
@@ -124,10 +126,18 @@ public class TextSearchVisitor extends TypedResourceVisitor {
if (! fScope.encloses(file))
return false;
+ // Exclude to be ignored files
+ if (Team.isIgnoredHint(file))
+ return false;
+
if (fPattern.length() == 0) {
fCollector.accept(file, "", -1, 0, -1); //$NON-NLS-1$
return true;
}
+
+ // Exclude binary files from text search
+ if (Team.getType(file) == Team.BINARY)
+ return false;
try {
BufferedReader reader= null;

Back to the top