svn commit: r17144 - trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-05-21 12:43:06-0700
New Revision: 17144

Modified:
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java

Log:
Add the lists toolbar to the panel

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java?view=diff&pathrev=17144&r1=17143&r2=17144
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java	2009-05-21 12:43:06-0700
@@ -24,13 +24,20 @@
 
 package org.argouml.core.propertypanels.ui;
 
+import java.awt.Color;
+import java.util.List;
+
+import javax.swing.Action;
 import javax.swing.JComboBox;
 import javax.swing.JComponent;
 import javax.swing.JLabel;
+import javax.swing.JList;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.JTextArea;
 import javax.swing.JTextField;
+import javax.swing.JToolBar;
+import javax.swing.ListModel;
 import javax.swing.border.TitledBorder;
 
 import org.argouml.core.propertypanels.panel.UIFactory;
@@ -91,6 +98,8 @@
 import org.argouml.uml.ui.foundation.extension_mechanisms.ActionSetTagDefinitionType;
 import org.argouml.uml.ui.foundation.extension_mechanisms.UMLMetaClassComboBoxModel;
 import org.tigris.swidgets.GridLayout2;
+import org.tigris.toolbar.ToolBar;
+import org.tigris.toolbar.ToolBarFactory;
 
 /**
  * Creates the XML Property panels
@@ -254,6 +263,15 @@
             label.setLabelFor(list);
             panel.add(label);
             panel.add(list);
+            if (list instanceof ScrollList) {
+                final ListModel m = ((ScrollList) list).getListModel();
+                if (m instanceof UMLModelElementListModel) {
+                    final List<Action> actions = ((UMLModelElementListModel) m).getActions();
+                    final ToolBarFactory tbf = new ToolBarFactory(actions);
+                    final JToolBar tb = tbf.createToolBar();
+                    panel.add(tb);
+                }
+            }
         }
     }

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

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.