[Schmitzm-commits] r1529 - trunk/schmitzm-core/src/main/java/de/schmitzm/swing

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Mar 20 13:15:06 CET 2011


Author: alfonx
Date: 2011-03-20 13:15:06 +0100 (Sun, 20 Mar 2011)
New Revision: 1529

Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/DialogManager.java
Log:
HTML editors are now managed with  a dialog manager.. hence they can only be opened once

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/DialogManager.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/DialogManager.java	2011-03-19 17:27:16 UTC (rev 1528)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/DialogManager.java	2011-03-20 12:15:06 UTC (rev 1529)
@@ -1,6 +1,7 @@
 package de.schmitzm.swing;
 
 import java.awt.Component;
+import java.awt.Window;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
 import java.util.Collection;
@@ -11,7 +12,7 @@
 
 import org.apache.log4j.Logger;
 
-public abstract class DialogManager<KEY, DIALOG extends AtlasDialog> {
+public abstract class DialogManager<KEY, DIALOG extends Window> {
 	final static private Logger LOGGER = Logger.getLogger(DialogManager.class);
 
 	public abstract class FactoryInterface {
@@ -45,7 +46,7 @@
 	 * @return
 	 */
 	protected DIALOG bringup(DIALOG dialog) {
-		if (dialog == null){
+		if (dialog == null) {
 			// The dialog creation may have been cancelled
 			return null;
 		}
@@ -128,8 +129,10 @@
 		} else {
 
 			dialog = factory.create();
-			if (dialog.isDisposed) {
-				// The creation of the Dialog may have been cancelled for some reason
+			if (dialog instanceof AtlasDialog
+					&& ((AtlasDialog) dialog).isDisposed) {
+				// The creation of the Dialog may have been cancelled for some
+				// reason
 				return null;
 			}
 			dialogCache.put(key, dialog);



More information about the Schmitzm-commits mailing list