@SuppressWarnings("unchecked")
@Override
public void setValueAt(Object object, int rowIndex, int columnIndex) {
Boolean access = (Boolean) object;
WindowAccess windowAccess = (WindowAccess) getRow(rowIndex);
UserTypeAccess userTypeAccess = userTypeAccessMap.get(windowAccess);
UserType userType = ((UserTypeModel) presentationModel.getBean())
.getObject();
List<UserTypeAccess> userTypeAccessList = (List<UserTypeAccess>) presentationModel
.getBufferedValue(UserTypeModel.PROPERTY_USER_TYPE_ACCESS_LIST);
if (access) {
if (userTypeAccess == null) {
userTypeAccess = new UserTypeAccess(null, 0, userType,
windowAccess);
userTypeAccessList.add(userTypeAccess);
userTypeAccessMap.put(windowAccess, userTypeAccess);
}
}
switch (columnIndex) {
case 1:
if (!access) {
userTypeAccessList.remove(userTypeAccess);
userTypeAccessMap.put(windowAccess, null);
}
break;
case 2:
if (access) {
userTypeAccess.setWriteAccess(1);
} else {
userTypeAccess.setWriteAccess(0);
}
break;
}
presentationModel.setBufferedValue(
UserTypeModel.PROPERTY_USER_TYPE_ACCESS_LIST,