{
IMetaTag[] skinParts = hostComponentDef.findSkinParts(project, problems);
for (IMetaTag skinPart : skinParts)
{
IVariableDefinition hostSkinPartDef = (IVariableDefinition)skinPart.getDecoratedDefinition();
String hostStringPartName = hostSkinPartDef.getBaseName();
IDefinition skinPartDef = getContainedScope().getPropertyFromDef(project, this, hostStringPartName, false);
if (skinPartDef instanceof ISetterDefinition)
skinPartDef = ((ISetterDefinition)skinPartDef).resolveGetter(project);
// the skinPart definition needs to be either a variable or getter
if (!((skinPartDef instanceof IVariableDefinition) || (skinPartDef instanceof IGetterDefinition)))
skinPartDef = null;
ITypeDefinition skinPartTypeDef = null;
if (skinPartDef != null)
skinPartTypeDef = skinPartDef.resolveType(project);
if (skinPartTypeDef == null && hostSkinPartDef.isRequiredSkinPart())
{
ICompilerProblem problem = new MissingSkinPartProblem(skinPart, hostComponentDef.getBaseName());
problems.add(problem);
}
else if (skinPartTypeDef != null && !skinPartTypeDef.isInstanceOf(hostSkinPartDef.resolveType(project), project))
{
ICompilerProblem problem = new WrongSkinPartProblem(skinPart, skinPartTypeDef, hostSkinPartDef.resolveType(project));
problems.add(problem);
}
}
}