public Object execute(ExecutionEvent event) throws ExecutionException {
PreferenceManager pm = new PreferenceManager();
PreferencePage page = new ConfigPreferencePage();
page.setTitle("TextRuler");
PreferenceNode node = new PreferenceNode("org.apache.uima.ruta.textruler.config", page);
pm.addToRoot(node);
List<PreferenceNode> nodes = pm.getElements(0);
PreferenceNode top = null;
for (PreferenceNode n : nodes)
if (n.getId().equals("org.apache.uima.ruta.textruler.config"))
top = n;
if (top != null) {
for (TextRulerLearnerController ctrl : TextRulerController.getAvailableControllers()) {
TextRulerLearnerParameter[] params = ctrl.getFactory().getAlgorithmParameters();
if (params == null || params.length == 0)
continue;
page = new AlgorithmPreferencePage(ctrl);
page.setTitle(ctrl.getName());
node = new PreferenceNode(ctrl.getID(), page);
top.add(node);
}
}
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
PreferenceDialog pd = new PreferenceDialog(shell, pm);