public boolean closeCurrentTab()
{
final Component current = getCurrentTab();
if (current != null)
{
final ComplexEditor editor = (ComplexEditor) current;
if (editor.isChanged())
{
final int answer =
JOptionPane.showConfirmDialog(null, I18N
.getString("confirm.saveChanges", editor.getComplex()
.getName()), I18N.getTitle("confirm.saveChanges"),
JOptionPane.YES_NO_CANCEL_OPTION);
if (answer == JOptionPane.CLOSED_OPTION) return false;
if (answer == JOptionPane.CANCEL_OPTION) return false;
if (answer == JOptionPane.YES_OPTION)
{
editor.save();
if (editor.isChanged()) return false;
}
}
this.tabs.remove(current);