String errorNote = aEntry.getErrorPage()==null?"":"*";
Seller seller = getSeller(aEntry.getSellerId());
switch(columnIndex) {
case TableColumnController.ID: return aEntry.getIdentifier();
case TableColumnController.CUR_BID:
Currency curPrice = aEntry.getCurrentPrice();
if(aEntry.isFixed()) {
return curPrice + " (FP" + ((aEntry.getQuantity() > 1) ? " x " + aEntry.getQuantity() + ")" : ")");
} else {
return curPrice + " (" + Integer.toString(aEntry.getNumBidders()) + ')';
}
case TableColumnController.SNIPE_OR_MAX: return formatSnipeAndBid(aEntry);
case TableColumnController.MAX: return aEntry.isBidOn()?formatBid(aEntry, errorNote):neverBid;
case TableColumnController.SNIPE:
if (aEntry.isSniped()) {
return formatSnipe(aEntry, errorNote);
}
if(aEntry.snipeCancelled() && aEntry.isComplete()) {
return errorNote + '(' + aEntry.getCancelledSnipe() + ')';
}
return neverBid;
case TableColumnController.TIME_LEFT: {
if (aEntry.getEndDate() == null || aEntry.getEndDate().equals(Constants.FAR_FUTURE))
return "N/A";
String endTime = aEntry.getTimeLeft();
if(endTime.equals(AuctionEntry.endedAuction)) {
SimpleDateFormat fmt = new SimpleDateFormat("dd-MMM-yy HH:mm:ss zzz");
endTime = fmt.format(aEntry.getEndDate());
if(!aEntry.isComplete()) {
endTime = "<html><body color=\"red\">" + endTime + "</body></html>";
}
}
return endTime;
}
case TableColumnController.END_DATE: {
if (aEntry.getEndDate() == null || aEntry.getEndDate().equals(Constants.FAR_FUTURE))
return "N/A";
SimpleDateFormat fmt = new SimpleDateFormat("dd-MMM-yy HH:mm:ss zzz");
return fmt.format(aEntry.getEndDate());
}
case TableColumnController.TITLE: return XMLElement.decodeString(aEntry.getTitle());
case TableColumnController.STATUS: return getEntryIcon(aEntry);
case TableColumnController.THUMBNAIL: {
String thumb = aEntry.getThumbnail();
if (thumb != null) {
if(iconCache.containsKey(thumb)) return iconCache.get(thumb);
thumb = thumb.replaceAll("file:", "");
ImageIcon thumbIcon = scaleImage(thumb);
iconCache.put(thumb, thumbIcon);
return thumbIcon;
} else return dummyIcon;
}
case TableColumnController.SELLER: return aEntry.getSellerName();
case TableColumnController.COMMENT:
String comment = aEntry.getComment();
return(comment==null?"":comment);
case TableColumnController.BIDDER:
String bidder = aEntry.getHighBidder();
if(bidder != null && bidder.length() != 0) return bidder;
return "--";
case TableColumnController.FIXED_PRICE:
Currency bin = aEntry.getBuyNow();
if(bin.isNull()) return "--";
return bin;
case TableColumnController.SHIPPING_INSURANCE:
Currency ship = aEntry.getShippingWithInsurance();
if(ship.isNull()) return "--";
return ship;
case TableColumnController.ITEM_LOCATION:
return aEntry.getItemLocation();
case TableColumnController.BIDCOUNT:
if(aEntry.getNumBidders() < 0) return "(FP)";
return Integer.toString(aEntry.getNumBidders());
case TableColumnController.JUSTPRICE:
return aEntry.getCurrentPrice();
case TableColumnController.SELLER_FEEDBACK:
return seller.getFeedback();
case TableColumnController.SELLER_POSITIVE_FEEDBACK:
String fbp = seller.getPositivePercentage();
return (fbp == null || fbp.length() == 0)?"--":fbp;
case TableColumnController.CUR_TOTAL:
Currency shipping = aEntry.getShippingWithInsurance();
if(shipping.getCurrencyType() == Currency.NONE) {
return "--"; // shipping not set so cannot add up values
}
try {
return aEntry.getCurrentPrice().add(shipping);
} catch (Currency.CurrencyTypeException e) {