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

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: penyaskito
Date: 2008-06-23 03:40:21-0700
New Revision: 15045

Modified:
   branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/XMLPropPanelFactory.java
   branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/XmlPropertyPanel.java

Log:
Trying to create the property panels by registering a element PropPanel Factory, but it doesn't work :/

Modified: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/XMLPropPanelFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/XMLPropPanelFactory.java?view=diff&rev=15045&p1=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/XMLPropPanelFactory.java&p2=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/XMLPropPanelFactory.java&r1=15044&r2=15045
==============================================================================
--- branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/XMLPropPanelFactory.java	(original)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/XMLPropPanelFactory.java	2008-06-23 03:40:21-0700
@@ -24,6 +24,7 @@
 
 package org.argouml.core.propertypanels.panel;
 
+import org.argouml.core.propertypanels.xml.XMLPropertyPanelsHandler;
 import org.argouml.uml.ui.PropPanel;
 import org.argouml.uml.ui.PropPanelFactory;
 
@@ -34,8 +35,10 @@
 public class XMLPropPanelFactory implements PropPanelFactory {
 
     public PropPanel createPropPanel(Object target) {
-        // TODO: Auto-generated method stub
-       return null;
+        XmlPropertyPanel panel = 
+            new XmlPropertyPanel("XML Property Panel", null);
+        panel.build(target);
+        return panel;
     }
 
 }

Modified: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/XmlPropertyPanel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/XmlPropertyPanel.java?view=diff&rev=15045&p1=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/XmlPropertyPanel.java&p2=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/XmlPropertyPanel.java&r1=15044&r2=15045
==============================================================================
--- branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/XmlPropertyPanel.java	(original)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/XmlPropertyPanel.java	2008-06-23 03:40:21-0700
@@ -64,26 +64,29 @@
     }
     
     @Override
-    public void setTarget(Object t) {
-        super.setTarget(t);
-        setTitle(t.toString());
+    public void setTarget(Object target) {
+        super.setTarget(target);       
         // TODO: Here will have to do something based on the 
         // type of the target received. For
         // commodity, we could use just the name:
         // p.e.: org.omg.uml.foundation.core.UmlClass$Impl
         // Our XML can be called Class.xml or if we split the
         // UI and the model info, Class.ui.xml and Class.model.xml
-        LOG.info("[XMLPP] t is type:" + t.getClass());
+        build(target);
+    }
+    
+    public void build(Object target){
+        LOG.info("[XMLPP] t is type:" + target.getClass());
         
         if (currentPanel != null) {
             this.remove(currentPanel);
         }
         try {
-            currentPanel = UIFactory.getInstance().createGUI(t);
+            currentPanel = UIFactory.getInstance().createGUI(target);
             this.add(currentPanel);
         } catch (Exception e) {
             // TODO: Auto-generated catch block
             LOG.error("Exception", e);
-        }
+        }        
     }
 }
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.