/*******************************************************************************
 * This file is part of GECAMed.
 * 
 * GECAMed is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License (L-GPL) as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * GECAMed is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License (L-GPL)
 * along with GECAMed.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * GECAMed is Copyrighted by the Centre de Recherche Public Henri Tudor (http://www.tudor.lu)
 * (c) CRP Henri Tudor, Luxembourg, 2008
 *******************************************************************************/
//package lu.tudor.santec.gecamed.letter.gui.listeners;
//
//import java.awt.event.ActionEvent;
//import java.awt.event.ActionListener;
//
//import javax.swing.JOptionPane;
//
//import lu.tudor.santec.gecamed.core.gui.MainFrame;
//import lu.tudor.santec.gecamed.core.utils.ManagerFactory;
//import lu.tudor.santec.gecamed.letter.ejb.session.beans.LetterBean;
//import lu.tudor.santec.gecamed.letter.ejb.session.interfaces.LetterInterface;
//import lu.tudor.santec.gecamed.letter.gui.LetterPanel;
//import lu.tudor.santec.gecamed.patient.ejb.entity.beans.IncidentEntry;
//import lu.tudor.santec.gecamed.patient.ejb.session.beans.IncidentManagerBean;
//import lu.tudor.santec.gecamed.patient.ejb.session.interfaces.IncidentManager;
//import lu.tudor.santec.gecamed.patient.gui.PatientManagerModule;
//import lu.tudor.santec.gecamed.patient.gui.history.table.HistoryTableModel.HistRow;
//import lu.tudor.santec.i18n.Translatrix;
//
///*
// * Class that deletes an incident enty and it's letter
// */
//
//public class DeleteLetterListener implements ActionListener {
//
//	private HistRow row;
//
//	public void actionPerformed(ActionEvent e) {
//		int row_number = LetterPanel.getInstance().getTable().getSelectedRow();
//		if (row_number > -1) {
//			row = LetterPanel.getInstance().getTableData().get(row_number);
//			IncidentEntry entry = row.getEntry();
//			if (JOptionPane.showConfirmDialog(MainFrame.getInstance(),
//					Translatrix.getTranslationString("LetterTemplateModule.dialog.confirm.deleteletter")) == JOptionPane.YES_OPTION) {
//				
//				LetterInterface lManager = (LetterInterface) ManagerFactory.getRemote(LetterBean.class);
//				lManager.removeLetterbyIncidentId(entry.getId());
//				
//				IncidentManager iManager = (IncidentManager) ManagerFactory
//						.getRemote(IncidentManagerBean.class);
//				iManager.removeIncidentEntry(entry);
//				
//								
//				PatientManagerModule.getInstance().getPatientPanel()
//						.reloadHistory();
//				LetterPanel.getInstance().getCbModel().queryLetterTypes();
//			}
//		}
//	}
//
//}
