source.append(" target");
}
protected IStatus updateTargetException() {
StatusInfo status = new StatusInfo();
IPackageFragmentRoot root = getMainPage().getPackageFragmentRoot();
fTargetExceptionDialogField.enableButton(root != null);
fTargetException = null;
String targetClassName = getTargetExceptionName();
if (targetClassName.length() == 0) {
// accept the empty field (stands for java.lang.Object)
return status;
}
IStatus val = JavaConventions.validateJavaTypeName(targetClassName);
if (val.getSeverity() == IStatus.ERROR) {
status.setError("Target exception name is not valid.");
return status;
}
if (root != null) {
try {
IType type = resolveClassName(root.getJavaProject(), targetClassName);
if (type == null) {
status.setWarning("Target exception does not exist in current project.");
return status;
}
// TODO Check if exception is subclass of Throwable