Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2007-06-28 18:11:41 +0000
committerMichael Valenta2007-06-28 18:11:41 +0000
commit5b000a67a6e84cc07c2470f91e9fd1a452e8508f (patch)
treefd021b0c3f63de40c23b818084d14cd8f55d07ba
parentc46f7e131ac185f245660ad32c58394329ba379d (diff)
downloadeclipse.platform.team-5b000a67a6e84cc07c2470f91e9fd1a452e8508f.tar.gz
eclipse.platform.team-5b000a67a6e84cc07c2470f91e9fd1a452e8508f.tar.xz
eclipse.platform.team-5b000a67a6e84cc07c2470f91e9fd1a452e8508f.zip
[Bug 39239] [Preferences] Ignored Resources should accept multi directory pattern
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java10
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/StringMatcher.java12
2 files changed, 19 insertions, 3 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java
index 7c54cd22f..550819758 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java
@@ -88,12 +88,12 @@ public final class Team {
}
/**
- * Returns whether the given file should be ignored.
+ * Returns whether the given file or folder with its content should be ignored.
*
* This method answers true if the file matches one of the global ignore
* patterns, or if the file is marked as derived.
*
- * @param resource the file
+ * @param resource the file or folder
* @return whether the file should be ignored
*/
public static boolean isIgnoredHint(IResource resource) {
@@ -113,7 +113,11 @@ public final class Team {
private static boolean matchesEnabledIgnore(IResource resource) {
StringMatcher[] matchers = getStringMatchers();
for (int i = 0; i < matchers.length; i++) {
- if (matchers[i].match(resource.getName())) return true;
+ String resourceName = resource.getName();
+ if(matchers[i].isPathPattern()) {
+ resourceName = resource.getFullPath().toString();
+ }
+ if (matchers[i].match(resourceName)) return true;
}
return false;
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/StringMatcher.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/StringMatcher.java
index 8597e5d97..412e56928 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/StringMatcher.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/StringMatcher.java
@@ -29,6 +29,7 @@ public class StringMatcher {
/* boundary value beyond which we don't need to search in the text */
protected int fBound = 0;
+ private boolean pathPattern;
protected static final char fSingleWildCard = '\u0000';
@@ -126,6 +127,8 @@ public class StringMatcher {
fIgnoreWildCards = ignoreWildCards;
fLength = aPattern.length();
+ pathPattern = aPattern.indexOf('/') != -1;
+
/* convert case */
if (fIgnoreCase) {
fPattern = aPattern.toUpperCase();
@@ -224,6 +227,15 @@ public class StringMatcher {
public boolean match(String text) {
return match(text, 0, text.length());
}
+
+ /**
+ * check existence of '/' in the pattern.
+ * @return <b>true</b> if pattern contains '/'
+ */
+ public boolean isPathPattern() {
+ return pathPattern;
+ }
+
/**
* This method parses the given pattern into segments seperated by wildcard '*' characters.
* Since wildcards are not being used in this case, the pattern consists of a single segment.

Back to the top