* @throws StructuralException if the new name is invalid
*/
public static void nameChanged(final VisiblyMutable vm, final String oldName, final String newName,
List<VisiblyMutable.Listener> listeners) throws StructuralException {
if (!isValidName(newName)) throw new StructuralException("Name '"+newName+"' must not contain '.' or ':'");
VisiblyMutable.NameChangeEvent event = new VisiblyMutable.NameChangeEvent() {
public String getNewName() {
return newName;
}
public String getOldName() {
return oldName;
}
public VisiblyMutable getObject() {
return vm;
}
};
try {
fire(event, listeners);
} catch (RuntimeException e) {
throw new StructuralException(e.getMessage(), e);
}
}