svn commit: r17566 - trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-11-30 12:57:56-0800
New Revision: 17566

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java

Log:
Temporary API to stop TabProps from caching panels

Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java?view=diff&pathrev=17566&r1=17565&r2=17566
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java	2009-11-30 12:57:56-0800
@@ -68,6 +68,8 @@
      * Logger.
      */
     private static final Logger LOG = Logger.getLogger(TabProps.class);
+    
+    private static boolean cachePanels = true;
 
     private JPanel blankPanel = new JPanel();
     private Hashtable<Class, JPanel> panels = 
@@ -231,13 +233,19 @@
         // TODO: No test coverage for this or createPropPanel? - tfm
         
         /* 1st attempt: get a panel that we created before: */
-        JPanel panel = panels.get(trgt.getClass());
-        if (panel != null) {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Getting prop panel for: " + trgt.getClass().getName()
-                        + ", " + "found (in cache?) " + panel);
+        JPanel panel;
+        if (cachePanels) {
+            // TODO: Once XML Property panels are live we should no longer be
+            // caching panels, this code and the panels HashTable can go.
+            panel = panels.get(trgt.getClass());
+            if (panel != null) {
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Getting prop panel for: "
+                            + trgt.getClass().getName()
+                            + ", " + "found (in cache?) " + panel);
+                }
+                return panel;
             }
-            return panel;
         }
 
         /* 2nd attempt: If we didn't find the panel then
@@ -417,5 +425,15 @@
             }
         }
     }
+    
+    /**
+     * This method is introduced as deprecated it should be removed from the
+     * code before release 0.30. It is currently used by the
+     * XML Property Panel module only and should not be used elsewhere.
+     */
+    @Deprecated
+    public static void disableCache() {
+        cachePanels = false;
+    }
 
 } /* end class TabProps */

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2425672

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.