if (newSelection)
this.clearSelection();
String name;
Integer firstSelectedPreset = null;
for (int i = 0,j = pctm.getRowCount(); i < j; i++) {
ReadablePreset preset = (ReadablePreset) pctm.getValueAt(i, 1);
try {
if (useDisplayName)
name = preset.getPresetDisplayName();
else
name = preset.getPresetName();
} catch (NoSuchPresetException e) {
continue;
} catch (PresetEmptyException e) {
name = DeviceContext.EMPTY_PRESET;
}
m = p.matcher(name);
boolean res = false;
if (fullMatch)
res = m.matches();
else
res = m.find();
if (res) {
if (firstSelectedPreset == null)
firstSelectedPreset = preset.getPresetNumber();
this.addRowSelectionInterval(i, i);
this.addColumnSelectionInterval(0, 0);
}
}
return firstSelectedPreset;