/* (non-Javadoc)
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) {
Configuration config = Configuration.getConfiguration();
List<String> preferredDabs = config.getStringSubList(
wikipedia, Configuration.SUB_ARRAY_PREFERRED_DAB, page);
if (add) {
String value = preferred;
if (value == null) {
value = Utilities.askForValue(parent, message, defaultValue, checker);
}
if ((value != null) && !preferredDabs.contains(value)) {
preferredDabs.add(value);
Collections.sort(preferredDabs);
config.setStringSubList(
wikipedia, Configuration.SUB_ARRAY_PREFERRED_DAB, page, preferredDabs);
}
} else {
if ((preferred != null) && preferredDabs.contains(preferred)) {
preferredDabs.remove(preferred);
Collections.sort(preferredDabs);
config.setStringSubList(
wikipedia, Configuration.SUB_ARRAY_PREFERRED_DAB, page, preferredDabs);
}
}
}