Author: max
Date: 2007-09-06 22:18:41 -0700 (Thu, 06 Sep 2007)
New Revision: 6396
Added:
openlaszlo/branches/wafflecone/test/explicit-replicators/selection.lzx
Removed:
openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicatorselectionmanager.lzx
Modified:
openlaszlo/branches/wafflecone/WEB-INF/lps/misc/lzx-autoincludes.properties
openlaszlo/branches/wafflecone/lps/components/utils/replicator/lazyreplicator.lzx
openlaszlo/branches/wafflecone/lps/components/utils/replicator/library.lzx
openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicator.lzx
openlaszlo/branches/wafflecone/test/explicit-replicators/test-replicator.lzx
Log:
Change 20070906-maxcarlson-N by [EMAIL PROTECTED] on 2007-09-06 13:06:11 PDT
in /Users/maxcarlson/openlaszlo/waffleconeclean
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: UPDATED: Change explicit replicators to support (data)selectionmanager
New Features:
Bugs Fixed: LPP-4667 - replicatorselectionmanager: yet another replication
manager is confusing
Technical Reviewer: sallen
QA Reviewer: ptw
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: selection.lzx - add testcase for selection that doesn't use lists.
test-replicator.lzx - Change explicit replicators to use dataselectionmanager
and selectionmanager.
lzx-autoincludes.properties - Remove
utils/replicator/replicatorselectionmanager.lzx.
lazyreplicator.lzx - Add getCloneForNode() implementation similar to lazy
replication's.
library.lzx - Remove replicatorselectionmanager.
replicator.lzx - Reset selection state in bind(). Set cloneManager attribute
for backward compatibility with selection managers. Added implementation of
getCloneForNode() similar to replication manager's, which gets the clone for
the given datapath
replicatorselectionmanager.lzx - Buh-bye!
Tests: All permutations in selection.lzx work properly.
Modified:
openlaszlo/branches/wafflecone/WEB-INF/lps/misc/lzx-autoincludes.properties
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/misc/lzx-autoincludes.properties
2007-09-07 04:45:18 UTC (rev 6395)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/misc/lzx-autoincludes.properties
2007-09-07 05:18:41 UTC (rev 6396)
@@ -128,4 +128,3 @@
lazyreplicator: utils/replicator/lazyreplicator.lzx
replicator: utils/replicator/replicator.lzx
-replicatorselectionmanager: utils/replicator/replicatorselectionmanager.lzx
Modified:
openlaszlo/branches/wafflecone/lps/components/utils/replicator/lazyreplicator.lzx
===================================================================
---
openlaszlo/branches/wafflecone/lps/components/utils/replicator/lazyreplicator.lzx
2007-09-07 04:45:18 UTC (rev 6395)
+++
openlaszlo/branches/wafflecone/lps/components/utils/replicator/lazyreplicator.lzx
2007-09-07 05:18:41 UTC (rev 6396)
@@ -4,7 +4,7 @@
<!-- A replicator which creates as many clones as are necessary to fill in
a masked region, similar to the lazy replication option in OpenLaszlo. Also
similar to OL''s lazy replication, the lazyreplicator must have a clipped
- view as a parent. -->
+ view as a parent. Be sure to use a dataselectionmanager instead of a
selectionmanager for lazyreplicators.-->
<interface name="lazyreplicator" extends="replicator">
<!--- The size of the replicated clone in the replication axis -->
@@ -192,6 +192,28 @@
this.ensureInView( n );
return this.clones[ n-this.clonesoffset];
}
+
+ // @keywords private (override)
+ function getCloneForNode ( datanode , dontmake ){
+ var cl = super.getCloneForNode( datanode ) ||
+ null;
+ if ( !cl && !dontmake ){
+ //even though we're going to return this to the pool immediately,
+ //use the class API to get a clone
+ cl = this.getClone();
+ this.setData( cl, datanode );
+ this.update( cl, datanode );
+ if (v.datapath['sel'] != datanode['sel']) {
+ v.datapath['sel'] = datanode['sel'] || false;
+ v.setSelected(v.datapath['sel']);
+ }
+ if (cl['applyData']) cl.applyData( datanode );
+ this.poolClone( cl );
+ }
+
+ return cl;
+
+ }
}
]]>
Modified:
openlaszlo/branches/wafflecone/lps/components/utils/replicator/library.lzx
===================================================================
--- openlaszlo/branches/wafflecone/lps/components/utils/replicator/library.lzx
2007-09-07 04:45:18 UTC (rev 6395)
+++ openlaszlo/branches/wafflecone/lps/components/utils/replicator/library.lzx
2007-09-07 05:18:41 UTC (rev 6396)
@@ -2,5 +2,4 @@
<library>
<include href="replicator.lzx"/>
<include href="lazyreplicator.lzx"/>
- <include href="replicatorselectionmanager.lzx"/>
</library>
Modified:
openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicator.lzx
===================================================================
---
openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicator.lzx
2007-09-07 04:45:18 UTC (rev 6395)
+++
openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicator.lzx
2007-09-07 05:18:41 UTC (rev 6396)
@@ -198,6 +198,11 @@
v.setAttribute( "clonenumber" , n );
this.setData( v , n );
this.update( v , n );
+ var datanode = this.nodes[n];
+ if (v.datapath['sel'] != datanode['sel']) {
+ v.datapath['sel'] = datanode['sel'] || false;
+ v.setSelected(v.datapath['sel']);
+ }
if ( this._cloneprops[ n ] ) {
var p = this._cloneprops[ n ];
for ( var k in p ){
@@ -255,6 +260,8 @@
function _makeClone () {
var v = this.container.makeChild( this.replicated );
v.setAttribute( "clonenumber", null );
+ // emulate datapath behavior
+ v.setAttribute( "cloneManager", this );
return v;
}
@@ -312,6 +319,17 @@
return this.clones[ n ];
}
+ // Gets the clone for the given datanode
+ // @param LzDataNode datanode: The datanode of the clone to get
+ function getCloneForNode (datanode) {
+ var l = this.clones.length;
+ for ( var i = 0; i < l; i++ ){
+ if ( this.clones[ i ].datapath.p == datanode ){
+ return this.clones[ i ];
+ }
+ }
+ }
+
// Ensures that the clone at the given offset is visible under
// the mask
// @param Number n: The offset of the clone to scroll in view
Deleted:
openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicatorselectionmanager.lzx
Added: openlaszlo/branches/wafflecone/test/explicit-replicators/selection.lzx
Property changes on:
openlaszlo/branches/wafflecone/test/explicit-replicators/selection.lzx
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified:
openlaszlo/branches/wafflecone/test/explicit-replicators/test-replicator.lzx
===================================================================
---
openlaszlo/branches/wafflecone/test/explicit-replicators/test-replicator.lzx
2007-09-07 04:45:18 UTC (rev 6395)
+++
openlaszlo/branches/wafflecone/test/explicit-replicators/test-replicator.lzx
2007-09-07 05:18:41 UTC (rev 6396)
@@ -41,7 +41,7 @@
<window width="20%" height="20%" x="5%" y="5%" name="explicitlazyrepltest"
resizable="true" title="explicit lazy replicator">
<list width="${immediateparent.width}" height="${immediateparent.height}">
- <replicatorselectionmanager name="selman" />
+ <dataselectionmanager name="selman" id="dsel"/>
<lazyreplicator id="elr" dataset="testdata" xpath="'fibs/fib'">
<text width="100">
<attribute name="selected" value="false"/>
@@ -56,6 +56,10 @@
Debug.write(parent.selman.isSelected( this ),
parent.selman.toggle);
parent.selman.select( this );
</handler>
+ <method name="setSelected" args="value">
+ this.selected = value;
+ this.onselected.sendEvent(value);
+ </method>
</text>
</lazyreplicator>
<!-- FIXME: [2007-08-10 ptw] (LPP-4484) -->
@@ -66,7 +70,7 @@
<window width="20%" height="20%" x="30%" y="5%" name="implicitlazyrepltest"
resizable="true" title="implicit lazy replicator">
<list width="${immediateparent.width}" height="${immediateparent.height}" >
- <selectionmanager name="selman" />
+ <dataselectionmanager name="selman" id="dsel2"/>
<text width="100" id="ilr">
<datapath xpath="testdata:/fibs/fib" replication="lazy" />
<attribute name="selected" value="false"/>
@@ -92,7 +96,7 @@
<window width="20%" height="20%" x="5%" y="50%" name="explicitsimplerepltest"
resizable="true" title="explicit replicator">
<list width="${immediateparent.width}" height="${immediateparent.height}">
- <replicatorselectionmanager name="selman" />
+ <selectionmanager name="selman" />
<simplelayout axis="y" spacing="0" />
<replicator id="esr" dataset="testdata" xpath="'/fibs/fib'">
<text width="100">
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins