svn commit: r15139 - branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/XMLPropPanelFactory.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: penyaskito
Date: 2008-07-01 05:17:10-0700
New Revision: 15139

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

Log:
Applied patch from Bob Tarling. If the PropPanel factory is registered, we return null if the target is not a model element, so other factories can create PropPanels (p.e., diagrams panels)

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=15139&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=15138&r2=15139
==============================================================================
--- 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-07-01 05:17:10-0700
@@ -24,7 +24,7 @@
 
 package org.argouml.core.propertypanels.panel;
 
-import org.argouml.core.propertypanels.xml.XMLPropertyPanelsHandler;
+import org.argouml.model.Model;
 import org.argouml.uml.ui.PropPanel;
 import org.argouml.uml.ui.PropPanelFactory;
 
@@ -35,10 +35,14 @@
 public class XMLPropPanelFactory implements PropPanelFactory {
 
     public PropPanel createPropPanel(Object target) {
-        XmlPropertyPanel panel = 
-            new XmlPropertyPanel("XML Property Panel", null);
-        panel.build(target);
-        return panel;
+        if (Model.getFacade().isAModelElement(target)) {
+            XmlPropertyPanel panel =
+                new XmlPropertyPanel("XML Property Panel", null);
+            panel.build(target);
+            return panel;
+        } else {
+            return null;
+        }
     }
 
 }
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.