svn commit: r17503 - trunk/src/argouml-app/src/org/argouml/ui/DetailsPane.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-11-20 06:50:54-0800
New Revision: 17503

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

Log:
Allow tabs to removed from the details pane

Modified: trunk/src/argouml-app/src/org/argouml/ui/DetailsPane.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/DetailsPane.java?view=diff&pathrev=17503&r1=17502&r2=17503
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/DetailsPane.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/ui/DetailsPane.java	2009-11-20 06:50:54-0800
@@ -187,7 +187,9 @@
      * @param p the panel to be added 
      * @param atEnd true = add the panel at the end, 
      *                  false = at the beginning
+     * @deprecated by Bob Tarling in 0.29.3 use addTab(JPanel, boolean)
      */
+    @Deprecated
     public void addTab(AbstractArgoJPanel p, boolean atEnd) {
         Icon icon = p.getIcon();
         String title = Translator.localize(p.getTitle());
@@ -202,6 +204,39 @@
     }
 
     /**
+     * @param p the panel to be added 
+     * @param atEnd true = add the panel at the end, 
+     *                  false = at the beginning
+     */
+    public void addTab(JPanel p, boolean atEnd) {
+        final Icon icon;
+        final String title;
+        if (p instanceof AbstractArgoJPanel) {
+            icon = ((AbstractArgoJPanel) p).getIcon();
+            title =
+                Translator.localize(((AbstractArgoJPanel) p).getTitle());
+        } else {
+            icon = null;
+            title = p.getName();
+        }
+        if (atEnd) {
+            topLevelTabbedPane.addTab(title, icon, p); 
+            tabPanelList.add(p);
+        } else { 
+            topLevelTabbedPane.insertTab(title, icon, p, null, 0);
+            tabPanelList.add(0, p);
+        }
+    }
+
+    /**
+     * @param p the panel to be removed
+     */
+    public void removeTab(JPanel p) {
+        topLevelTabbedPane.remove(p); 
+        tabPanelList.remove(p);
+    }
+
+    /**
      * Selects the to do tab, and sets the target of that tab.
      * 
      * @param item the selected todo item
@@ -638,9 +673,9 @@
                 if (shouldEnable) {
                     addTargetListener((TargetListener) tab);
                 }
-            }
 
-            topLevelTabbedPane.setEnabledAt(i, shouldEnable);
+                topLevelTabbedPane.setEnabledAt(i, shouldEnable);
+            }
         }
     }

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

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.