* @param rowIndex
* @param columnIndex
* @return verdi
*/
public Object getValueAt(int rowIndex, int columnIndex) {
FrontProductionV frontProductionV = (FrontProductionV) getRow(rowIndex);
DecimalFormat decimalFormat = new DecimalFormat();
decimalFormat.setDecimalSeparatorAlwaysShown(false);
decimalFormat.setParseIntegerOnly(true);
Map<String, String> statusMap = Util
.createStatusMap(frontProductionV.getOrderStatus());
switch (columnIndex) {
case 0:
return frontProductionV.getTransportDetails();
case 1:
return frontProductionV;
case 2:
return Util.formatDate(frontProductionV.getProductionDate(),
Util.SHORT_DATE_FORMAT);
case 3:
if (frontProductionV.getNumberOfItems() != null) {
return decimalFormat.format(frontProductionV
.getNumberOfItems());
}
return "";
case 4:
return statusMap.get(veggChecker.getArticleName());
case 5:
Date loadingDate = frontProductionV.getLoadingDate();
if (loadingDate != null) {
return Util.SHORT_DATE_FORMAT.format(loadingDate);
}
return null;
case 6:
if (frontProductionV.getProduced() != null) {
return Util.SHORT_DATE_FORMAT.format(frontProductionV
.getProduced());
}
return "---";
case 7:
if (frontProductionV.getProductAreaGroupName() != null) {
return frontProductionV.getProductAreaGroupName();
}
return "";
case 8:
return frontProductionV.getProductionUnitName();
case 9:
if (frontProductionV.getActionStarted() != null) {
return Util.SHORT_DATE_FORMAT.format(frontProductionV
.getActionStarted());
}
return "---";
default:
throw new IllegalStateException("Unknown column");