}
// returns null if no matching editor found
// otherwise instantiates a new editor
private IUimaEditorExtension getRequiredEditor(String topElementName, String parsedResultClassName) {
IUimaEditorExtension editor;
// load external editor configurations if not already loaded
if (null == externalEditorConfigurations) {
getExternalEditorConfigurations();
}
for (IConfigurationElement xeditor : externalEditorConfigurations) {
for (IConfigurationElement canEdit : xeditor.getChildren()) {
String elementName = canEdit.getAttribute("elementName");
String parseResultName = canEdit.getAttribute("internalParseClass");
if ( ( (null != topElementName) && topElementName.equals(elementName)) ||
( (null != parsedResultClassName) && parsedResultClassName.equals(parseResultName)) ) {
try {
editor = (IUimaEditorExtension) xeditor.createExecutableExtension(EXTENSION_TAG_CLASS_ATTRIB);
} catch (CoreException e) {
Utility.popMessage("Unexpected Exception", "While trying to load an editor extension"
+ getMessagesToRootCause(e), Utility.ERROR);
return null;
}
editor.init();
return editor;
}
}
}
return null;