svn commit: r17942 - 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: 2010-01-31 01:03:32-0800
New Revision: 17942

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

Log:
Add a menu with a New Stereotype icon

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=17942&r1=17941&r2=17942
==============================================================================
--- 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	2010-01-31 01:03:32-0800
@@ -41,12 +41,15 @@
 
 import javax.swing.JComboBox;
 import javax.swing.JComponent;
+import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.JTextArea;
 import javax.swing.JTextField;
+import javax.swing.JToolBar;
 import javax.swing.border.TitledBorder;
 
+import org.argouml.application.helpers.ResourceLoaderWrapper;
 import org.argouml.core.propertypanels.meta.CheckBoxMeta;
 import org.argouml.core.propertypanels.meta.PanelMeta;
 import org.argouml.core.propertypanels.meta.PropertyMeta;
@@ -54,7 +57,9 @@
 import org.argouml.i18n.Translator;
 import org.argouml.model.Model;
 import org.argouml.uml.ui.UMLComboBoxNavigator;
+import org.argouml.uml.ui.foundation.extension_mechanisms.ActionNewStereotype;
 import org.tigris.swidgets.GridLayout2;
+import org.tigris.toolbar.ToolBarFactory;
 
 /**
  * Creates the XML Property panels
@@ -76,6 +81,15 @@
             XMLPropPanelFactory.getInstance().getPropertyPanelsData(
                     Model.getMetaTypes().getName(target));
         
+        final String metaTypeName = Model.getMetaTypes().getName(target);
+        ToolBarFactory tbf = new ToolBarFactory(new Object[0]);
+        tbf.setRollover(true);
+        JToolBar tb = tbf.createToolBar();
+        tb.add(new JLabel(metaTypeName, ResourceLoaderWrapper.lookupIconResource(metaTypeName), JLabel.LEFT));
+        tb.add(new ActionNewStereotype());
+        
+        panel.add(tb);
+        
         for (PropertyMeta prop : data.getProperties()) {
             if ("text".equals(prop.getControlType())) {
                 buildTextboxPanel(panel, target, prop);

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

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.