public void addCharacteristic(AnatomicEntityCharacteristic characteristic) { if (characteristics == null) { characteristics = new ArrayList<AnatomicEntityCharacteristic>(); } characteristics.add(characteristic); characteristic.setItemNumber(characteristics.size()); characteristic.initRemoveCommand(characteristics); characteristic.initContext(characteristics); characteristic.setNumberingCommand( new NumberingCommand() { @Override public void execute() { reNumberCharacteristics(); } }); }
@SuppressWarnings("unused") @Commit private void afterPropertiesSet() { if (characteristics != null) { for (AnatomicEntityCharacteristic characteristic : characteristics) { characteristic.initRemoveCommand(characteristics); characteristic.initContext(characteristics); characteristic.setNumberingCommand( new NumberingCommand() { @Override public void execute() { reNumberCharacteristics(); } }); } } }