setButtons(null);
} else if (e.getSource() == m_EditBut) {
// Delete the selected files
int selected = m_List.getSelectedIndex();
if (selected != -1) {
ViewerDialog dialog = new ViewerDialog(null);
String filename = m_List.getSelectedValue().toString();
int result;
try {
DataSource source = new DataSource(filename);
result = dialog.showDialog(source.getDataSet());
// nasty workaround for Windows regarding locked files:
// if file Reader in Loader is not closed explicitly, we cannot
// overwrite the file.
source = null;
System.gc();
// workaround end
if ((result == ViewerDialog.APPROVE_OPTION) && (dialog.isChanged())) {
result = JOptionPane.showConfirmDialog(
this,
Messages.getInstance().getString("DatasetListPanel_ActionPerformed_Result_JOptionPaneShowConfirmDialog_Text"));
if (result == JOptionPane.YES_OPTION) {
Saver saver = ConverterUtils.getSaverForFile(filename);
saver.setFile(new File(filename));
saver.setInstances(dialog.getInstances());
saver.writeBatch();
}
}
}
catch (Exception ex) {