public void restoreState(IMemento memento) {
if (memento == null)
return;
IMemento filters = memento.getChild("filters");
if (filters != null)
filterTypes.addAll(filters.getID());
else
filterTypes.addAll(TextRulerToolkit.getStandardFilterSetString());
IMemento slotName = memento.getChild("slotName");
if (slotName != null)
slotTypes.addAll(slotName.getID());
IMemento preName = memento.getChild("preprocessFile");
if (preName != null)
preFileText.setText(preName.getID());
IMemento dir = memento.getChild("inputDirectory");
if (dir != null)
inputDirectoryText.setText(dir.getID());
IMemento additional = memento.getChild("additionalDirectory");
if (additional != null)
additionalDirectoryText.setText(additional.getID());
IMemento test = memento.getChild("testDirectory");
if (test != null)
testDirectoryText.setText(test.getID());
IMemento activeAlgs = memento.getChild("activeAlgorithms");
if (activeAlgs != null) {
ArrayList<TextRulerLearnerController> activeControllers = new ArrayList<TextRulerLearnerController>();
for (IMemento c : activeAlgs.getChildren("algorithm")) {
TextRulerLearnerController ctrl = TextRulerController.getControllerForID(c.getID());
if (ctrl != null)
activeControllers.add(ctrl);
}
algListViewer.setCheckedElements(activeControllers.toArray());
}
IMemento skip = memento.getChild("skipPreprocessing");
if (skip != null) {
boolean skipPreprocessing = skip.getID().equals("yes");
skipPreButton.setSelection(skipPreprocessing);
}
IMemento showTest = memento.getChild("showTest");
if (skip != null) {
boolean showTestValue = showTest.getID().equals("yes");
showTestsButton.setSelection(showTestValue);
}
}