IJavaProject javaProject = getJavaProject();
if (javaProject == null) {
activatorError = "Cannot validate activator class name, the bnd file is not in a Java project.";
activatorErrorLevel = IMessageProvider.WARNING;
} else {
IType activatorType = javaProject.findType(activatorClassName);
if (activatorType == null) {
activatorError = "The activator class name is not known in this project.";
activatorErrorLevel = IMessageProvider.ERROR;
}
}
} catch (JavaModelException e) {
logger.logError("Error looking up activator class name: " + activatorClassName, e);
}
}
if (activatorError != null) {
msgs.addMessage(UNKNOWN_ACTIVATOR_ERROR_KEY, activatorError, null, activatorErrorLevel, txtActivator);
} else {
msgs.removeMessage(UNKNOWN_ACTIVATOR_ERROR_KEY, txtActivator);
}
checkActivatorIncluded();
}
});
linkActivator.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent ev) {
String activatorClassName = txtActivator.getText();
if (activatorClassName != null && activatorClassName.length() > 0) {
try {
IJavaProject javaProject = getJavaProject();
if (javaProject == null)
return;
IType activatorType = javaProject.findType(activatorClassName);
if (activatorType != null) {
JavaUI.openInEditor(activatorType, true, true);
}
} catch (PartInitException e) {
ErrorDialog.openError(getManagedForm().getForm().getShell(), "Error", null,