/*******************************************************************************
 * Copyright (c) 2008 Dennis Schenk, Peter Siska.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Dennis Schenk - initial implementation
 *     Peter Siska	 - initial implementation
 *******************************************************************************/
package ch.unibe.iam.scg.archie.model;

import java.util.Currency;
import java.util.Locale;

import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;

import ch.rgw.tools.Money;

/**
 * <p>
 * Standard label provider for the queries. If no special labels or model is
 * required, this label provider will do nicely. It provides just the labels
 * given at the specific row/columns.
 * </p>
 * 
 * $Id: QueryLabelProvider.java 747 2009-07-23 09:14:53Z peschehimself $
 * 
 * @author Peter Siska
 * @author Dennis Schenk
 * @version $Rev: 747 $
 */
public class QueryLabelProvider extends LabelProvider implements ITableLabelProvider {

	/**
	 * Does nothing, returns null.
	 * 
	 * @return Returns null.
	 */
	public Image getColumnImage(final Object element, final int columnIndex) {
		return null;
	}

	/**
	 * Returns the textual representation of each row at a given column index.
	 * This method merely calls the <code>toString()</code> method on those
	 * objects. No special labels are being returned, except for
	 * <code>Money</code> classes where we use the currency based on the locale
	 * (<code>Locale.getDefault()</code>) as a prefix.
	 * 
	 * @return Returns the <code>toString()</code> representation of the object
	 *         in the given row at the given column index.
	 */
	public String getColumnText(final Object element, final int columnIndex) {
		Comparable<?>[] row = (Comparable[]) element;
		if (row[columnIndex].getClass() == Money.class) {
			Currency cur = Currency.getInstance(Locale.getDefault());
			return cur + " " + row[columnIndex].toString();
		}
		return row[columnIndex].toString();
	}
}
@@ -796,16 +796,73 @@
 s.Image;
+%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;
 %0A%0Aimport
@@ -1339,16 +1339,100 @@
 ider %7B%0A%0A
+%09private static Logger logger = LoggerFactory.getLogger(QueryLabelProvider.class);%0A%0A
 %09/**%0A%09 *
@@ -2203,16 +2203,137 @@
 lement;%0A
+%09%09if(row%5BcolumnIndex%5D == null) %7B%0A%09%09%09logger.warn(%22Row result in column %5B%22 + columnIndex + %22%5D is null%22);%0A%09%09%09return %22%22;%0A%09%09%7D%0A
 %09%09if (ro

handle null row results in QueryLabelProvider