try {
this.parseModel();
}
catch (Throwable e) {
e.printStackTrace();
problems.add(new WodProblem(e.getMessage(), null, 0, true));
return problems;
}
if (_file == null) {
return problems;
}
boolean validateWooEncodings = Activator.getDefault().getPluginPreferences().getBoolean(PreferenceConstants.VALIDATE_WOO_ENCODINGS_KEY);
if (validateWooEncodings) {
try {
String componentCharset = _file.getParent().getDefaultCharset();
String encoding = CharSetUtils.encodingNameFromObjectiveC(this.getEncoding());
if (!(encoding.equals(componentCharset))) {
problems.add(new WodProblem("WOO Encoding type " + encoding + " doesn't match component " + componentCharset, null, 0, true));
}
if (_file.getParent().exists()) {
for (IResource element : _file.getParent().members()) {
if (element.getType() == IResource.FILE) {
IFile file = (IFile) element;
String fileExtension = file.getFileExtension();
if (fileExtension != null && file.getFileExtension().matches("(xml|html|xhtml|wod)") && !file.getCharset().equals(encoding)) {
problems.add(new WodProblem("WOO Encoding type " + encoding + " doesn't match " + file.getName() + " of " + file.getCharset(), null, 0, true));
}
}
}
}
}
catch (CoreException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
if (type == null) {
if (getDisplayGroups().length != 0) {
problems.add(new WodProblem("Display groups are defined for component " + _file.getParent().getName() + " but class was not found", null, 0, false));
}
return problems;
}
for (DisplayGroup displayGroup : getDisplayGroups()) {
try {
if (type != null) {
// Validate WODisplayGroup variable is declared.
BindingValueKeyPath bindingValueKeyPath = new BindingValueKeyPath(displayGroup.getName(), type, type.getJavaProject(), WodParserCache.getTypeCache());
if (!(bindingValueKeyPath.isValid() && !bindingValueKeyPath.isAmbiguous())) {
//XXX Walk type hierarchy and check that is a WODisplayGroup
problems.add(new WodProblem("WODisplayGroup " + displayGroup.getName() + " is configured but not declared in class", null, 0, false));
}
if (!displayGroup.isHasMasterDetail()) {
// Validate editing context
bindingValueKeyPath = new BindingValueKeyPath(displayGroup.getEditingContext(), type, type.getJavaProject(), WodParserCache.getTypeCache());
if (!(bindingValueKeyPath.isValid() && !bindingValueKeyPath.isAmbiguous())) {
problems.add(new WodProblem("Editing context for display group " + displayGroup.getName() + " not found", null, 0, false));
}
}
}
}
catch (JavaModelException e) {