/*
 * Copyright (c) 2011, Patrik Dufresne. All rights reserved.
 * Patrik Dufresne PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.planimod.ui;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.util.Policy;

/**
 * The policy class top be used for Planimod application specific.
 */
public class PlanimodPolicy {

	/**
	 * This function should be used when an operation want to display an
	 * unexpected runtime error.
	 * <p>
	 * This implementation use the JFace {@link Policy} class to show the error.
	 * 
	 * @param e
	 *            the exception.
	 */
	public static void showException(Throwable e) {
		String message = e.getLocalizedMessage();
		Policy.getStatusHandler().show(
				new Status(IStatus.ERROR, Policy.JFACE, message, e), null);
	}

}
