[Laszlo-checkins] r3801 - openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler

ptw@openlaszlo.org ptw at openlaszlo.org
Tue Feb 13 11:51:45 PST 2007


Author: ptw
Date: 2007-02-13 11:51:42 -0800 (Tue, 13 Feb 2007)
New Revision: 3801

Modified:
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/AttributeSpec.java
Log:
Change 20070213-ptw-Z by ptw at dueling-banjos.local on 2007-02-13 14:10:25 EST
    in /Users/ptw/OpenLaszlo/trunk

Summary: Handle when in binary libraries

Technical Reviewer: hminsky (IM 14:40 US/Eastern)
QA Reviewer: adam (pending)
Doc Reviewer: n/a

Details:
    If an attribute overrides it's when value, the interface must
    record it.

Tests:
    Adam's test appears to work.

Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/AttributeSpec.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/AttributeSpec.java	2007-02-13 19:20:17 UTC (rev 3800)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/AttributeSpec.java	2007-02-13 19:51:42 UTC (rev 3801)
@@ -10,6 +10,7 @@
 package org.openlaszlo.compiler;
 
 import org.openlaszlo.xml.internal.Schema.Type;
+import org.openlaszlo.xml.internal.XMLUtils;
 import org.jdom.Element;
 
 /** Contains information about an attribute of a laszlo viewsystem class.
@@ -27,6 +28,9 @@
     Type type;
     /** Is this attribute required to instantiate an instance of this class? */
     boolean required = false;
+    /** When does the initial value for this attribute get evaluated? */
+    String when = NodeModel.WHEN_IMMEDIATELY;
+
     /** Is this attribute equivalent to element content of a given type? */
     int contentType = NO_CONTENT;
 
@@ -55,6 +59,7 @@
       return indent + "<attribute name='" + name + "'" +
         ((defaultValue != null)?(" value='" + defaultValue + "'"):"") +
         ((type != null)?(" type='" + typeToLZX() + "'"):"") +
+        ((when != NodeModel.WHEN_IMMEDIATELY)?(" when='" + when + "'"):"") + 
         (required?(" required='true'"):"") +
         " />";
     } else if (! ViewSchema.EVENT_TYPE.equals(type)) {
@@ -67,6 +72,10 @@
           (! type.equals(superclass.getAttributeType(name)))) {
         attrs += " type='" + typeToLZX() + "'";
       }
+      if (when != null &&
+          (! when.equals(superSpec.when))) {
+        attrs += " when='" + when + "'";
+      }
       if (required != superSpec.required) {
         attrs += " required='" + required + "'";
       }
@@ -83,6 +92,7 @@
         this.type = type;
         this.defaultValue = defaultValue;
         this.setter = setter;
+        this.when = XMLUtils.getAttributeValue(source, "when", NodeModel.WHEN_IMMEDIATELY);
     }
 
     AttributeSpec (String name, Type type, String defaultValue, String setter, boolean required, Element source) {
@@ -92,6 +102,7 @@
         this.defaultValue = defaultValue;
         this.setter = setter;
         this.required = required;
+        this.when = XMLUtils.getAttributeValue(source, "when", NodeModel.WHEN_IMMEDIATELY);
     }
 
     AttributeSpec (String name, Type type, String defaultValue, String setter) {



More information about the Laszlo-checkins mailing list