svn commit: r15182 - branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels: panel xml

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: penyaskito
Date: 2008-07-06 10:45:32-0700
New Revision: 15182

Modified:
   branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java
   branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Attribute.xml

Log:
Added textarea element for text fields that need more than one line, or are somewhat special.

Modified: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java?view=diff&rev=15182&p1=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java&p2=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java&r1=15181&r2=15182
==============================================================================
--- branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java	(original)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java	2008-07-06 10:45:32-0700
@@ -36,6 +36,9 @@
 import javax.swing.border.TitledBorder;
 
 import org.apache.log4j.Logger;
+import org.argouml.core.propertypanels.ui.UMLExpressionModel3;
+import org.argouml.core.propertypanels.ui.UMLExpressionPanel;
+import org.argouml.core.propertypanels.ui.UMLInitialValueExpressionModel;
 import org.argouml.core.propertypanels.xml.XMLPropertyPanelsData;
 import org.argouml.core.propertypanels.xml.XMLPropertyPanelsDataRecord;
 import org.argouml.core.propertypanels.xml.XMLPropertyPanelsHandler;
@@ -47,6 +50,9 @@
 import org.argouml.uml.ui.UMLComboBoxModel2;
 import org.argouml.uml.ui.UMLComboBoxNavigator;
 import org.argouml.uml.ui.UMLDerivedCheckBox;
+import org.argouml.uml.ui.UMLExpressionBodyField;
+import org.argouml.uml.ui.UMLExpressionLanguageField;
+import org.argouml.uml.ui.UMLExpressionModel2;
 import org.argouml.uml.ui.UMLModelElementListModel2;
 import org.argouml.uml.ui.UMLMultiplicityPanel;
 import org.argouml.uml.ui.UMLMutableLinkedList;
@@ -76,10 +82,8 @@
 import org.argouml.uml.ui.foundation.core.UMLModelElementVisibilityRadioButtonPanel;
 import org.argouml.uml.ui.foundation.core.UMLNamespaceOwnedElementListModel;
 import org.argouml.uml.ui.foundation.core.UMLStructuralFeatureChangeabilityRadioButtonPanel;
-import org.argouml.uml.ui.foundation.core.UMLStructuralFeatureTargetScopeCheckBox;
 import org.argouml.uml.ui.foundation.core.UMLStructuralFeatureTypeComboBoxModel;
 import org.argouml.uml.ui.model_management.UMLClassifierPackageImportsListModel;
-import org.tigris.swidgets.GridLayout2;
 import org.tigris.swidgets.LabelledLayout;
 import org.xml.sax.InputSource;
 import org.xml.sax.XMLReader;
@@ -178,6 +182,12 @@
                     panel.add(scrollPane);
                 }
             }
+            else if ("textarea".equals(prop.getType())) {
+                JPanel p = buildTextArea(target, prop);
+                if (p != null) {
+                    panel.add(p);
+                }
+            }
             else if ("separator".equals(prop.getType())) {
                 panel.add(LabelledLayout.getSeperator());
             }
@@ -185,6 +195,20 @@
         return panel;
     }
 
+    private JPanel buildTextArea(Object target, XMLPropertyPanelsDataRecord prop) {
+        JPanel p = new JPanel();
+        TitledBorder border = new TitledBorder(prop.getName());        
+        p.setBorder(border);
+
+        if ("initial_value".equals(prop.getName())) {        
+            UMLExpressionModel3 model = new UMLInitialValueExpressionModel();
+            // model.setTarget(target);
+
+            p  = new UMLExpressionPanel(model, prop.getName());
+        }
+        return p;
+    }
+
     private JPanel buildSingleRow(Object target,
             XMLPropertyPanelsDataRecord prop) {
         JPanel p = new JPanel();

Modified: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Attribute.xml
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Attribute.xml?view=diff&rev=15182&p1=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Attribute.xml&p2=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Attribute.xml&r1=15181&r2=15182
==============================================================================
--- branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Attribute.xml	(original)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Attribute.xml	2008-07-06 10:45:32-0700
@@ -10,5 +10,5 @@
 	<checkgroup name='modifiers'>
 		<checkbox name='static' />
 	</checkgroup>
-	<text name='initial_value' />
+	<textarea name='initial_value' />
 </panel>
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.