svn commit: r17494 - trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels: module panel

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-11-19 12:14:02-0800
New Revision: 17494

Modified:
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/module/XmlPropertyPanelsModule.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/panel/XMLPropPanelFactory.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/panel/XmlPropertyPanel.java

Log:
Our new property panels should replace old property panels

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/module/XmlPropertyPanelsModule.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/module/XmlPropertyPanelsModule.java?view=diff&pathrev=17494&r1=17493&r2=17494
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/module/XmlPropertyPanelsModule.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/module/XmlPropertyPanelsModule.java	2009-11-19 12:14:02-0800
@@ -24,13 +24,9 @@
 
 package org.argouml.core.propertypanels.module;
 
-import java.util.ArrayList;
-import java.util.List;
-
-import org.argouml.application.api.AbstractArgoJPanel;
+import org.apache.log4j.Logger;
 import org.argouml.core.propertypanels.panel.XMLPropPanelFactory;
 import org.argouml.core.propertypanels.panel.XmlPropertyPanel;
-import org.argouml.moduleloader.DetailsTabProvider;
 import org.argouml.moduleloader.ModuleInterface;
 import org.argouml.uml.ui.PropPanelFactory;
 import org.argouml.uml.ui.PropPanelFactoryManager;
@@ -41,24 +37,44 @@
  * @author penyaskito
  */
 public class XmlPropertyPanelsModule 
-        implements ModuleInterface, DetailsTabProvider {
-
+    implements ModuleInterface {
+    // TODO: Uncomment this and replace above line to see old and new panel
+    // together
+//  implements ModuleInterface, DetailsTabProvider {
+
+    /**
+     * The logger
+     */
+    private static final Logger LOG =
+        Logger.getLogger(XmlPropertyPanel.class);
+    
+    private XmlPropertyPanel panel;
+    
     public boolean disable() {
         return true;
     }
 
     public boolean enable() { 
         /* Set up the property panels for UML elements: */
-//        PropPanelFactory elementFactory = new XMLPropPanelFactory();
-//        PropPanelFactoryManager.addPropPanelFactory(elementFactory);
-        return true;
+        try {
+            // Comment this out to see both panels together
+            PropPanelFactory elementFactory = XMLPropPanelFactory.getInstance();
+            PropPanelFactoryManager.addPropPanelFactory(elementFactory);
+            panel = new XmlPropertyPanel();
+            // comment out to here
+            return true;
+        } catch (Exception e) {
+            LOG.error("Exception caught", e);
+            return false;
+        }
     }
 
-    public List<AbstractArgoJPanel> getDetailsTabs() {        
-        List<AbstractArgoJPanel> result = new ArrayList<AbstractArgoJPanel>();
-        result.add(XmlPropertyPanel.getInstance());
-        return result;
-    }
+    // Uncomment this to see both panels together
+//    public List<AbstractArgoJPanel> getDetailsTabs() {        
+//        List<AbstractArgoJPanel> result = new ArrayList<AbstractArgoJPanel>();
+//        result.add(panel);
+//        return result;
+//    }
 
     public String getInfo(int type) {
         switch (type) {

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/panel/XMLPropPanelFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/panel/XMLPropPanelFactory.java?view=diff&pathrev=17494&r1=17493&r2=17494
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/panel/XMLPropPanelFactory.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/panel/XMLPropPanelFactory.java	2009-11-19 12:14:02-0800
@@ -63,7 +63,7 @@
     public PropPanel createPropPanel(Object target) {
         if (Model.getFacade().isAModelElement(target)) {
             XmlPropertyPanel panel =
-                new XmlPropertyPanel("XML Property Panel", null);
+                new XmlPropertyPanel();
             panel.build(target);
             return panel;
         } else {

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/panel/XmlPropertyPanel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/panel/XmlPropertyPanel.java?view=diff&pathrev=17494&r1=17493&r2=17494
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/panel/XmlPropertyPanel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/panel/XmlPropertyPanel.java	2009-11-19 12:14:02-0800
@@ -47,27 +47,14 @@
      */
     private static final Logger LOG = Logger.getLogger(XmlPropertyPanel.class);
     
-    public XmlPropertyPanel(String label, ImageIcon icon) {
-        super(label, icon);
+    public XmlPropertyPanel() {
+        super("XML Properties", null);
         /* Since there are no buttons on this panel (YET), 
          * we have to set the size of the buttonpanel, 
          * otherwise the layout will give it a lot of space 
          * */
     }
 
-    /**
-     * The instance.
-     */
-    private static final XmlPropertyPanel INSTANCE =
-        new XmlPropertyPanel("XML Properties", null);
-
-    /**
-     * @return The instance.
-     */
-    public static XmlPropertyPanel getInstance() {
-        return INSTANCE;
-    }
-    
     @Override
     public void setTarget(Object target) {
         super.setTarget(target);

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

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.