/[schmitzm]/branches/2.0-RC1/src/skrueger/swing/CancellableDialogManager.java
ViewVC logotype

Annotation of /branches/2.0-RC1/src/skrueger/swing/CancellableDialogManager.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 615 - (hide annotations)
Mon Dec 14 17:31:41 2009 UTC (15 years, 2 months ago) by alfonx
File MIME type: text/plain
File size: 1157 byte(s)
DialogManager didn't always remove instances from the cache. 
Translation constructor List<String>, defaultTranslaiton only set the default for the active langage

1 alfonx 422 package skrueger.swing;
2    
3    
4     public abstract class CancellableDialogManager<KEY, DIALOG extends CancellableDialogAdapter>
5     extends DialogManager<KEY, DIALOG> {
6    
7     /**
8     * Will force a dispose of all dialogs, but the user may decide whether she
9     * wants to save anything first.
10     */
11     public void forceCloseAllInstances() {
12     for (DIALOG d : getAllInstances()) {
13     d.forceClose();
14     }
15 alfonx 615 dialogCache.clear();
16 alfonx 422 }
17    
18     /**
19     * Will try to close all dialogs, but the user may decide whether she
20     * wants to save anything first or abort the closing.
21     */
22     public boolean closeAllInstances() {
23     for (DIALOG d : getAllInstances()) {
24     if (!d.close())
25     return false;
26     }
27 alfonx 615
28     dialogCache.clear();
29 alfonx 422 return true;
30     }
31    
32     /**
33 alfonx 509 * Tells the user that the dialog shall be closed. The user may save, cancel or abort the closing.
34 alfonx 422 *
35     * @return <code>true</code> if there is no open instance or the instance has been disposed
36     */
37     public boolean close(KEY key) {
38     if (isVisibleFor(key)) {
39 alfonx 615 boolean closeResult = getInstanceFor(key, null).close();
40     if (closeResult) dialogCache.remove(key);
41     return closeResult;
42 alfonx 422 }
43 alfonx 615 dialogCache.remove(key);
44 alfonx 422 return true;
45     }
46    
47     }

Properties

Name Value
svn:eol-style native
svn:keywords Id URL
svn:mime-type text/plain

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26