/** * If this validator recognizes the project nature, whether included or excluded, return the * name filter which describes the nature. Otherwise return null. */ ValidatorNameFilter findProjectNature(String projId) { if (projId == null) { return null; } if (_projectNatureFilters == null) { // If no tag is specified, this validator is configured on all IProjects return null; } for (int i = 0; i < _projectNatureFilters.length; i++) { ValidatorNameFilter filter = _projectNatureFilters[i]; // In this case, we're not checking if the project is an instance of the filter class, // but if it has the Nature specified in the filter class. String projectNatureID = filter.getNameFilter(); if (projId.equals(projectNatureID)) { return filter; } } return null; }
/** * Return true if the given resource is both applicable and include="true". */ boolean isApplicableTo(IResource resource) { return (isApplicableName(resource) && isInclude()); }
/** * Sets the name filter. */ void setNameFilter(String filter, String isCaseSensitiveString) { _nameFilter.setNameFilter(filter); if(filter != null) _nameFilter.setNameFilterExtension(getFilterExt(filter)); _nameFilter.setCaseSensitive(isCaseSensitiveString); }
vf[i] = new ValidatorNameFilter(); nameFilter = nameFilter.intern(); vf[i].setNameFilter(nameFilter); vf[i].setInclude(include);
if (pn.isInclude()) { noneIncluded = false; add(pn.getNameFilter(), vmd);
if (!isCaseSensitive()) { name = name.toLowerCase(); return verifyNameMatch(_nameFilter, name);
ValidatorFilter(String mustImplementClass) { this(); _nameFilter = new ValidatorNameFilter(); _typeFilter.setMustImplementClass(mustImplementClass); _actionFilter = new ValidatorActionFilter(); }
/** * Returns true if the given resource's name matches the name filter. * * e.g. if the name filter is "*.java", and this resource is "readme.txt", this method will * return false. If the resource is named "readme.java", this method will return true. */ boolean isApplicableName(IResource resource) { return _nameFilter.isApplicableName(resource); }
void setInclude(String includeValue) { if (includeValue != null) { setInclude(Boolean.valueOf(includeValue).booleanValue()); } }
if (filter.isInclude()) { noneIncluded = false;
if (nature.equals(pn.getNameFilter()) && !pn.isInclude()) { iterator.remove(); break;
ValidatorFilter() { super(); _nameFilter = new ValidatorNameFilter(); _typeFilter = new ValidatorTypeFilter(); _actionFilter = new ValidatorActionFilter(); }
public List getNameFilters() { List nameFilters = new ArrayList(); if (_filters != null && _filters.length > 0) { for (int i = 0; i < _filters.length; i++) { ValidatorFilter filter = _filters[i]; ValidatorNameFilter nameFilter = filter.get_nameFilter(); if (nameFilter != null) { nameFilters.add(nameFilter.getNameFilter()); } } } return nameFilters; }