use of net.sourceforge.processdash.util.PatternList in project processdash by dtuma.
the class WBSModelMergeConflictNotificationFactory method findColumnForAttribute.
public static ConflictCapableDataColumn findColumnForAttribute(DataTableModel model, String attrName) {
if (model == null)
return null;
for (int i = model.getColumnCount(); i-- > 0; ) {
DataColumn column = model.getColumn(i);
if (column instanceof ConflictCapableDataColumn) {
ConflictCapableDataColumn ccdc = (ConflictCapableDataColumn) column;
PatternList pattern = ccdc.getConflictAttributeNamePattern();
if (pattern != null && pattern.matches(attrName))
return ccdc;
}
}
return null;
}
use of net.sourceforge.processdash.util.PatternList in project processdash by dtuma.
the class RedactFilterData method getEntries.
public List<ZipEntry> getEntries(String... patterns) {
PatternList p = new PatternList(patterns);
List<ZipEntry> result = new ArrayList<ZipEntry>();
Enumeration<? extends ZipEntry> entries = srcZip.entries();
while (entries.hasMoreElements()) {
ZipEntry e = entries.nextElement();
if (p.matches(e.getName()))
result.add(e);
}
return result;
}
use of net.sourceforge.processdash.util.PatternList in project processdash by dtuma.
the class FilterCensoredData method afterPropertiesSet.
public void afterPropertiesSet() {
censoredDataElements = new PatternList();
List<Element> cfgXml = ExtensionManager.getXmlConfigurationElements("redact-filter-censored-data");
for (Element xml : cfgXml) if (isEnabled(xml))
parseConfig(xml);
}
use of net.sourceforge.processdash.util.PatternList in project processdash by dtuma.
the class DefaultDataExportFilter method setupPatterns.
private PatternList setupPatterns(List regexps) {
if (regexps == null || regexps.isEmpty())
return null;
else {
PatternList result = new PatternList();
for (Iterator iter = regexps.iterator(); iter.hasNext(); ) {
String re = (String) iter.next();
int bracePos = re.indexOf('}');
if (bracePos != -1 && re.startsWith("{"))
re = re.substring(bracePos + 1);
try {
result.addRegexp(re);
} catch (Exception e) {
logger.log(Level.WARNING, "Bad regular expression ''{0}''", re);
}
}
return result;
}
}
use of net.sourceforge.processdash.util.PatternList in project processdash by dtuma.
the class AbstractLibraryEditor method openLibrary.
private void openLibrary(Component parent, boolean export) throws UserCancelledException {
WBSLibrary result = null;
while (true) {
File file = selectFile(parent, export);
if (file == null)
throw new UserCancelledException();
result = openLibrary(parent, export, file);
if (result != null)
break;
}
libraryFile = result;
library = result.getWbs();
library.getRoot().setName(resources.getString("Library_Root_Name"));
if (export == false)
library.removeAttributes(new PatternList("^exportSourceID$", "^relaunchSourceID$"));
}
Aggregations