You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by jm...@apache.org on 2006/11/30 02:00:13 UTC
svn commit: r480803 - in /incubator/xap/trunk: WebContent/
WebContent/examples/dataBinding/ WebContent/examples/demo/
WebContent/examples/urlResolution/
WebContent/examples/urlResolution/xmodify/ WebContent/examples/widgets/
src/xap/bridges/xap/ src/xa...
Author: jmargaris
Date: Wed Nov 29 18:00:10 2006
New Revision: 480803
URL: http://svn.apache.org/viewvc?view=rev&rev=480803
Log:
renamed image attributes and cleaned up some things
Removed:
incubator/xap/trunk/src/xap/taghandling/AttributeConversionException
incubator/xap/trunk/src/xap/taghandling/AttributeConversionException.js
Modified:
incubator/xap/trunk/WebContent/XapConfig.js
incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.xal
incubator/xap/trunk/WebContent/examples/demo/table.xal
incubator/xap/trunk/WebContent/examples/urlResolution/label.xal
incubator/xap/trunk/WebContent/examples/urlResolution/xmodify/xmodify.xm
incubator/xap/trunk/WebContent/examples/urlResolution/xmodify/xmodify2.xm
incubator/xap/trunk/WebContent/examples/widgets/borderPane.html
incubator/xap/trunk/WebContent/examples/widgets/borderPane.xal
incubator/xap/trunk/WebContent/examples/widgets/button.xal
incubator/xap/trunk/WebContent/examples/widgets/checkBox.xal
incubator/xap/trunk/WebContent/examples/widgets/label.xal
incubator/xap/trunk/WebContent/examples/widgets/radioButton.xal
incubator/xap/trunk/src/xap/bridges/xap/ButtonBridge.js
incubator/xap/trunk/src/xap/bridges/xap/LabelBridge.js
incubator/xap/trunk/src/xap/bridges/xap/RadioButtonBridge.js
incubator/xap/trunk/src/xap/data/bridge/DataAttributeConverter.js
incubator/xap/trunk/src/xap/taghandling/AbstractTagImpl.js
incubator/xap/trunk/src/xap/taghandling/AttributeConverter.js
incubator/xap/trunk/src/xap/xml/XalNamespaceHandler.js
incubator/xap/trunk/src/xap/xml/XmlTokens.js
Modified: incubator/xap/trunk/WebContent/XapConfig.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/XapConfig.js?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/WebContent/XapConfig.js (original)
+++ incubator/xap/trunk/WebContent/XapConfig.js Wed Nov 29 18:00:10 2006
@@ -90,5 +90,5 @@
*
* Accepted Values: can be null, undefined, or true / false.
*/
- logging: false
+ logging: true
}
Modified: incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.xal?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.xal (original)
+++ incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.xal Wed Nov 29 18:00:10 2006
@@ -58,7 +58,7 @@
text="select="#this.second()" "
/>
- <xal:label img="plus.gif" x="270px" width="25px" y="50px" height="40px" alignHorizontal="left"/>
+ <xal:label image="plus.gif" x="270px" width="25px" y="50px" height="40px" alignHorizontal="left"/>
<xal:label
y="50px"
@@ -73,7 +73,7 @@
text="Employees.second()=return "Second slot: "+Employees.array[1]+"." ;"
/>
- <xal:label img="rarrow.gif" x="740px" width="35px" y="50px" height="40px" alignHorizontal="center" />
+ <xal:label image="rarrow.gif" x="740px" width="35px" y="50px" height="40px" alignHorizontal="center" />
<xal:label
y="50px"
Modified: incubator/xap/trunk/WebContent/examples/demo/table.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/demo/table.xal?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/WebContent/examples/demo/table.xal (original)
+++ incubator/xap/trunk/WebContent/examples/demo/table.xal Wed Nov 29 18:00:10 2006
@@ -7,7 +7,7 @@
<verticalBoxPane backgroundColor="#EEE" align="stretch" width="800px" height="600px" fontSize="11px" fontFamily="Arial">
<label width="20px" height="20px"/>
- <label img="images/logo.gif"/>
+ <label image="images/logo.gif"/>
<label width="20px" height="20px"/>
@@ -109,7 +109,7 @@
<cell text="AA"/>
<cell text="Alcoa"/>
<label text="41.02" backgroundColor="#CCF"/>
- <label text="3.51" color="red" img="images/down.gif" />
+ <label text="3.51" color="red" image="images/down.gif" />
<cell text="40.49"/>
<cell text="40.43"/>
<cell text="50.98"/>
@@ -121,7 +121,7 @@
<cell text="GE"/>
<cell text="General Electric"/>
<label text="41.02" backgroundColor="#CFC"/>
- <label text="-3.51" color="green" img="images/up.gif" />
+ <label text="-3.51" color="green" image="images/up.gif" />
<cell text="40.49"/>
<cell text="40.43"/>
<cell text="50.98"/>
@@ -133,7 +133,7 @@
<cell text="GM"/>
<cell text="General Motors"/>
<label text="41.02" backgroundColor="#FCC"/>
- <label text="-3.51" color="red" img="images/down.gif" />
+ <label text="-3.51" color="red" image="images/down.gif" />
<cell text="40.49"/>
<cell text="40.43"/>
<cell text="50.98"/>
@@ -147,7 +147,7 @@
<cell text="GOOG"/>
<cell text="Google"/>
<label text="41.02" backgroundColor="#FCC"/>
- <label text="-3.51" color="red" img="images/down.gif" />
+ <label text="-3.51" color="red" image="images/down.gif" />
<cell text="40.49"/>
<cell text="40.43"/>
<cell text="50.98"/>
@@ -159,7 +159,7 @@
<cell text="HD"/>
<cell text="Home Depot"/>
<label text="41.02" backgroundColor="#CCF"/>
- <label text="3.51" color="red" img="images/down.gif" />
+ <label text="3.51" color="red" image="images/down.gif" />
<cell text="40.49"/>
<cell text="40.43"/>
<cell text="50.98"/>
@@ -171,7 +171,7 @@
<cell text="IBM"/>
<cell text="IBM"/>
<label text="41.02" backgroundColor="#CFC"/>
- <label text="-3.51" color="green" img="images/up.gif" />
+ <label text="-3.51" color="green" image="images/up.gif" />
<cell text="40.49"/>
<cell text="40.43"/>
<cell text="50.98"/>
@@ -183,7 +183,7 @@
<cell text="MSFT"/>
<cell text="Microsoft"/>
<label text="41.02" backgroundColor="#FCC"/>
- <label text="-3.51" color="red" img="images/down.gif" />
+ <label text="-3.51" color="red" image="images/down.gif" />
<cell text="40.49"/>
<cell text="40.43"/>
<cell text="50.98"/>
@@ -197,7 +197,7 @@
<cell text="YHOO"/>
<cell text="Yahoo!"/>
<label text="41.02" backgroundColor="#FCC"/>
- <label text="-3.51" color="red" img="images/down.gif" />
+ <label text="-3.51" color="red" image="images/down.gif" />
<cell text="40.49"/>
<cell text="40.43"/>
<cell text="50.98"/>
Modified: incubator/xap/trunk/WebContent/examples/urlResolution/label.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/urlResolution/label.xal?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/WebContent/examples/urlResolution/label.xal (original)
+++ incubator/xap/trunk/WebContent/examples/urlResolution/label.xal Wed Nov 29 18:00:10 2006
@@ -6,7 +6,7 @@
you should see the label change images and also a new label with
the same changed image, along with another button to re-call that same page"/>
<label id="testComponent" width="400px" height="100px" alignHorizontal="center" alignVertical="top"
- text="MY PRECIOUS LABEL" img="images/foreground.JPG"/>
+ text="MY PRECIOUS LABEL" image="images/foreground.JPG"/>
<button text="Press this first" onCommand="xmodify/xmodify.xm"/>
</verticalBoxPane>
Modified: incubator/xap/trunk/WebContent/examples/urlResolution/xmodify/xmodify.xm
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/urlResolution/xmodify/xmodify.xm?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/WebContent/examples/urlResolution/xmodify/xmodify.xm (original)
+++ incubator/xap/trunk/WebContent/examples/urlResolution/xmodify/xmodify.xm Wed Nov 29 18:00:10 2006
@@ -1,14 +1,14 @@
<xal xmlns="http://openxal.org/ui" xmlns:xal="http://openxal.org/ui">
<xm:modifications xmlns:xm="http://openxal.org/core/xmodify">
<xm:append select="id('panel')">
- <label img="../images/background.JPG" />
+ <label image="../images/background.JPG" />
<button text="Press this second" onCommand="xmodify2.xm"/>
</xm:append>
</xm:modifications>
<xm:modifications xmlns:xm="http://openxal.org/core/xmodify">
<xm:set-attribute select="id('testComponent')">
- <attribute name="img" value="../images/background.JPG"/>
+ <attribute name="image" value="../images/background.JPG"/>
</xm:set-attribute>
</xm:modifications>
</xal>
Modified: incubator/xap/trunk/WebContent/examples/urlResolution/xmodify/xmodify2.xm
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/urlResolution/xmodify/xmodify2.xm?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/WebContent/examples/urlResolution/xmodify/xmodify2.xm (original)
+++ incubator/xap/trunk/WebContent/examples/urlResolution/xmodify/xmodify2.xm Wed Nov 29 18:00:10 2006
@@ -1,14 +1,14 @@
<xal xmlns="http://openxal.org/ui" xmlns:xal="http://openxal.org/ui">
<xm:modifications xmlns:xm="http://openxal.org/core/xmodify">
<xm:append select="id('panel')">
- <label img="../images/foreground.JPG" />
+ <label image="../images/foreground.JPG" />
<button text="Press to call xmodify statement" onCommand="xmodify.xm"/>
</xm:append>
</xm:modifications>
<xm:modifications xmlns:xm="http://openxal.org/core/xmodify">
<xm:set-attribute select="id('testComponent')">
- <attribute name="img" value="../images/foreground.JPG"/>
+ <attribute name="image" value="../images/foreground.JPG"/>
</xm:set-attribute>
</xm:modifications>
</xal>
Modified: incubator/xap/trunk/WebContent/examples/widgets/borderPane.html
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/borderPane.html?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/borderPane.html (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/borderPane.html Wed Nov 29 18:00:10 2006
@@ -23,6 +23,6 @@
</head>
<body onload="Xap.createEmbeddedApplications();">
- <div startPage="borderPane.xal"></div>
+ <div style="width:100%; height:100%" startPage="borderPane.xal"></div>
</body>
</html>
Modified: incubator/xap/trunk/WebContent/examples/widgets/borderPane.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/borderPane.xal?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/borderPane.xal (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/borderPane.xal Wed Nov 29 18:00:10 2006
@@ -1,16 +1,15 @@
-<xal xmlns="http://openxal.org/ui" xmlns:xal="http://openxal.org/ui">
+<xal xmlns="http://openxal.org/ui" xmlns:mco="http://openxal.org/core/mco" xmlns:xal="http://openxal.org/ui">
<mco:mco
- xmlns:mco="http://openxal.org/core/mco"
id="attributeSetter"
src="AttributeTester"
+ onLoad="javascript:alert('called onload from mco')"
/>
-
-
- <xm:modifications xmlns:xm="http://openxal.org/core/xmodify">
- <xm:append select="/ui">
+ <mco:execute>javascript:alert('called execute')</mco:execute>
+
+ <rootPane backgroundColor="green" borderColor="red" borderStyle="solid" borderWidth="10px">
<horizontalBoxPane>
@@ -100,6 +99,5 @@
</xal:freePane>
</xal:borderPane>
</horizontalBoxPane>
- </xm:append>
- </xm:modifications>
+ </rootPane>
</xal>
Modified: incubator/xap/trunk/WebContent/examples/widgets/button.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/button.xal?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/button.xal (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/button.xal Wed Nov 29 18:00:10 2006
@@ -57,13 +57,13 @@
onCommand="mco:attributeSetter.setAttribute(testComponent, 'autoWrap', 'false')" />
<button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set background image"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgBackground', '../background.JPG')" />
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'backgroundImage', '../background.JPG')" />
<button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set image"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'img', '../foreground.JPG')" />
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'image', '../foreground.JPG')" />
<button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set disabled image"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgDisabled', '../foreground_disabled.JPG')" />
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'disabledImage', '../foreground_disabled.JPG')" />
<button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set disabled = true"
onCommand="mco:attributeSetter.setAttribute(testComponent, 'disabled', 'true')" />
@@ -72,10 +72,10 @@
onCommand="mco:attributeSetter.setAttribute(testComponent, 'disabled', 'false')" />
<button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set image width = 50"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgWidth', '50')" />
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'imageWidth', '50')" />
<button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set image height = 20"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgHeight', '20')" />
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'imageHeight', '20')" />
<button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="selectable = true"
onCommand="mco:attributeSetter.setAttribute(testComponent, 'selectable', 'true')" />
@@ -90,10 +90,10 @@
onCommand="mco:attributeSetter.setAttribute(testComponent, 'richText', 'false')" />
<button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set image over"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgOver', '../background.JPG')" />
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'mouseOverImage', '../background.JPG')" />
<button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set image pressed"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgPressed', '../background.JPG')" />
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'pressedImage', '../background.JPG')" />
<!-- button specific properties -->
<button width="200px" height="25px"
Modified: incubator/xap/trunk/WebContent/examples/widgets/checkBox.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/checkBox.xal?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/checkBox.xal (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/checkBox.xal Wed Nov 29 18:00:10 2006
@@ -63,23 +63,23 @@
<button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="richText = true"
onCommand="mco:attributeSetter.setAttribute(testComponent, 'richText', 'true')" />
- <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set img over"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgOver', '../background.JPG')" />
+ <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set image over"
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'mouseOverImage', '../background.JPG')" />
- <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set img over selected"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgOverSelected', '../background.JPG')" />
+ <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set image over selected"
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'mouseOverSelectedImage', '../background.JPG')" />
- <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set img pressed selected"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgPressedSelected', '../background.JPG')" />
+ <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set image pressed selected"
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'pressedSelectedImage', '../background.JPG')" />
- <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set img pressed"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgPressed', '../background.JPG')" />
+ <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set image pressed"
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'pressedImage', '../background.JPG')" />
- <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set img selected"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgSelected', '../background.JPG')" />
+ <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set image selected"
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'selectedImage', '../background.JPG')" />
- <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set img"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'img', '../background.JPG')" />
+ <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set image"
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'image', '../background.JPG')" />
<button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="richText = true"
onCommand="mco:attributeSetter.setAttribute(testComponent, 'richText', 'true')" />
Modified: incubator/xap/trunk/WebContent/examples/widgets/label.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/label.xal?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/label.xal (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/label.xal Wed Nov 29 18:00:10 2006
@@ -57,13 +57,13 @@
onCommand="mco:attributeSetter.setAttribute(testComponent, 'autoWrap', 'false')" />
<button width="200px" height="50px" text="set background image"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgBackground', '../background.JPG')" />
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'backgroundImage', '../background.JPG')" />
<button width="200px" height="50px" text="set image"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'img', '../foreground.JPG')" />
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'image', '../foreground.JPG')" />
<button width="200px" height="50px" text="set disabled image"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgDisabled', '../foreground_disabled.JPG')" />
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'disabledImage', '../foreground_disabled.JPG')" />
<button width="200px" height="50px" text="set disabled = true"
onCommand="mco:attributeSetter.setAttribute(testComponent, 'disabled', 'true')" />
@@ -72,10 +72,10 @@
onCommand="mco:attributeSetter.setAttribute(testComponent, 'disabled', 'false')" />
<button width="200px" height="50px" text="set image width = 50"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgWidth', '50')" />
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'imageWidth', '50')" />
<button width="200px" height="50px" text="set image height = 20"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgHeight', '20')" />
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'imageHeight', '20')" />
<button width="200px" height="50px" text="selectable = true"
onCommand="mco:attributeSetter.setAttribute(testComponent, 'selectable', 'true')" />
Modified: incubator/xap/trunk/WebContent/examples/widgets/radioButton.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/radioButton.xal?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/radioButton.xal (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/radioButton.xal Wed Nov 29 18:00:10 2006
@@ -68,23 +68,23 @@
onCommand="mco:attributeSetter.setAttribute(testComponent, 'alignVertical', 'bottom')" />
- <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set img over"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgOver', '../background.JPG')" />
+ <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set image over"
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'mouseOverImage', '../background.JPG')" />
- <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set img over selected"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgOverSelected', '../background.JPG')" />
+ <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set image over selected"
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'mouseOverSelectedImage', '../background.JPG')" />
- <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set img pressed selected"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgPressedSelected', '../background.JPG')" />
+ <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set image pressed selected"
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'pressedSelectedImage', '../background.JPG')" />
- <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set img pressed"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgPressed', '../background.JPG')" />
+ <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set image pressed"
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'pressedImage', '../background.JPG')" />
- <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set img selected"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'imgSelected', '../background.JPG')" />
+ <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set image selected"
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'selectedImage', '../background.JPG')" />
- <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set img"
- onCommand="mco:attributeSetter.setAttribute(testComponent, 'img', '../background.JPG')" />
+ <button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="set image"
+ onCommand="mco:attributeSetter.setAttribute(testComponent, 'image', '../background.JPG')" />
<button width="200px" height="50px" alignHorizontal="center" alignVertical="center" text="richText = true"
onCommand="mco:attributeSetter.setAttribute(testComponent, 'richText', 'true')" />
Modified: incubator/xap/trunk/src/xap/bridges/xap/ButtonBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/xap/ButtonBridge.js?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/xap/ButtonBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/xap/ButtonBridge.js Wed Nov 29 18:00:10 2006
@@ -45,13 +45,13 @@
xap.bridges.xap.ButtonBridge.prototype.getNewAllowedAttributes = function() {
- return ["imgOver", "imgPressed"];
+ return ["mouseOverImage", "pressedImage"];
}
-xap.bridges.xap.ButtonBridge.prototype.setImgOverAttribute = function(imgOverURL) {
+xap.bridges.xap.ButtonBridge.prototype.setMouseOverImageAttribute = function(imgOverURL) {
this.getPeer().setImgOver(imgOverURL);
}
-xap.bridges.xap.ButtonBridge.prototype.setImgPressedAttribute = function(imgPressedURL) {
+xap.bridges.xap.ButtonBridge.prototype.setPressedImageAttribute = function(imgPressedURL) {
this.getPeer().setImgPressed(imgPressedURL);
}
Modified: incubator/xap/trunk/src/xap/bridges/xap/LabelBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/xap/LabelBridge.js?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/xap/LabelBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/xap/LabelBridge.js Wed Nov 29 18:00:10 2006
@@ -34,8 +34,8 @@
}
xap.bridges.xap.LabelBridge.prototype.getNewAllowedAttributes = function() {
- return ["alignHorizontal", "alignVertical", "autoWrap", "img",
- "imgBackground", "imgDisabled", "imgHeight", "imgWidth", "richText",
+ return ["alignHorizontal", "alignVertical", "autoWrap", "image",
+ "backgroundImage", "disabledImage", "imageHeight", "imageWidth", "richText",
"selectable", "text", "textPlacementHorizontal", "textPlacementVertical"];
}
@@ -62,24 +62,24 @@
this.getPeer().setEnabled(szEnabled);
}
-xap.bridges.xap.LabelBridge.prototype.setImgAttribute = function(imgURL) {
- var newUrl = this.getElement().getAttributeAsUrl("img");
+xap.bridges.xap.LabelBridge.prototype.setImageAttribute = function(imgURL) {
+ var newUrl = this.getElement().getAttributeAsUrl("image");
this.getPeer().setImg(newUrl);
}
-xap.bridges.xap.LabelBridge.prototype.setImgBackgroundAttribute = function(imgURL) {
+xap.bridges.xap.LabelBridge.prototype.setBackgroundImageAttribute = function(imgURL) {
this.getPeer().setImgBackground(imgURL);
}
-xap.bridges.xap.LabelBridge.prototype.setImgDisabledAttribute = function(disabled) {
+xap.bridges.xap.LabelBridge.prototype.setDisabledImageAttribute = function(disabled) {
this.getPeer().setImgDisabled(disabled);
}
-xap.bridges.xap.LabelBridge.prototype.setImgHeightAttribute = function(imgHeight) {
+xap.bridges.xap.LabelBridge.prototype.setImageHeightAttribute = function(imgHeight) {
this.getPeer().setImgHeight(imgHeight);
}
-xap.bridges.xap.LabelBridge.prototype.setImgWidthAttribute = function(imgWidth) {
+xap.bridges.xap.LabelBridge.prototype.setImageWidthAttribute = function(imgWidth) {
this.getPeer().setImgWidth(imgWidth);
}
Modified: incubator/xap/trunk/src/xap/bridges/xap/RadioButtonBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/xap/RadioButtonBridge.js?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/xap/RadioButtonBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/xap/RadioButtonBridge.js Wed Nov 29 18:00:10 2006
@@ -113,18 +113,18 @@
}
xap.bridges.xap.RadioButtonBridge.prototype.getNewAllowedAttributes = function() {
- return ["imgOverSelected", "imgPressedSelected", "imgSelected", "selected"];
+ return ["mouseOverSelectedImage", "pressedSelectedImage", "selectedImage", "selected"];
}
-xap.bridges.xap.RadioButtonBridge.prototype.setImgOverSelectedAttribute = function(imgOverSelectedURL) {
+xap.bridges.xap.RadioButtonBridge.prototype.setMouseOverSelectedImageAttribute = function(imgOverSelectedURL) {
this.getPeer().setImgOverSelected(imgOverSelectedURL);
}
-xap.bridges.xap.RadioButtonBridge.prototype.setImgPressedSelectedAttribute = function(imgPressedSelectedURL) {
+xap.bridges.xap.RadioButtonBridge.prototype.setPressedSelectedImageAttribute = function(imgPressedSelectedURL) {
this.getPeer().setImgPressedSelected(imgPressedSelectedURL);
}
-xap.bridges.xap.RadioButtonBridge.prototype.setImgSelectedAttribute = function(imgSelectedURL) {
+xap.bridges.xap.RadioButtonBridge.prototype.setSelectedImageAttribute = function(imgSelectedURL) {
this.getPeer().setImgSelected(imgSelectedURL);
}
Modified: incubator/xap/trunk/src/xap/data/bridge/DataAttributeConverter.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/data/bridge/DataAttributeConverter.js?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/src/xap/data/bridge/DataAttributeConverter.js (original)
+++ incubator/xap/trunk/src/xap/data/bridge/DataAttributeConverter.js Wed Nov 29 18:00:10 2006
@@ -27,12 +27,6 @@
xap.data.bridge.DataAttributeConverter = function(){
} ;
-
-
-
-
-// Only static methods, no subclasses, so no need here:
-//Xap.setupClassAsSubclassOf("xap.data.bridge.DataAttributeConverter", "xap.taghandling.AttributeConverter");
/**
* @public
* @return {xap.data.controller.BindingType}
Modified: incubator/xap/trunk/src/xap/taghandling/AbstractTagImpl.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/taghandling/AbstractTagImpl.js?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/src/xap/taghandling/AbstractTagImpl.js (original)
+++ incubator/xap/trunk/src/xap/taghandling/AbstractTagImpl.js Wed Nov 29 18:00:10 2006
@@ -684,58 +684,6 @@
}
-
-// /**
-// * Generate a new full url string value if the attribute value
-// * can be properly qualified into an http, https, or classpath
-// * URL, otherwise returns null.
-// *
-// * @param attributeName The name of the attribute to qualify
-// * @param attributeValue The value of the attribute to qualify
-// * @return A qualified URL or null if it was not qualifiable
-// */
-// public static String qualifyToFullUrl( String attributeName, String attributeValue,
-// xap.taghandling.AbstractTagImpl tagHandler ) {
-//
-// //if it's an object event we shouldn't qualify it!
-// if ( ((ClientSessionImpl)tagHandler.getSession()).getEventHandler().
-// qualifyObjectUrl(attributeValue)!=null){
-// return null;
-// }
-//
-// if (attributeValue.startsWith(EventHandler.CLASSPATH_PREFIX)){
-// return null;
-// }
-//
-// // little optimization
-// if ( attributeName == xap.xml.XmlTokens.ID || attributeName == XmlTokens.TEXT ) return null;
-//
-// if ( UrlPathUtil.isFullyFormattedUrl(attributeValue)) return null;
-//
-// for ( int i = 0; i<XmlTokens.ON_EVENT_NAMES.length; i++){
-// if ( XmlTokens.ON_EVENT_NAMES[i] == attributeName ){
-// try {
-// return tagHandler.createQualifiedUrlAsString(attributeValue);
-// } catch (MalformedURLException e) {
-// e.printStackTrace();
-// }
-// }
-// }
-//
-// for ( int i = 0; i<IMG_TAG_NAMES.length; i++){
-// if ( IMG_TAG_NAMES[i] == attributeName ){
-// try {
-// return tagHandler.createQualifiedUrlAsString(attributeValue);
-// } catch (MalformedURLException e) {
-// e.printStackTrace();
-// }
-// }
-// }
-//
-// return null;
-// }
-//
-
//
//
// private void writeBackRemoveChild(int index){
Modified: incubator/xap/trunk/src/xap/taghandling/AttributeConverter.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/taghandling/AttributeConverter.js?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/src/xap/taghandling/AttributeConverter.js (original)
+++ incubator/xap/trunk/src/xap/taghandling/AttributeConverter.js Wed Nov 29 18:00:10 2006
@@ -17,16 +17,9 @@
Xap.provide("xap.taghandling.AttributeConverter") ;
-Xap.require("xap.session.ClientSession");
-//Xap.require("xap.xml.XmlTokens") ;
-//Xap.require("xap.bridges.GradientBridge") ;
-//Xap.require("xap.component.NPanel") ;
-//Xap.require("xap.stylesheet.Style") ;
-Xap.require("xap.xml.dom.Document");
+Xap.require("xap.util.Exception");
+
-//Xap.require("xap.xml.DocumentRegistry") ;
-Xap.require("xap.xml.DocumentContainer");
-Xap.require("xap.xml.dom.XapElement");
/**
*
* A helper class for converting Strings (usually attributes)
@@ -34,456 +27,16 @@
* to convert attributes into the property data types, typically
* in the attributeSet() method.
*
+ * A lot of things like cursor, width, etc we just pass through without
+ * checking for speed reasons.
+ *
* @author James Margaris
- * @author Stan
*
*/
xap.taghandling.AttributeConverter = function () {
};
-Xap.setupClassAsSubclassOf("xap.taghandling.AttributeConverter", "Object");
-/**
- * Indicates that a value is not set. This can be useful
- * for tracking things like "fontBold", which can be set to true
- * or false or not set, which maked in inherit the style
- * from the parent.
- *public static final int*/
-xap.taghandling.AttributeConverter.NOT_SET = null;
-/**
- * Indicates that a value is set to false.
- *public static final int*/
-xap.taghandling.AttributeConverter.FALSE = 0;
-/**
- * Indicates that a value is set to true.
- *public static final int*/
-xap.taghandling.AttributeConverter.TRUE = 1;
-/*private static final Color[]*/
-xap.taghandling.AttributeConverter.s_colorValues = [];
-// TODO: Add these?
-// Color.black, Color.blue, Color.cyan,
-// Color.darkGray, Color.gray, Color.green,
-// Color.lightGray, Color.magenta, Color.orange,
-// Color.pink, Color.red, Color.white,
-// Color.yellow, SystemColor.activeCaptionBorder, SystemColor.activeCaption,
-// SystemColor.control, SystemColor.activeCaptionText, SystemColor.inactiveCaptionBorder,
-// SystemColor.inactiveCaptionText, SystemColor.controlHighlight, SystemColor.infoText,
-// SystemColor.info, SystemColor.menu, SystemColor.menuText,
-// SystemColor.controlDkShadow, SystemColor.desktop, SystemColor.scrollbar,
-// SystemColor.textHighlightText, SystemColor.textHighlight, SystemColor.window,
-// SystemColor.windowText, SystemColor.controlShadow,SystemColor.inactiveCaption
-/*private static final int[]*/
-xap.taghandling.AttributeConverter.s_cursorConstants = [];
-// TODO: Add these?
-// Cursor.HAND_CURSOR, Cursor.CROSSHAIR_CURSOR, Cursor.E_RESIZE_CURSOR,
-// Cursor.W_RESIZE_CURSOR, Cursor.S_RESIZE_CURSOR, Cursor.N_RESIZE_CURSOR,
-// Cursor.NE_RESIZE_CURSOR, Cursor.NW_RESIZE_CURSOR, Cursor.SE_RESIZE_CURSOR,
-// Cursor.SW_RESIZE_CURSOR, Cursor.TEXT_CURSOR, Cursor.MOVE_CURSOR,
-// Cursor.DEFAULT_CURSOR, Cursor.WAIT_CURSOR
-/**
- * Converts the string to a java.awt.Cursor.
- * @param s The name of a cursor.
- * @return A Cursor.
- * @throws xap.taghandling.AttributeConversionException Throws if the cursor name is invalid.
- *
- * @public
- * @return {Cursor}
- *
- * @param s{String}
- * @throws xap.taghandling.AttributeConversionException
-**/
-xap.taghandling.AttributeConverter.toCursor = function (s) {
- if (xap.taghandling.isEmptyOrNull(s)) {
- throw new xap.taghandling.AttributeConversionException(s, "cursor", null);
- }
- if (s == "") {
- return null;
- } //TODO does this make sense?
- for (var i = 0; i < xap.xml.XmlTokens.CURSOR_NAMES.length; i++) {
- if (s == xap.xml.XmlTokens.CURSOR_NAMES[i]) {
- return Cursor.getPredefinedCursor(s_cursorConstants[i]);
- }
- }
- throw new xap.taghandling.AttributeConversionException(s, "cursor", null);
-};
-/**
- * Converts the string to a boolean.
- * @param s The string to convert.
- * @return A boolean.
- * @throws xap.taghandling.AttributeConversionException If the string is empty, null,
- * or otherwise cannot be converted.
- *
- * @public
- * @return {boolean}
- *
- * @param s{String}
- * @throws xap.taghandling.AttributeConversionException
-**/
-xap.taghandling.AttributeConverter.toBoolean = function (s) {
- if (xap.taghandling.isEmptyOrNull(s)) {
- throw new xap.taghandling.AttributeConversionException(s, "boolean", null);
- }
- return (new Boolean(s)).booleanValue();
-};
-/**
- * Convert a String "true", "false", "", or null to integer TRUE,
- * FALSE, NOT_SET, or NOT_SET, throwing an exception if any other value encountered.
- * Tristate values are used to track things that can be true, false,
- * or not set by the user. For example, the bold style of a component
- * can be set to false, true, or left unspecified.
- * @param s String to parse
- * @return TRUE, FALSE, or NOT_SET
- * @throws xap.taghandling.AttributeConversionException
- *
- * @public
- * @return {int}
- *
- * @param s{String}
- * @throws xap.taghandling.AttributeConversionException{
-**/
-xap.taghandling.AttributeConverter.toTriState = function (s) {
- var result = xap.taghandling.AttributeConverter.NOT_SET;
- if (!xap.taghandling.isEmptyOrNull(s)) {
- if (s == "true") {
- result = xap.taghandling.AttributeConverter.TRUE;
- } else if (s == "false") {
- result = xap.taghandling.AttributeConverter.FALSE;
- } else {
- throw new xap.taghandling.AttributeConversionException(s,"tristate",null);
- }
- }
- return result;
-};
-/**
- * Convert an int TRUE, FALSE, or NOT_SET to a boolean,
- * using the passed default value in the last case.
- * @param ts an int TRUE, FALSE, or NOT_SET
- * @param defalt default value to use
- * @return passed default value or forced true or false
- *
- * @public
- * @param ts{integer}
- * @param defalt{boolean} Use default value?
- * @return {boolean}
-**/
-xap.taghandling.AttributeConverter.toBooleanFromTriStateInt = function (ts, defalt) {
- var defalt = null;
- switch (ts) {
- case xap.taghandling.AttributeConverter.TRUE:
- defalt = true;
- break;
- case xap.taghandling.AttributeConverter.FALSE:
- defalt = false;
- break;
- }
- return defalt;
-};
-/**
- * Convert a String "true", "false", "", or null to a boolean,
- * using the passed default value in the last 2 cases.
- * @param s String to parse
- * @param defalt default value to use
- * @return passed default value or forced true or false
- * @throws xap.taghandling.AttributeConversionException
- *
- * @public
- * @return {boolean}
- * @throws xap.taghandling.AttributeConversionException
-**/
-xap.taghandling.AttributeConverter.toBooleanFromTriState = function (s, defalt) {
- return toBooleanFromTriStateInt(this.toTriState(s), defalt);
-};
-/**
- * Converts a string to a date given the SimpleDateFormat
- * @param s The String to convert
- * @param dateFormat The dateFormat to use in conversion.
- * @return A Date object.
- * @throws xap.taghandling.AttributeConversionException
- *
- * @public
- * @return {Date}
- * @throws xap.taghandling.AttributeConversionException
-**/
-xap.taghandling.AttributeConverter.toDate = function (s, dateFormat) {
- try {
- return dateFormat.parse(s);
- }
- catch (e) { //ParseException
- //TODO include data format info?
- throw new xap.taghandling.AttributeConversionException(s, "date", e);
- }
-};
-/**
- * Coverts the string to an integer.
- * @param s The String to convert.
- * @return An int.
- * @throws xap.taghandling.AttributeConversionException
- *
- * @public
- * @return {int}
- *
- * @param s{String}
- * @throws xap.taghandling.AttributeConversionException
-**/
-xap.taghandling.AttributeConverter.toInteger = function (s) {
- try {
- return ((new Integer(s))).intValue();
- }
- catch (e) { //Exception
- //don't wrap the exception we get, it makes the stack trace
- //way too long and the problem is obvious anyway
- throw new xap.taghandling.AttributeConversionException(s, "integer", null);
- }
-};
-/**
- * Converts the string to a float.
- * @param s The string to convert.
- * @return A float.
- * @throws xap.taghandling.AttributeConversionException
- *
- * @public
- * @return {float}
- *
- * @param s{String}
- * @throws xap.taghandling.AttributeConversionException
-**/
-xap.taghandling.AttributeConverter.toFloat = function (s) {
- try {
- return ((new Float(s))).floatValue();
- }
- catch (e) { //Exception
- //don't wrap the exception we get, it makes the stack trace
- //way too long and the problem is obvious anyway
- throw new xap.taghandling.AttributeConversionException(s, "float", null);
- }
-};
-/**
- * Converts a string into an array of length number.
- * If the string is just one value, the array is all duplicates
- * If th string is number different comma separated value and
- * length is not number this throws an error
- * @param s The String to convert
- * @param number The length of the array to return.
- * @return An int[] of length number.
- * @throws xap.taghandling.AttributeConversionException
- *
- * @public
- * @return {int[]}
- * @throws xap.taghandling.AttributeConversionException
-**/
-xap.taghandling.AttributeConverter.toIntegers = function (s, number) {
- if (xap.taghandling.isEmptyOrNull(s)) {
- throw new xap.taghandling.AttributeConversionException(s, "" + number + " integers", null);
- }
- /*StringTokenizer*/
- var st = new StringTokenizer(s, ",");
- /*int*/
- var tokens = st.countTokens();
- /*int[]*/
- var ints = new Array(number);
- if (tokens == 1) {
- /*int*/
- var intValue = this.toInteger(st.nextToken());
- for (var i = 0; i < number; i++) {
- ints[i] = intValue;
- }
- } else if (tokens == number) {
- for (var i = 0; i < tokens; i++) {
- ints[i] = toInteger(st.nextToken());
- }
- } else {
- throw new xap.taghandling.AttributeConversionException(s, ""+ number + " integers", null);
- }
- return ints;
-};
-/**
- * Converts a comma separated list into an array of floats of any size,
- * can return null.
- * @param s The String to convert.
- * @return A float[].
- * @throws xap.taghandling.AttributeConversionException
- *
- * @public
- * @return {float[]}
- *
- * @param s{String}
- * @throws xap.taghandling.AttributeConversionException
-**/
-xap.taghandling.AttributeConverter.toFloats = function (s) {
- if (xap.taghandling.isEmptyOrNull(s)) {
- throw new xap.taghandling.AttributeConversionException(s, "float array", null);
- }
- /*StringTokenizer*/
- var st = new StringTokenizer(s, ",");
- /*int*/
- var tokens = st.countTokens();
- /*float[]*/
- var floats = new Array(tokens);
- try {
- for (var i = 0; i < tokens; i++) {
- floats[i] = new Float(st.nextToken().trim()).floatValue();
- }
- }
- catch (e) { //Exception
- throw new xap.taghandling.AttributeConversionException(s, "float array", null);
- }
- return floats;
-};
-/**
- * Converts the string to an array of integers.
- * @param s A comma-separated list of integers.
- * @return An int[].
- * @throws xap.taghandling.AttributeConversionException
- *
- * @public
- * @return {int[]}
- *
- * @param s{String}
- * @throws xap.taghandling.AttributeConversionException
-**/
-xap.taghandling.AttributeConverter.toIntegers = function (s) {
- if (xap.taghandling.isEmptyOrNull(s)) {
- throw new xap.taghandling.AttributeConversionException(s, "integer array", null);
- }
- /*StringTokenizer*/
- var st = new StringTokenizer(s, ",");
- /*int*/
- var tokens = st.countTokens();
- /*int[]*/
- var ints = new Array(tokens);
- try {
- for (var i = 0; i < tokens; i++) {
- ints[i] = Integer.parseInt(st.nextToken().trim());
- }
- }
- catch (e) { //Exception
- throw new xap.taghandling.AttributeConversionException(s, "integer array", null);
- }
- return ints;
-};
-/**
- * Expects a string like "78.4%", returns a float
- * between 0 and 1.
- * @param s The String to convert.
- * @return A float between 0 and 1.
- *
- * @public
- * @return {float}
- *
- * @param s{String}
- * @throws xap.taghandling.AttributeConversionException
-**/
-xap.taghandling.AttributeConverter.toPercentage = function (s) {
- if (s == null || !s.endsWith("%") || s.length() <= 1) {
- throw new xap.taghandling.AttributeConversionException(s, "percentage", null);
- }
- try {
- s = s.substring(0, s.length() - 1);
- /*Float*/
- var i = new Float(s);
- if (i.floatValue() < 0 || i.floatValue() > 100) {
- throw new xap.taghandling.AttributeConversionException(s, "percentage", null);
- }
- /*float*/
- var value = parseFloat(i); //i.floatValue()/100.0f;
- return Math.min(1, Math.max(value, 0));
- }
- catch (e) { //Exception
- throw new xap.taghandling.AttributeConversionException(s, "percentage", null);
- }
-};
-/**
- * Converts the string to a color. The string should be of the form
- * #HHHHHH where H is a hex digit, or an r,g,b string,
- * or a proper color name.
- * @param s The String to convert. "transparent" will return null.
- * @return An AWT Color.
- * @throws xap.taghandling.AttributeConversionException
- *
- * @public
- * @return {Color}
- *
- * @param s{String}
- * @throws xap.taghandling.AttributeConversionException
-**/
-xap.taghandling.AttributeConverter.toColor = function (s) {
- try {
- return toColorInternal(s);
- }
- catch (e) { //IllegalArgumentException
- throw new xap.taghandling.AttributeConversionException(s, "color", null);
- }
-};
-/**
- * @private
- * @return {Color}
- *
- * @param s{String}
- * @throws IllegalArgumentException
-**/
-xap.taghandling.AttributeConverter.toColorInternal = function (s) {
- if (xap.taghandling.isEmptyOrNull(s)) {
- throw new IllegalArgumentException();
- }
- try {
- if (s == xap.xml.XmlTokens.TRANSPARENT) {
- return null;
- }
- if (s.startsWith("#") && s.trim().length() == 7) {
- return Color.decode(s);
- }
- for (var i = 0; i < xap.xml.XmlTokens.COLOR_NAMES.length; i++) {
- if (s == xap.xml.XmlTokens.COLOR_NAMES[i]) {
- return s_colorValues[i];
- }
- }
-// TODO: un-punt this:
- /*StringTokenizer*/
-//var st = new StringTokenizer(s,",");
-// /*Integer r*/
-//var = new Integer(st.nextToken());
-// /*Integer g*/
-//var = new Integer(st.nextToken());
-// /*Integer b*/
-//var = new Integer(st.nextToken());
-//
-// return new Color(r.intValue(),g.intValue(),b.intValue());
- }
- catch (e) { // Exception
- throw new IllegalArgumentException();
- }
-};
-/**
- * If passed attribute string is in the passed String array,
- * return the corresponding int from the passed int array,
- * else throw an xap.taghandling.AttributeConversionException. This can be used
- * to turn an enumerated type into a constant, for example turn
- * "left","center","right" into 1,2,3
- * @param s The string to convert
- * @param names Array of enumeration names
- * @param values Array of enumeration values
- * @return int from values matching parallel name
- * @throws xap.taghandling.AttributeConversionException
- *
- * @public
- * @throws xap.taghandling.AttributeConversionException
-**/
-xap.taghandling.AttributeConverter.toIntFromEnum = function (s, names, values) {
- for (var i = 0; i < values.length; ++i) {
- if (names[i] == s) {
- return values[i];
- }
- }
-
- //if there was an error produce a string like:
- //could not convert to datatype: enumeration of{ true false }
- /*StringBuffer*/
- var stringBuffer = new StringBuffer("enumeration of{ ");
- for (var i = 0; i < names.length; i++) {
- stringBuffer.append(names[i]);
- stringBuffer.append(" ");
- }
- stringBuffer.append("}");
- throw new xap.taghandling.AttributeConversionException(s, stringBuffer.toString(), null);
-};
+
+
/**
* If passed attribute string is in the passed String array,
* return the corresponding Object from the passed Object array,
@@ -493,12 +46,8 @@
* @param s The string to convert
* @param names{String []} Array of enumeration names
* @param values{Object[] } Array of enumeration values
- * @return Object from values matching parallel name
- * @throws xap.taghandling.AttributeConversionException
- *
- * @public
- * @return {Object}
- * @throws xap.taghandling.AttributeConversionException
+ * @return {Object} Object from values matching parallel name
+ * @throws xap.util.Exception if conversion was not possible.
**/
xap.taghandling.AttributeConverter.toObjectFromEnum = function (s, names, values) {
for (var i = 0; i < values.length; ++i) {
@@ -507,236 +56,15 @@
}
}
- //if there was an error produce a string like:
- //could not convert to datatype: enumeration of{ true false }
- /*StringBuffer*/
- var stringBuffer = new StringBuffer("enumeration of{ ");
+ //if there was an error produce a string like:
+ //could not convert to datatype: enumeration of{ true false }
+ var stringBuffer = "enumeration of{ ";
for (var i = 0; i < names.length; i++) {
- stringBuffer.append(names[i]);
- stringBuffer.append(" ");
- }
- stringBuffer.append("}");
- throw new xap.taghandling.AttributeConversionException(s, stringBuffer.toString(), null);
-};
-/**
- * Converts the string s to an array of number length of colors.
- * @param s The String to convert. "transparent" will return null.
- * @param number The length of the array to return.
- * @return A Color[] of length number.
- * @throws xap.taghandling.AttributeConversionException
- *
- * @public
- * @return {Color[]}
- *
- * @param s, int number{String}
- * @throws xap.taghandling.AttributeConversionException
-**/
-xap.taghandling.AttributeConverter.toColors = function (s, number) {
- if (xap.taghandling.isEmptyOrNull(s)) {
- throw new xap.taghandling.AttributeConversionException(s, "" + number + " colors", null);
- }
- /*StringTokenizer*/
- var st = new StringTokenizer(s, ",");
- /*int*/
- var tokens = st.countTokens();
- /*Color[]*/
- var colors = new Color[number];
- if (tokens == 1) {
- /*Color*/
- var color = this.toColor(st.nextToken());
- for (var i = 0; i < number; i++) {
- colors[i] = color;
- }
- } else if (tokens == number) {
- for (var i = 0; i < tokens; i++) {
- colors[i] = toColor(st.nextToken());
- }
- } else {
- throw new xap.taghandling.AttributeConversionException(s, "" + number + " colors", null);
- }
- return colors;
-};
-/**
- * Converts an element reference in the form of #ID to an Element.
- * @param s{String} The element reference.
- * @param d{Document } The document to look the element up in.
- * @return An Element.
- * @throws xap.taghandling.AttributeConversionException
- *
- * @public
- * @return {Element}
- * @throws xap.taghandling.AttributeConversionException
-**/
-xap.taghandling.AttributeConverter.toElement = function (s, d) {
- /*String*/
- var errorString = "element reference (check element being referenced is declared before" + " being referenced).";
- if (xap.taghandling.isEmptyOrNull(s)) {
- throw new xap.taghandling.AttributeConversionException(s, errorString, null);
- }
- if (!s.startsWith("#")) {
- throw new xap.taghandling.AttributeConversionException(s, errorString, null);
- }
- /*Element*/
- var e = null;
- try {
- e = d.getElementById(s.substring(1));
- }
- catch (ex) { //Exception
- throw new xap.taghandling.AttributeConversionException(s, errorString, null);
- }
- if (e != null) {
- return e;
- }
- throw new xap.taghandling.AttributeConversionException(s, errorString, null);
-};
-/**
- * @public
- * @return {Component}
- *(String s, ClientSession session, Class componentClass,
- * String logicalClassName)
- * @throws xap.taghandling.AttributeConversionException
-**/
-xap.taghandling.AttributeConverter.toComponent = function (s, session, componentClass, logicalClassName) {
- /*String*/
- var errorString = "element reference (check element being referenced is declared before" + " being referenced).";
- if (xap.taghandling.isEmptyOrNull(s)) {
- throw new xap.taghandling.AttributeConversionException(s, errorString, null);
- }
- if (!s.startsWith("#")) {
- throw new xap.taghandling.AttributeConversionException(s, errorString, null);
- }
- /*Element*/
- var e = null;
- try {
- e = session.getDocumentRegistry().findDocument(DocumentRegistry.UI_DOCUMENT_NAME).getElementById(s.substring(1));
- }
- catch (ex) { //Exception
- throw new xap.taghandling.AttributeConversionException(s, errorString, null);
- }
- if (e != null) {
- /*Object*/
- var o = session.getUiContentHandler().getHandlerForElement(e);
- if (o instanceof AwtComponentBridge) {
- /*Component*/
- var popup = (o).getUiComponent(); //(AwtComponentBridge)
- if (!componentClass.isAssignableFrom(popup.getClass())) {
- throw new xap.taghandling.AttributeConversionException(s, logicalClassName + " reference.", null);
- }
- return popup;
- }
- }
- throw new xap.taghandling.AttributeConversionException(s, errorString, null);
-};
-/**
- * Returns either a Color, Style.TRANSPARENT_COLOR, or a gradient
- * This must take a session so it can look up a gradient reference
- * @param s The String to convert.
- * @param session{ClientSession} The current ClientSession.
- * @return A Color, gradient on Style.TRANSPARENT_COLOR.
- *
- * @public
- * @return {Object}
- *
- * @throws xap.taghandling.AttributeConversionException
-**/
-xap.taghandling.AttributeConverter.toPattern = function (s, session) {
- if (xap.taghandling.isEmptyOrNull(s)) {
- throw new xap.taghandling.AttributeConversionException(s, "pattern", null);
- }
-
- //do this because toCOlor(transparent) returns null
- if (s == "transparent") {
- return Style.TRANSPARENT_COLOR;
- }
- try {
- return toColorInternal(s);
- }
- catch (ex) { //IllegalArgumentException
- try {
- if (s.startsWith("#")) {
- /*Element*/
- var e = session.getDocumentRegistry().findDocument(DocumentRegistry.UI_DOCUMENT_NAME).getElementById(s.substring(1));
- /*Object*/
- var o = session.getUiContentHandler().getHandlerForElement(e);
- if (o instanceof GradientBridge) {
- return (o).getGradient();
- } //(GradientBridge)
- }
- }
- catch (e) { //Exception
- throw new xap.taghandling.AttributeConversionException(s, "pattern", null);
- }
- }
- throw new xap.taghandling.AttributeConversionException(s, "pattern", null);
-};
-/**
- * Converts a comma-separated string into an array of string.
- * @param s The String to convert.
- * @param number The length of the array to return.
- * @param validValues An array of acceptable strings, or null for all strings
- * @return A String[] of length number.
- * @throws xap.taghandling.AttributeConversionException
- *
- * @public
- * @return {String[]}
- *
- * @param s, int number, String[] validValues{String}
- * @throws xap.taghandling.AttributeConversionException
-**/
-xap.taghandling.AttributeConverter.toStrings = function (s, number, validValues) {
- if (xap.taghandling.isEmptyOrNull(s)) {
- throw new xap.taghandling.AttributeConversionException(s, "" + number + " strings", null);
- }
- /*StringTokenizer*/
- var st = new StringTokenizer(s, ",");
- /*int*/
- var tokens = st.countTokens();
- /*String[]*/
- var strings = new String[number];
- if (tokens == 1) {
- /*String*/
- var oneString = st.nextToken();
- for (var i = 0; i < number; i++) {
- strings[i] = oneString;
- }
- } else if (tokens == number) {
- for (var i = 0; i < tokens; i++) {
- strings[i] = st.nextToken().intern();
- }
- } else {
- throw new xap.taghandling.AttributeConversionException(s, "" + number + " strings", null);
- }
- if (validValues != null) {
- for (var i = 0; i < strings.length; i++) {
- /*boolean*/
- var wasValid = false;
- for (var j = 0; j < validValues.length && !wasValid; j++) {
- if (strings[i] == validValues[j]) {
- wasValid = true;
- }
- }
- if (!wasValid) {
- throw new xap.taghandling.AttributeConversionException(s, ""+number + " strings", null);
- }
- }
- }
- return strings;
-};
-/**
- * Returns true if the string is an empty string
- * or is null, does not perform a trim first.
- * @param s The string to check.
- * @return True if the string is null or equals "".
- *
- * @public
- * @return {boolean}
- *
- * @param s{String}
-**/
-xap.taghandling.AttributeConverter.isEmptyOrNull = function (s) {
- if (s == null || s == "" ) {
- return true;
+ stringBuffer += names[i] + " ";
}
- return false;
+ stringBuffer += "}";
+
+ //TODO does this actually work?
+ throw new xap.util.Exception("Could no convert " + s + " to " + stringBuffer);
};
Modified: incubator/xap/trunk/src/xap/xml/XalNamespaceHandler.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/xml/XalNamespaceHandler.js?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/src/xap/xml/XalNamespaceHandler.js (original)
+++ incubator/xap/trunk/src/xap/xml/XalNamespaceHandler.js Wed Nov 29 18:00:10 2006
@@ -81,7 +81,27 @@
//get the root and just append to it
var uiDocument = this._session.getDocumentContainer().getUiDocument();
var rootElement = uiDocument.getRootElement();
- rootElement.appendChild(element);
+ var rootPane = null;
+
+ if (element.nodeName=='rootPane'){
+ rootElement.appendChild(element);
+ return;
+ }
+
+ for (var i = 0; i<rootElement.childNodes.length &&!rootPane; i++){
+ var child = rootElement.childNodes[i];
+ if (child.nodeType==google.DOM_ELEMENT && child.nodeName=="rootPane"){
+ rootPane = child;
+ }
+ }
+
+
+ if (!rootPane){
+ //TODO should we take this namespace from the element passed in instead?
+ rootPane = uiDocument.createElement("rootPane",element.getNamespaceUri());
+ rootElement.appendChild(rootPane);
+ }
+ rootPane.appendChild(element);
}
Modified: incubator/xap/trunk/src/xap/xml/XmlTokens.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/xml/XmlTokens.js?view=diff&rev=480803&r1=480802&r2=480803
==============================================================================
--- incubator/xap/trunk/src/xap/xml/XmlTokens.js (original)
+++ incubator/xap/trunk/src/xap/xml/XmlTokens.js Wed Nov 29 18:00:10 2006
@@ -40,19 +40,19 @@
/**
* @public
**/
-xap.xml.XmlTokens.IMAGE_SELECTED = "imgSelected";
+xap.xml.XmlTokens.IMAGE_SELECTED = "selectedImage";
/**
* @public
**/
-xap.xml.XmlTokens.IMAGE_ROLLOVER_SELECTED = "imgOverSelected";
+xap.xml.XmlTokens.IMAGE_ROLLOVER_SELECTED = "mouseOverSelectedImage";
/**
* @public
**/
-xap.xml.XmlTokens.IMAGE_PRESSED_SELECTED = "imgPressedSelected";
+xap.xml.XmlTokens.IMAGE_PRESSED_SELECTED = "pressedSelectedImage";
/**
* @public
**/
-xap.xml.XmlTokens.IMAGE_DISABLED_SELECTED = "imgDisabledSelected";
+xap.xml.XmlTokens.IMAGE_DISABLED_SELECTED = "disabledSelectedImage";
/*public static String*/
xap.xml.XmlTokens.QUICK_EDIT = "quickEdit";
/*public static String*/
@@ -280,13 +280,13 @@
//imgHint:
/*public static final String*/
-xap.xml.XmlTokens.IMG_HINT = "imgHint";
+xap.xml.XmlTokens.IMG_HINT = "hintImage";
/*public static final String*/
-xap.xml.XmlTokens.IMG_WIDTH = "imgWidth";
+xap.xml.XmlTokens.IMG_WIDTH = "imageWidth";
/**
* @public
**/
-xap.xml.XmlTokens.IMG_HEIGHT = "imgHeight";
+xap.xml.XmlTokens.IMG_HEIGHT = "imageHeight";
// tristate (NOT_SET means automatic) controls tag-parsing:
/*public static final String*/
@@ -413,7 +413,7 @@
/**
* @public
**/
-xap.xml.XmlTokens.BACKGROUND_IMAGE = "imgBackground";
+xap.xml.XmlTokens.BACKGROUND_IMAGE = "backgroundImage";
/**
* @public
**/
@@ -954,14 +954,14 @@
* @public
**/
-xap.xml.XmlTokens.IMAGE_ROLLOVER = "imgOver";
+xap.xml.XmlTokens.IMAGE_ROLLOVER = "mouseOverImage";
/**
* "imgPressed"
*
* @public
**/
-xap.xml.XmlTokens.IMAGE_PRESSED = "imgPressed";
+xap.xml.XmlTokens.IMAGE_PRESSED = "pressedImage";
/**
* "img"
*
@@ -975,7 +975,7 @@
* @public
**/
-xap.xml.XmlTokens.IMAGE_DISABLED = "imgDisabled";
+xap.xml.XmlTokens.IMAGE_DISABLED = "disabledImage";
/**
* "imgHint"
*