CVS: Tapestry/framework/src/net/sf/tapestry/parse SpecificationParser.java,1.32.2.2,1.32.2.3 Tapestry_1_4.dtd,1.1.2.1,1.1.2.2
Howard Lewis Ship <[email protected]>
| Newsgroups | gmane.comp.java.tapestry.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/parse
In directory sc8-pr-cvs1:/tmp/cvs-serv2336/framework/src/net/sf/tapestry/parse
Modified Files:
Tag: hship-2-3
SpecificationParser.java Tapestry_1_4.dtd
Log Message:
Add support for <listener-binding>.
Use a ResourceBundle for "factory default" configuration properties.
Index: SpecificationParser.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/parse/SpecificationParser.java,v
retrieving revision 1.32.2.2
retrieving revision 1.32.2.3
diff -C2 -d -r1.32.2.2 -r1.32.2.3
*** SpecificationParser.java 31 Dec 2002 17:08:43 -0000 1.32.2.2
--- SpecificationParser.java 4 Jan 2003 02:46:49 -0000 1.32.2.3
***************
*** 29,32 ****
--- 29,33 ----
import net.sf.tapestry.spec.IApplicationSpecification;
import net.sf.tapestry.spec.ILibrarySpecification;
+ import net.sf.tapestry.spec.ListenerBindingSpecification;
import net.sf.tapestry.spec.ParameterSpecification;
import net.sf.tapestry.spec.SpecFactory;
***************
*** 912,915 ****
--- 913,918 ----
}
+ // Field binding is in 1.3 DTD, but removed from 1.4
+
if (isElement(child, "field-binding"))
{
***************
*** 918,921 ****
--- 921,930 ----
}
+ if (isElement(child, "listener-binding"))
+ {
+ convertListenerBinding(c, child);
+ continue;
+ }
+
if (isElement(child, "inherited-binding"))
{
***************
*** 957,960 ****
--- 966,983 ----
}
+ private void convertListenerBinding(ContainedComponent component, Node node)
+ {
+ String name = getAttribute(node, "name");
+ String language = getAttribute(node, "language");
+
+ // The script itself is the character data wrapped by the element.
+
+ String script = getValue(node);
+
+ ListenerBindingSpecification binding = _factory.createListenerBindingSpecification(language, script);
+
+ component.setBinding(name, binding);
+ }
+
private void convertStaticBinding(ContainedComponent component, Node node)
{
***************
*** 1126,1130 ****
String propertyName = getAttribute(node, "property-name");
String type = getAttribute(node, "type");
! String value = getValue(node);
validate(propertyName, PROPERTY_NAME_PATTERN, "SpecificationParser.invalid-property-name");
--- 1149,1156 ----
String propertyName = getAttribute(node, "property-name");
String type = getAttribute(node, "type");
! String value = getAttribute(node, "value");
!
! if (value == null)
! value = getValue(node);
validate(propertyName, PROPERTY_NAME_PATTERN, "SpecificationParser.invalid-property-name");
Index: Tapestry_1_4.dtd
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/parse/Attic/Tapestry_1_4.dtd,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** Tapestry_1_4.dtd 31 Dec 2002 17:08:43 -0000 1.1.2.1
--- Tapestry_1_4.dtd 4 Jan 2003 02:46:49 -0000 1.1.2.2
***************
*** 27,30 ****
--- 27,31 ----
- added value attribute to <property>
- renamed <component-alias> to <component-type>
+ - added <listener-binding> element
-->
***************
*** 129,133 ****
property-name: The name of the property to configure.
type: Conversion of property value.
!
-->
--- 130,136 ----
property-name: The name of the property to configure.
type: Conversion of property value.
! value: The value to be converted and applied. If not
! specified, the element's character data is
! used.
-->
***************
*** 137,140 ****
--- 140,144 ----
property-name CDATA #REQUIRED
type %static-value-type;
+ value CDATA #IMPLIED
>
***************
*** 154,158 ****
The Tapestry page loader ensures that either type or copy-of is specified, but not both.
-->
! <!ELEMENT component (property*, (binding | inherited-binding | static-binding | string-binding)*)>
<!ATTLIST component
id ID #REQUIRED
--- 158,162 ----
The Tapestry page loader ensures that either type or copy-of is specified, but not both.
-->
! <!ELEMENT component (property*, (binding | inherited-binding | listener-binding | static-binding | string-binding)*)>
<!ATTLIST component
id ID #REQUIRED
***************
*** 335,338 ****
--- 339,363 ----
name CDATA #REQUIRED
specification-path CDATA #REQUIRED
+ >
+
+ <!-- =======================================================
+ Element: listener-binding
+ Appears in: component
+
+ Defines an in-place script using the scripting language
+ supported by Bean Scripting Framework (http://jakarta.apache.org/bsf).
+ The script itself is the element's character data (often, inside
+ a CDATA block).
+
+ The default language is jython, though this can be overridden.
+
+ Attributes:
+ name: The name of the component parameter to bind.
+ language: The language the script is written in.
+ -->
+ <!ELEMENT listener-binding (#PCDATA)>
+ <!ATTLIST listener-binding
+ name CDATA #REQUIRED
+ language CDATA #IMPLIED
>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf