mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Updated javadoc, removed duplicate method
This commit is contained in:
parent
8def1f711a
commit
29b2cdb667
1 changed files with 21 additions and 11 deletions
|
@ -30,15 +30,28 @@ import org.eclipse.core.runtime.Path;
|
|||
* Custom preference for resource scope
|
||||
*
|
||||
* @noextend This class is not intended to be extended by clients.
|
||||
* @since 1.0
|
||||
*/
|
||||
public class FileScopeProblemPreference extends AbstractProblemPreference {
|
||||
/**
|
||||
* Key for the scope preference
|
||||
*/
|
||||
public static final String KEY = "fileScope"; //$NON-NLS-1$
|
||||
/**
|
||||
* Exclusion attribute
|
||||
*/
|
||||
public static final String EXCLUSION = "exclusion"; //$NON-NLS-1$
|
||||
/**
|
||||
* Inclusion attribute
|
||||
*/
|
||||
public static final String INCLUSION = "inclusion"; //$NON-NLS-1$
|
||||
private IResource resource;
|
||||
private IPath[] inclusion = new IPath[0];
|
||||
private IPath[] exclusion = new IPath[0];
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*/
|
||||
public FileScopeProblemPreference() {
|
||||
setKey(KEY);
|
||||
setLabel(Messages.FileScopeProblemPreference_Label);
|
||||
|
@ -233,6 +246,14 @@ public class FileScopeProblemPreference extends AbstractProblemPreference {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that given path matches on the paths provided as second argument
|
||||
*
|
||||
* @param resourcePath - resource path
|
||||
* @param paths - array of path patterns, for pattern see
|
||||
* {@link CharOperation#pathMatch}
|
||||
* @return true if matches with at least one pattern in the array
|
||||
*/
|
||||
public boolean matchesFilter(IPath resourcePath, IPath[] paths) {
|
||||
char[] path = resourcePath.toString().toCharArray();
|
||||
for (int i = 0, length = paths.length; i < length; i++) {
|
||||
|
@ -243,15 +264,4 @@ public class FileScopeProblemPreference extends AbstractProblemPreference {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isExcludedPath(IPath resourcePath, IPath[] paths) {
|
||||
char[] path = resourcePath.toString().toCharArray();
|
||||
for (int i = 0, length = paths.length; i < length; i++) {
|
||||
char[] pattern = paths[i].toString().toCharArray();
|
||||
if (CharOperation.pathMatch(pattern, path, true, '/')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue