[Schmitzm-commits] r2361 - trunk/schmitzm-hibernate/src/main/java/de/schmitzm/db/hibernate/gui

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Thu Jul 18 13:02:28 CEST 2013


Author: mojays
Date: 2013-07-18 13:02:28 +0200 (Thu, 18 Jul 2013)
New Revision: 2361

Modified:
   trunk/schmitzm-hibernate/src/main/java/de/schmitzm/db/hibernate/gui/DatabaseEntityEditorFrame.java
Log:


Modified: trunk/schmitzm-hibernate/src/main/java/de/schmitzm/db/hibernate/gui/DatabaseEntityEditorFrame.java
===================================================================
--- trunk/schmitzm-hibernate/src/main/java/de/schmitzm/db/hibernate/gui/DatabaseEntityEditorFrame.java	2013-07-18 10:47:49 UTC (rev 2360)
+++ trunk/schmitzm-hibernate/src/main/java/de/schmitzm/db/hibernate/gui/DatabaseEntityEditorFrame.java	2013-07-18 11:02:28 UTC (rev 2361)
@@ -47,6 +47,7 @@
 import de.schmitzm.db.hibernate.HibernateSessionFactory;
 import de.schmitzm.db.hibernate.gui.event.DatabaseUpdateEmitter;
 import de.schmitzm.db.hibernate.types.UniqueIDType;
+import de.schmitzm.swing.DialogManager;
 import de.schmitzm.swing.Disposable;
 import de.schmitzm.swing.ExceptionDialog;
 import de.schmitzm.swing.OkCancelApplyDialog;
@@ -277,7 +278,7 @@
         if (success) {
           if ( getDatabaseUpdateEmitter() != null )
             getDatabaseUpdateEmitter().fireDatabaseRecordDeleted(this, getEntity());
-          dispose();
+          performDispose();
         }
       }
     } catch (Exception err) {
@@ -295,10 +296,18 @@
     // Dispose dialog on OK/CANCEL
     if ( "OK".equalsIgnoreCase(e.getActionCommand()) ||
         "CANCEL".equalsIgnoreCase(e.getActionCommand()) )
-      dispose();
+      performDispose();
   }
   
   /**
+   * Simply calls {@link #dispose()}. Sub-classes can override this method to
+   * e.g. perform the dispose via an {@link DialogManager}. 
+   */
+  protected void performDispose() {
+    dispose();
+  }
+  
+  /**
    * Reverts record fields after error during update. Only called
    * for new records.
    */



More information about the Schmitzm-commits mailing list