}
}
private void savePreferenceCache() {
String mementoString = null;
XMLMemento rootMemento = XMLMemento.createWriteRoot(KEY_ROOT);
for (Combo combo : comboList) {
String textLabel = (String) combo.getData(KEY_URL_DATA);
String value = combo.getText();
List<String> subList = cacheMap.get(textLabel);
if (subList == null) {
subList = new LinkedList<String>();
}
subList.remove(value);
subList.add(0, value);
cacheMap.put(textLabel, subList);
for (int i = 0; i < subList.size(); i++) {
if (i >= 10) {
break;
}
IMemento child = rootMemento.createChild(KEY_URL_DATA);
child.putString(KEY_NAME, textLabel);
child.putString(KEY_VALUE, subList.get(i));
}
}
try {
StringWriter writer = new StringWriter();
rootMemento.save(writer);
mementoString = writer.getBuffer().toString();
prefStore.setValue(prefStoreKey, mementoString);
}
catch (IOException e) {
StatusHandler.log(new Status(IStatus.ERROR, MetadataPlugin.PLUGIN_ID,