/[schmitzm]/trunk/src/skrueger/swing/DialogManager.java
ViewVC logotype

Diff of /trunk/src/skrueger/swing/DialogManager.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 421 by alfonx, Thu Oct 1 21:06:37 2009 UTC revision 433 by alfonx, Sun Oct 4 16:57:29 2009 UTC
# Line 3  package skrueger.swing; Line 3  package skrueger.swing;
3  import java.awt.Component;  import java.awt.Component;
4  import java.awt.event.WindowAdapter;  import java.awt.event.WindowAdapter;
5  import java.awt.event.WindowEvent;  import java.awt.event.WindowEvent;
6    import java.util.Collection;
7  import java.util.HashMap;  import java.util.HashMap;
8  import java.util.HashSet;  import java.util.HashSet;
9    
# Line 16  public abstract class DialogManager<KEY, Line 17  public abstract class DialogManager<KEY,
17          public abstract class FactoryInterface {          public abstract class FactoryInterface {
18    
19                  public abstract DIALOG create();                  public abstract DIALOG create();
20                    
21                    /** May be overridden to add Listeners **/
22                    public void appendListeners(DIALOG newInstance){};
23    //
24    //              /** May be overridden to remove Listeners added earlier **/
25    //              public void removeListeners(DIALOG newInstance){};
26    
27          }          }
28    
29          private HashMap<KEY, DIALOG> dialogCache = new HashMap<KEY, DIALOG>();          protected HashMap<KEY, DIALOG> dialogCache = new HashMap<KEY, DIALOG>();
30    
31          /**          /**
32           * A {@link DialogManager} instance can be created for any extension of           * A {@link DialogManager} instance can be created for any extension of
# Line 111  public abstract class DialogManager<KEY, Line 118  public abstract class DialogManager<KEY,
118                                          disposeInstanceFor(key);                                          disposeInstanceFor(key);
119                                  }                                  }
120                          });                          });
121                            
122                            factory.appendListeners(dialog);
123                  }                  }
124                  return dialog;                  return dialog;
125          }          }
# Line 136  public abstract class DialogManager<KEY, Line 145  public abstract class DialogManager<KEY,
145                  return atLeastOne;                  return atLeastOne;
146          }          }
147    
148            /**
149             * @return All instances of DIALOG as they are cached.
150             */
151            public Collection<DIALOG> getAllInstances() {
152                    return dialogCache.values();
153            }
154    
155    
156  }  }

Legend:
Removed from v.421  
changed lines
  Added in v.433

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26