lock.ifNotModifying(new Runnable() {
public void run() {
addDirtyProperty(Constants.BUNDLE_ACTIVATOR);
}
});
IMessageManager msgs = getManagedForm().getMessageManager();
String activatorError = null;
int activatorErrorLevel = IMessageProvider.ERROR;
String activatorClassName = txtActivator.getText();
if (activatorClassName != null && activatorClassName.length() > 0) {
try {
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();
}
});