*/
public boolean validateObject(Object editedObject, PropertyBrowser pb)
{
boolean ret = true;
ModelImpl model = (ModelImpl) editedObject;
List importList = null;
List containers = model.getImportPBContainerList();
if (containers != null)
{
int n = containers.size();
if (n > 0)
{
importList = new ArrayList();
for (int i = 0; i < n; ++i)
{
ModelImportPBContainer container = (ModelImportPBContainer) containers.get(i);
String name = container.getName();
if (name == null)
{
// We ignore empty containers
continue;
}
name = ModelQualifier.normalizeModelName(name);
// First, check if the model can be resolved
if (model.getModelMgr().getOptionalModelByQualifier(ModelQualifier.constructModelQualifier(name)) == null)
{
displayErrorMsg("Cannot resolve model '" + name + "'.");
ret = false;
}
importList.add(name);
}
}
}
if (! ret)
return false;
model.setImportList(importList);
model.setImportPBContainerList(null);
model.setImportContainerListCreated(false);
return super.validateObject(editedObject, pb);
}