[Schmitzm-commits] r1040 - branches/2.2.x/src/skrueger/swing

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Sep 22 12:55:01 CEST 2010


Author: alfonx
Date: 2010-09-22 12:55:00 +0200 (Wed, 22 Sep 2010)
New Revision: 1040

Modified:
   branches/2.2.x/src/skrueger/swing/DialogManager.java
Log:
When opening a dialog is canceled during construction, no more empty dialog will appear

Modified: branches/2.2.x/src/skrueger/swing/DialogManager.java
===================================================================
--- branches/2.2.x/src/skrueger/swing/DialogManager.java	2010-09-22 10:54:14 UTC (rev 1039)
+++ branches/2.2.x/src/skrueger/swing/DialogManager.java	2010-09-22 10:55:00 UTC (rev 1040)
@@ -45,6 +45,10 @@
 	 * @return
 	 */
 	protected DIALOG bringup(DIALOG dialog) {
+		if (dialog == null){
+			// The dialog creation may have been cancelled
+			return null;
+		}
 		if (!dialog.isVisible())
 			dialog.setVisible(true);
 		dialog.toFront();
@@ -124,6 +128,10 @@
 		} else {
 
 			dialog = factory.create();
+			if (dialog.isDisposed) {
+				// The creation of the Dialog may have been cancelled for some reason
+				return null;
+			}
 			dialogCache.put(key, dialog);
 			dialog.setVisible(true);
 			dialog.toFront();



More information about the Schmitzm-commits mailing list