eventController.fireDataMapEvent(new DataMapEvent(this, dataMap));
}
void setDataMapName(String newName) {
if (newName == null || newName.trim().length() == 0) {
throw new ValidationException("Enter name for DataMap");
}
DataMap map = eventController.getCurrentDataMap();
// search for matching map name across domains, as currently they have to be
// unique globally
Configuration config = ((ApplicationProject) Application.getProject())
.getConfiguration();
DataMap matchingMap = null;
Iterator it = config.getDomains().iterator();
while (it.hasNext()) {
DataDomain domain = (DataDomain) it.next();
DataMap nextMap = domain.getMap(newName);
if (nextMap == map) {
continue;
}
if (nextMap != null) {
matchingMap = nextMap;
break;
}
}
if (matchingMap != null) {
// there is an entity with the same name
throw new ValidationException("There is another DataMap named '"
+ newName
+ "'. Use a different name.");
}
// completely new name, set new name for domain