try {
IType type = javaProject.findType(controller.getQualifiedName());
IFXCtrlClass fxClazz = FXPlugin.getClassmodel().findCtrlClass(javaProject, type);
if( fxClazz != null ) {
IFXCtrlField f = fxClazz.getAllFields().get(element.getName());
if( f == null ) {
// Defines should not lead to a warning because it is referenced later on
if( !(element.eContainer() instanceof Define) ) {
warning("The controller '"+type.getElementName()+"' has no field '"+element.getName()+"'", FXGraphPackage.Literals.ELEMENT__NAME, UNKNOWN_CONTROLLER_FIELD, element.getName(), controller.getQualifiedName(), element.getType().getQualifiedName());
}
} else {
IType fromType = javaProject.findType(element.getType().getQualifiedName());
IType toType = f.getType();
if( ! Util.assignable(fromType, toType) ) {
error("The type '"+fromType.getElementName()+"' is not assignable to the controller fields type '"+toType.getElementName()+"'", FXGraphPackage.Literals.ELEMENT__NAME, CONTROLLER_FIELD_NOT_ASSIGNABLE, element.getName(), controller.getQualifiedName(), element.getType().getQualifiedName());
}
}
}