Revision: 5570
          http://sourceforge.net/p/jump-pilot/code/5570
Author:   edso
Date:     2017-11-18 04:28:16 +0000 (Sat, 18 Nov 2017)
Log Message:
-----------
ApplicationExitHandler handling a little bit refined

Modified Paths:
--------------
    core/trunk/src/com/vividsolutions/jump/workbench/ui/WorkbenchFrame.java

Modified: 
core/trunk/src/com/vividsolutions/jump/workbench/ui/WorkbenchFrame.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/workbench/ui/WorkbenchFrame.java     
2017-11-18 04:17:29 UTC (rev 5569)
+++ core/trunk/src/com/vividsolutions/jump/workbench/ui/WorkbenchFrame.java     
2017-11-18 04:28:16 UTC (rev 5570)
@@ -1827,7 +1827,12 @@
      */
     @Deprecated
     public ApplicationExitHandler getApplicationExitHandler() {
-        return applicationExitHandler;
+        // return just a stub, functionality is replaced by 
addApplicationExitHandler()
+        return new ApplicationExitHandler() {
+          @Override
+          public void exitApplication(JFrame mainFrame) {
+          }
+        };
     }
 
     /**
@@ -1839,9 +1844,9 @@
      */
     @Deprecated
     public void setApplicationExitHandler(ApplicationExitHandler value) {
-        applicationExitHandler = value;
+        addApplicationExitHandler(value);
     }
-    
+
     /**
      * Gets the ApplicationExitHandlers.
      * 
@@ -1850,7 +1855,7 @@
     private List<ApplicationExitHandler> getApplicationExitHandlers() {
         return applicationExitHandlers;
     }
-    
+
     /**
      * Adds an ApplicationExitHandler, wich will be executed if the
      * WorkbenchFrame gets closing.
@@ -1858,9 +1863,11 @@
      * @param aeh the ApplicationExitHandler to add
      */
     public void addApplicationExitHandler(ApplicationExitHandler aeh) {
-        applicationExitHandlers.add(aeh);
+      if (aeh == null)
+        throw new IllegalArgumentException("ApplicationExitHandler must not be 
null!");
+      applicationExitHandlers.add(aeh);
     }
-    
+
     /**
      * Remove's the given ApplicationExitHandler.
      * 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to