Author: ben
Date: 2007-11-11 20:45:54 -0800 (Sun, 11 Nov 2007)
New Revision: 7212

Modified:
   openlaszlo/branches/paperpie/WEB-INF/lps/lfc/core/LzNode.lzs
   openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
   openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LaszloView.lzs
   openlaszlo/branches/paperpie/docs/src/xsl/js2doc2dbk.xsl
   openlaszlo/branches/paperpie/docs/src/xsl/simple-driver.xsl
Log:
Change 20071111-ben-K by [EMAIL PROTECTED] on 2007-11-11 20:14:51 PST
    in /Users/ben/src/svn/openlaszlo/branches/paperpie
    for http://svn.openlaszlo.org/openlaszlo/branches/paperpie

Summary: Reference: events and attributes for LzView, LzNode. 

Documentation:
This change fixes js2doc comments in LzView and LzNode to make them
match the information in the LPS 3.4 reference.

The syntax for declaring events has changed from DeclareEvent(prototype, 
'onfoo')
to var onfoo = LzDeclaredEvent. This change finds that pattern, when
accompanied by the doc comment @lzxtype event, and lists those events
in the reference. 

Known Issues: init args are listed twice in the attributes list. Events
are listed both in the attributes list and the events list. 

Release Notes:

Details:

Tests:
ant clean build doc webapp.deploy
go to http://localhost:8080/paperpie/docs/reference/LzView.html
Notice that there's a list of several events, including onblur,
onclick, ondblclick, oncfocus, onx, ony, etc. (Not all of the
events declared in the 3.4 LzView reference are present yet, but
let's call that a content bug, not a tools bug.)



Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/core/LzNode.lzs
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/core/LzNode.lzs        
2007-11-12 04:45:30 UTC (rev 7211)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/core/LzNode.lzs        
2007-11-12 04:45:54 UTC (rev 7212)
@@ -261,22 +261,36 @@
 
 /** This event is sent right before a node becomes active --
   * e.g. before a view displays, or before a layout affects its subviews.
+  * @lzxtype event
   */
 var oninit = LzDeclaredEvent;
 
 /** This is the first event a node sends, right
   * at the end of the instantiation process, but before any subnodes
   * have been created or references resolved
+  * @lzxtype event
   */
 var onconstruct = LzDeclaredEvent;
 
 /** The ondata script is executed when the data selected by a view's datapath
   * changes.
+  * @lzxtype event  
   */
 var ondata = LzDeclaredEvent;
-/** If replicated, the index of this clone */
+/**
+  * If replicated, the index of this clone
+  * @lzxtype event
+  * @access private
+  */
 var clonenumber = null;
+/** 
+  * @access private 
+  * @lzxtype event
+  */ 
 var onclonenumber = LzDeclaredEvent;
+/** 
+  * @lzxtype event
+  */ 
 var ondestroy = LzDeclaredEvent;
 
 /** @access private */
@@ -314,6 +328,7 @@
   * children.
   *
   * @type Array
+  * @keywords readonly
   */
 var subnodes = null;
 
@@ -327,6 +342,7 @@
   *
   * @type String
   * @lzxtype string
+  * @keywords readonly
   */
 var datapath = null;
 
@@ -367,7 +383,7 @@
   * Its lexical parent is the tag that encloses it. Allow a null parent
   * so that nodes can be garbage collected when they are no longer needed.
   * See also, immediateparent.
-  * @modifiers readonly
+  * @keywords readonly
   */
 var parent;
 
@@ -377,6 +393,7 @@
 /** If this node is replicated due to data
   * replication, the LzReplicationManager which controls this node.
   * @type LzNode
+  * @keywords readonly
   */
 var cloneManager = null;
 
@@ -393,7 +410,7 @@
   * variable name in JavaScript code.
   *
   * @type String
-  * @lzxtype xsd:ID
+  * @lzxtype ID
   * @keywords final
   * @lzxtype token
   */
@@ -412,6 +429,7 @@
   * determinePlacement method.
   * @type String
   * @lzxtype token
+  * @keywords final
   */
 var defaultplacement = null;
 
@@ -437,9 +455,11 @@
   * to get a mouse position in your views coordinate system.
   *
   * @type LzNode
+  * @keywords readonly
   */
 var immediateparent = null;
 
+/** @access private */ 
 var dependencies = null;
 
 /** A reference to the node that is an instance
@@ -452,12 +472,13 @@
   * <code>parent.parent.parent.setAttribute(bgcolor, 0xFFFFFF)</code>
   * you can simply use <code>classroot.setAttribute(bgcolor, 0xFFFFFF)</code>.
   * @type LzNode
+  * @keywords readonly
   */
 var classroot;
 
 /** The depth of this node in the overall node hierarchy
   * @type Number
-  * @modifiers readonly
+  * @keywords readonly
   */
 var nodeLevel;
 
@@ -801,7 +822,8 @@
   * Overrides placement attribute (and defaultplacement in lexical parent). 
   * See the LzNode.determinePlacement method. Defaults to false.
   * @type Boolean
-  * @modifiers final
+  * @keywords final
+  * @lzxdefault "false"
   */
 var ignoreplacement;  
                                         

Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LaszloCanvas.lzs 
2007-11-12 04:45:30 UTC (rev 7211)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LaszloCanvas.lzs 
2007-11-12 04:45:54 UTC (rev 7212)
@@ -243,13 +243,18 @@
 
 var initdelay = 0;
 
-/** Sent whenever the number of created nodes changes */
+/** Sent whenever the number of created nodes changes 
+  * @lzxtype event
+  */
 var onpercentcreated = LzDeclaredEvent;
-/** Sent whenever the mouse button goes down*/
+/** Sent whenever the mouse button goes down
+  * @lzxtype event */
 var onmousedown = LzDeclaredEvent;
-/** Sent whenever the mouse button goes up*/
+/** Sent whenever the mouse button goes up
+  * @lzxtype event */
 var onmouseup = LzDeclaredEvent;
-/** Sent whenever the mouse moves */
+/** Sent whenever the mouse moves 
+  * @lzxtype event */
 var onmousemove = LzDeclaredEvent;
 
 /** version number of the LPS that generated this application (for .lzo files,

Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LaszloView.lzs
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LaszloView.lzs   
2007-11-12 04:45:30 UTC (rev 7211)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LaszloView.lzs   
2007-11-12 04:45:54 UTC (rev 7212)
@@ -78,35 +78,44 @@
   */
 static var tagname = 'view';
 
-/** Event called when this view adds a subview 
+/** Event called when this view adds a subview   
   * @access private
+  * @lzxtype event
   */
 var onaddsubview = LzDeclaredEvent;
 /** @access private */
 var onbgcolor = LzDeclaredEvent;
 /** The onblur script is executed when an element loses focus either
   * by the pointing device or by tabbing navigation.
+  * @lzxtype event
   */
 var onblur = LzDeclaredEvent;
 /** The onclick script is executed when the pointing device button is
   * clicked over an element.
+  * @lzxtype event  
   */
 var onclick = LzDeclaredEvent;
 /** @access private */
 var onclickable = LzDeclaredEvent;
 /** The onfocus script is executed when an element receives focus
   * either by the pointing device or by tabbing navigation.
+  * @lzxtype event  
   */
 var onfocus = LzDeclaredEvent;   // From LzFocus
+/** @lzxtype event */   
 var onframe = LzDeclaredEvent;
 
-/** Event for changes to view's <attribute>height</attribute> property */
+/** Event for changes to view's <attribute>height</attribute> property 
+  * @lzxtype event
+  */
 var onheight = LzDeclaredEvent;
+/** @lzxtype event */   
 var onimload = LzDeclaredEvent;
 
 /** The onkeyup script is executed when this view has the focus and a
   * key is released. This event is sent with the keycode for the key that 
   * went up.
+  * @lzxtype event
   */
 var onkeyup = LzDeclaredEvent;   // From LzFocus
 
@@ -115,85 +124,140 @@
   * key that is held down.  If you want the script executed only
   * once, use onkeyup. This event is sent with the keycode for the key that is
   * down.
+  * @lzxtype event
   */
 var onkeydown = LzDeclaredEvent; // From LzFocus
+/** @lzxtype event */
 var onlastframe = LzDeclaredEvent;
+/** @lzxtype event */
 var onload = LzDeclaredEvent;
+/** @lzxtype event */
 var onloadperc = LzDeclaredEvent;
 
 /** <event>onerror</event>: Sent when there is an error loading the view's 
resource.
   * The argument sent with the event is the error string sent by the server.
   * @access private
+  * @lzxtype event
   */
 var onerror = LzDeclaredEvent;
 
 /**
   * <event>ontimeout</event>: Sent when the request to load media for the view 
times
   * out
+  * @lzxtype event
   */
 var ontimeout = LzDeclaredEvent;
 /** The onmousedown script is executed when the pointing device button is
   * pressed over an element.
+  * @lzxtype event
   */
 var onmousedown = LzDeclaredEvent;
 
 /** The onmouseout script is executed when the point device is moved
   * so that is is no longer over an element.
+  * @lzxtype event
   */
 var onmouseout = LzDeclaredEvent;
+
 /** The onmouseover script is executed when the pointing device is
   * moved onto an element.
+  * @lzxtype event  
   */
 var onmouseover = LzDeclaredEvent;
-/** @access private */
+
+/** @access private 
+  * @lzxtype event 
+  */
 var onmousetrackover = LzDeclaredEvent;
-/** @access private */
+
+/** @access private 
+  * @lzxtype event 
+  */
 var onmousetrackup = LzDeclaredEvent;
 
 /** The onmouseup script is executed when the pointing device button is
   * released over an element.
+  * @lzxtype event
   */
 var onmouseup = LzDeclaredEvent;
-/** Sent when a view changes its opacity */
+
+/** 
+  * Sent when a view changes its opacity 
+  * @lzxtype event
+  */
 var onopacity = LzDeclaredEvent;
 
-/** @access private */
+/** @access private 
+  * @lzxtype event 
+  */
 var onplay = LzDeclaredEvent;
 
-/** Event called when this view removes a subview */
+/** 
+  * Event called when this view removes a subview 
+  * @lzxtype event
+  */ 
 var onremovesubview = LzDeclaredEvent;
 
-/** @access private */
+/** @access private 
+  * @lzxtype event 
+  */
 var onresource = LzDeclaredEvent;
-/** @access private */
+/** @access private 
+  * @lzxtype event 
+  */
 var onresourceheight = LzDeclaredEvent;
-/** @access private */
+/** @access private 
+  * @lzxtype event 
+  */
 var onresourcewidth = LzDeclaredEvent;
-/** @access private */
+/** @access private 
+  * @lzxtype event 
+  */
 var onrotation = LzDeclaredEvent;
-/** @access private */
+/** @access private 
+  * @lzxtype event 
+  */
 var onstop = LzDeclaredEvent;
-/** @access private */
+/** @access private 
+  * @lzxtype event 
+  */
 var ontotalframes = LzDeclaredEvent;
-/** @access private */
+/** @access private 
+  * @lzxtype event 
+  */
 var onunstretchedheight = LzDeclaredEvent;
-/** @access private */
+/** @access private 
+  * @lzxtype event 
+  */
 var onunstretchedwidth = LzDeclaredEvent;
+/** @lzxtype event */
 var onvisible = LzDeclaredEvent;
-/** @access private */
+/** @access private 
+  * @lzxtype event 
+  */
 var onvisibility = LzDeclaredEvent;
 
-/** event for changes to view's <attribute>width</attribute> property */
+/** event for changes to view's <attribute>width</attribute> property 
+ * @lzxtype event 
+ */
 var onwidth = LzDeclaredEvent;
 
-/** event for changes to view's <attribute>x</attribute> property */
+/** event for changes to view's <attribute>x</attribute> property 
+ * @lzxtype event
+ */
 var onx = LzDeclaredEvent;
-/** @access private */
+/** @access private 
+  * @lzxtype event 
+  */
 var onxoffset = LzDeclaredEvent;
 
-/** event for changes to view's <attribute>y</attribute> property */
+/** event for changes to view's <attribute>y</attribute> property 
+  * @lzxtype event
+  */
 var ony = LzDeclaredEvent;
-/** @access private */
+/** @access private 
+  * @lzxtype event 
+  */
 var onyoffset = LzDeclaredEvent;
 
 /**
@@ -206,6 +270,7 @@
   * ondblclick event, will simply send two click events.
   * The view's doubleclick time can be adjusted by setting its
   * DOUBLE_CLICK_TIME attribute
+  * @lzxtype event
   */
 var ondblclick = LzDeclaredEvent;
 /** @access private */
@@ -396,6 +461,13 @@
   * @access private
   */
 var source;
+/** 
+  * As a setter, this is private. It's not really a setter, because
+  * it talks to a private attribute, "source". 
+  * The method setSource, defined below, is public, but it's not
+  * a setter. [bshine 2007.11.07]
+  * @access private 
+  */ 
 setters.source = "setSource";
 /** The background color of the canvas. 
   * @lzxtype token
@@ -416,7 +488,7 @@
   */
 setters.clickable =  "setClickable";
 /** Setting clickRegion to a vector-based SWF turns the SWF shape into a 
clickable hotspot.
-  * @access private
+  * @access public
   * @lzxtype string
   */
 var clickregion;   
@@ -467,7 +539,9 @@
   * default for this property is "none". This is used to resize a
   * view's contents by setting its width and/or height.
   * @lzxtype "width" | "height" | "both"
+  * @lzxdefault "none"
   */
+var stretches = "none"; 
 setters.stretches =   "stretchResource";
 /** If true, the resource attached to this view begins playing when
   * the view is instantiated.

Modified: openlaszlo/branches/paperpie/docs/src/xsl/js2doc2dbk.xsl
===================================================================
--- openlaszlo/branches/paperpie/docs/src/xsl/js2doc2dbk.xsl    2007-11-12 
04:45:30 UTC (rev 7211)
+++ openlaszlo/branches/paperpie/docs/src/xsl/js2doc2dbk.xsl    2007-11-12 
04:45:54 UTC (rev 7212)
@@ -26,6 +26,8 @@
 <!ENTITY final          '(@modifiers="final" or @keywords="final")'>
 <!ENTITY unwritable     '(@modifiers="readonly" or @modifiers="read-only" or 
@keywords="read-only" or @keywords="readonly" or @modifiers="final" or 
@keywords="final")'>
 
+<!ENTITY isevent          '((doc/[EMAIL PROTECTED]"lzxtype"]/text) = "event" 
or @type="LzEvent")'>
+
 ]>
         
 <xsl:stylesheet version="1.0"
@@ -45,7 +47,7 @@
     <xsl:param name="show.members.attributes" select="true()" />
     <xsl:param name="show.properties.static" select="false()" />
     <xsl:param name="show.methods.static" select="false()" />  
-    <xsl:param name="show.events.static" select="false()" />
+    <xsl:param name="show.events.static" select="true()" />
     <xsl:param name="show.inherited.attributes" select="true()" />
     <xsl:param name="show.setters" select="false()" />    
     <xsl:param name="show.prototype.methods" select="true()" />
@@ -241,12 +243,13 @@
         <xsl:variable name="svars" select="&objectvalue;/[EMAIL 
PROTECTED]'setters']/object/property[&isvisible;]"/>
         <xsl:variable name="pvars" select="&objectvalue;/[EMAIL 
PROTECTED]'prototype']/object/property[&isvisible;]"/>
         <xsl:variable name="ovars" 
select="&objectvalue;/property[not(&privateslot;) and &isvisible;]"/>
-        <xsl:variable name="initargs" 
select="class/initarg[not(contains(@access, 'private'))]" />
+        <xsl:variable name="events" select="&objectvalue;/[EMAIL 
PROTECTED]'__ivars__']/object/property[doc/[EMAIL PROTECTED]'lzxtype']/text = 
'event' and &isvisible;]" />
+        <xsl:variable name="initargs" 
select="class/initarg[not(contains(@access, 'private'))]" />       
         
         <!-- Static Properties -->
         <xsl:if test="$show.properties.static">
           <xsl:call-template name="describe-members">
-            <xsl:with-param name="members" select="$ovars[not(child::function) 
and not(@type='LzEvent')]"/>
+            <xsl:with-param name="members" select="$ovars[not(child::function) 
and not(&isevent;)]"/>
             <xsl:with-param name="static" select="true()"/>
             <xsl:with-param name="title" select="'Static Properties'"/>
             <xsl:with-param name="initargs" select="$initargs" />
@@ -339,7 +342,7 @@
         <!-- (Prototype) Events -->
         <xsl:if test="$show.prototype.events">
           <xsl:call-template name="describe-events">
-            <xsl:with-param name="members" select="[EMAIL 
PROTECTED]'LzEvent']"/>
+            <xsl:with-param name="members" select="$events"/>
             <xsl:with-param name="title" select="'Events'"/>
           </xsl:call-template>
         </xsl:if>
@@ -544,6 +547,11 @@
       </refsect2>
     </xsl:if>
     
+    <xsl:if test="count($visible-members) = 0">
+      <refsect2><title>Events</title>
+        <para>(no events found)</para>
+      </refsect2>
+    </xsl:if>
     
   </xsl:template>
 
@@ -1087,7 +1095,7 @@
     <xsl:variable name="extends" select="$class/@extends"/>
     <xsl:variable name="superclass" select="(key('id',$extends) | 
key('name-lzx',$extends))[1]"/>
     <xsl:if test="$superclass">  
-      <xsl:variable name="inheritedevents" 
select="$superclass/class/property/object/[EMAIL PROTECTED]'LzEvent' and 
&ispublic;]"></xsl:variable>
+      <xsl:variable name="inheritedevents" select="$superclass/class/[EMAIL 
PROTECTED]'__ivars__']/object/property[doc/[EMAIL PROTECTED]'lzxtype']/text = 
'event' and &ispublic;]"></xsl:variable>
       <refsect2>
         <title>
           <xsl:text>Events inherited from&nbsp;</xsl:text>
@@ -1210,6 +1218,8 @@
       <xsl:apply-templates select="." mode="xref"/>
     </xsl:variable>
         
+    <!-- don't generate a term if this is an event -->
+    <xsl:if test="not(&isevent;)">
     <term id="[EMAIL PROTECTED]" xreflabel="{$xref}">
       <!-- how to get the indexterm to use a different name than xreflabel? -->
       <indexterm zone="[EMAIL PROTECTED]">
@@ -1221,7 +1231,8 @@
         </primary>
       </indexterm>
       <xsl:value-of select="$desc"/>
-    </term>    
+    </term>  
+    </xsl:if>
     <row>
       <xsl:if test="not (doc/text)">
         <xsl:attribute name="rowsep">0</xsl:attribute>
@@ -1249,14 +1260,16 @@
         -->
       <entry>
         <xsl:choose>
-          <xsl:when test="&final; and 
$isinstancevar">initialize-only</xsl:when>
+          <xsl:when test="&final; and ($isinstancevar or 
$isinitarg)">initialize-only</xsl:when>
           <xsl:when test="&readonly;">readonly</xsl:when>          
           <xsl:when test="not(&unwritable;) and 
$isinstancevar">read/write</xsl:when>
           <xsl:when test="not(&unwritable;) and not($isinstancevar) and 
not($issetter)">(FIXME: declare attribute (non-setter))</xsl:when>
           <xsl:when test="not(&unwritable;) and not($isinstancevar) and 
$issetter">(FIXME: declare attribute (setter))</xsl:when>          
           <xsl:otherwise>(FIXME: otherwise) <xsl:if 
test="&final;">final</xsl:if> <xsl:if 
test="&readonly;">readonly</xsl:if></xsl:otherwise>
         </xsl:choose>        
-        <xsl:if test="$isinitarg"> (FIXME: initarg) </xsl:if>                  
                   
+        <xsl:if test="&isevent;">
+          event
+        </xsl:if>
       </entry>
     </row>
     <xsl:if test="doc/text">  

Modified: openlaszlo/branches/paperpie/docs/src/xsl/simple-driver.xsl
===================================================================
--- openlaszlo/branches/paperpie/docs/src/xsl/simple-driver.xsl 2007-11-12 
04:45:30 UTC (rev 7211)
+++ openlaszlo/branches/paperpie/docs/src/xsl/simple-driver.xsl 2007-11-12 
04:45:54 UTC (rev 7212)
@@ -19,7 +19,7 @@
 <!ENTITY classvalue     '(class|function)'>
 <!ENTITY privateslot    '(@name="prototype" or @name="__ivars__" or 
@name="dependencies" or @name="setters" or @name="tagname")'>
 
-<!ENTITY isvisible      '(contains($visibility.filter, @access))'>
+<!ENTITY isvisible      '(contains("public", @access))'>
 
 <!ENTITY ispublic       '(@access="public")'>
 
@@ -42,10 +42,14 @@
         <xsl:variable name="setters" select="class/[EMAIL 
PROTECTED]'setters']/object/property[not(contains(@access, 'private'))]" />
         <xsl:variable name="instancevariables" select="class/[EMAIL 
PROTECTED]'__ivars__']/object/property[not(contains(@access, 'private'))]" />
         <xsl:variable name="initargs" 
select="class/initarg[not(contains(@access, 'private'))]" />
+        <xsl:variable name="events" select="class/[EMAIL 
PROTECTED]'__ivars__']/object/property[doc/[EMAIL PROTECTED]'lzxtype']/text = 
'event' and &isvisible;]" />        
         
         
         property with name <xsl:value-of select="$classname"/>
         
+        events: <xsl:for-each select="$events">
+            <xsl:value-of select="@name"/>,             
+        </xsl:for-each>        
             
         <!-- things that are both instancevariables and setters are read/write 
attributes -->
         <xsl:variable name="setters-names" select="$setters/@name" />


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to