* @param rowIndex
* @param columnIndex
* @return verdi
*/
public Object getValueAt(final int rowIndex, final int columnIndex) {
Produceable produceable = (Produceable) getRow(rowIndex);
DecimalFormat decimalFormat = new DecimalFormat();
decimalFormat.setDecimalSeparatorAlwaysShown(false);
decimalFormat.setParseIntegerOnly(true);
switch (columnIndex) {
case 0:
return produceable.getTransportDetails();
case 1:
return produceable;
case 2:
return Util.formatDate(produceable.getProductionDate(),
Util.SHORT_DATE_FORMAT);
case 3:
if (produceable.getNumberOfItems() != null) {
return decimalFormat.format(produceable.getNumberOfItems());
}
return "";
case 4:
return Util.removeNoAttributes(produceable.getAttributeInfo());
case 5:
Date loadingDate = produceable.getLoadingDate();
if (loadingDate != null) {
return Util.SHORT_DATE_FORMAT.format(loadingDate);
}
return null;
case 6:
if (produceable.getProduced() != null) {
return Util.SHORT_DATE_FORMAT.format(produceable
.getProduced());
}
return "---";
case 7:
if (produceable.getProductAreaGroupName() != null) {
return produceable.getProductAreaGroupName();
}
return "";
case 8:
return produceable.getProductionUnitName();
case 9:
if (produceable.getActionStarted() != null) {
return Util.SHORT_DATE_FORMAT.format(produceable
.getActionStarted());
}
return "---";
default:
throw new IllegalStateException("Unknown column");