[Schmitzm-commits] r959 - branches/2.2.x/src/skrueger/swing
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Aug 10 14:12:43 CEST 2010
Author: alfonx
Date: 2010-08-10 14:12:43 +0200 (Tue, 10 Aug 2010)
New Revision: 959
Modified:
branches/2.2.x/src/skrueger/swing/DialogManager.java
Log:
JavaDoc
Modified: branches/2.2.x/src/skrueger/swing/DialogManager.java
===================================================================
--- branches/2.2.x/src/skrueger/swing/DialogManager.java 2010-08-09 17:14:03 UTC (rev 958)
+++ branches/2.2.x/src/skrueger/swing/DialogManager.java 2010-08-10 12:12:43 UTC (rev 959)
@@ -11,18 +11,22 @@
import org.apache.log4j.Logger;
+import schmitzm.swing.ExceptionDialog;
+
public abstract class DialogManager<KEY, DIALOG extends AtlasDialog> {
final static private Logger LOGGER = Logger.getLogger(DialogManager.class);
public abstract class FactoryInterface {
public abstract DIALOG create();
-
+
/** May be overridden to add Listeners **/
- public void afterCreation(DIALOG newInstance){};
+ public void afterCreation(DIALOG newInstance) {
+ };
/** May be overridden to remove Listeners added earlier **/
- public void beforeDispose(DIALOG newInstance){};
+ public void beforeDispose(DIALOG newInstance) {
+ };
}
@@ -51,10 +55,17 @@
}
/**
+ * Implementing this should have a <br/>
+ * <code>try { ... return ... } catch (Exception e) {
+ ExceptionDialog.show(owner, e);
+ return null;
+ } </code> block.
+ *
* @param key
* @param owner
* @param constArgs
- * @return a cached instance or creates a new instance. Instances are always retuned visible and toFront.
+ * @return a cached instance or creates a new instance. Instances are always
+ * returned visible and toFront.
*/
public abstract DIALOG getInstanceFor(final KEY key, final Component owner,
final Object... constArgs);
@@ -130,10 +141,9 @@
public void windowClosing(final WindowEvent e) {
}
});
-
+
factory.afterCreation(dialog);
}
-
return dialog;
}
@@ -166,5 +176,4 @@
return dialogCache.values();
}
-
}
More information about the Schmitzm-commits
mailing list