svn commit: r15281 - 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-15 08:24:58-0700
New Revision: 15281

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

Log:
Little refactoring and style, no functional change.

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=15281&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=15280&r2=15281
==============================================================================
--- 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-07-15 08:24:58-0700
@@ -81,7 +81,7 @@
         build(target);
     }
     
-    public void build(Object target){
+    public void build(Object target) {
         LOG.info("[XMLPP] t is type:" + target.getClass());
         
         if (currentPanel != null) {

Modified: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/XMLPropertyPanelsHandler.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/XMLPropertyPanelsHandler.java?view=diff&rev=15281&p1=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/XMLPropertyPanelsHandler.java&p2=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/XMLPropertyPanelsHandler.java&r1=15280&r2=15281
==============================================================================
--- branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/XMLPropertyPanelsHandler.java	(original)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/XMLPropertyPanelsHandler.java	2008-07-15 08:24:58-0700
@@ -52,50 +52,29 @@
 
     public void startElement(String namespaceURI, String localName, 
             String qName, Attributes attr) throws SAXException { 
-//        if (localName.equals("panel")) {
-//            String title = attr.getValue("title");
-//            data.addPanel(title);
-//        }
-//        if (localName.equals("text")) {
-//            String name = attr.getValue("name");
-//            data.addProperty("text", name);
-//        }
-//        if (localName.equals("combo")) {
-//            String name = attr.getValue("name");
-//            data.addProperty("combo", name);
-//        }
         XMLPropertyPanelsDataRecord record = 
             new XMLPropertyPanelsDataRecord(localName, attr.getValue("name"));
         
         if (isChild(localName)) {
             current.addChild(record);
         }
-        else if (hasChilds(localName)) {
+        else if (hasChildren(localName)) {
             current = record;
             data.addProperty(record);
         }
         else {
             data.addProperty(record);
         }
-        
-        
     }
 
     private boolean isChild(String elementName) {
-        if ("checkbox".equals(elementName)) {
-            return true;
-        }
-        else {
-            return false;
-        }
+        // for now, the only child are checkboxes.
+        return "checkbox".equals(elementName);
     }
 
-    private boolean hasChilds(String elementName) {
-        if ("checkgroup".equals(elementName)) {
-            return true;
-        }
-        else {
-            return false;
-        }
+    private boolean hasChildren(String elementName) {
+        // for now, the only element that can have 
+        // children are checkgroups.
+        return "checkgroup".equals(elementName);
     }
 }
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.