}
return true;
}
protected boolean validateName(XMLPanel pnl, XMLElement el) {
XMLComplexElement cel = null;
String newName = null;
XMLPanel namePanel = null;
if (el instanceof XMLAttribute) {
XMLElement parent = el.getParent();
if (parent instanceof XMLCollectionElement) {
cel = (XMLCollectionElement) parent;
newName = cel.get("Name").toValue();
if (pnl.getValue() instanceof String) {
newName = ((String) pnl.getValue()).trim();
namePanel = pnl;
}
} else if (parent instanceof Package) {
cel = (Package) parent;
newName = cel.get("Name").toValue();
if (pnl.getValue() instanceof String) {
newName = ((String) pnl.getValue()).trim();
namePanel = pnl;
}
}
} else if (el instanceof XMLComplexElement) {
cel = (XMLComplexElement) el;
newName = cel.get("Name") != null ? cel.get("Name").toValue() : "";
namePanel = findPanel(pnl, cel.get("Name"));
if (namePanel != null) {
if (namePanel.getValue() instanceof String) {
newName = ((String) namePanel.getValue()).trim();
}
}