12.4 New Tags, Java Scripting, and Setters

GUI context XML file

 <?xml version="1.0" encoding="UTF-8"?>
 <Frame size="250,80"
        visible="true"
        title="Tag Definition"
        DefaultCloseOperation="JFrame.EXIT_ON_CLOSE"  >
     <ScriptingDataSource id="WORDS" script="getWords.bsh"/>
     <panel constraints="BorderLayout.NORTH">
        <label id="label1" origin="$WORDS/first"/>
        <label id="label2" origin="$WORDS/second"/>
     </panel>
 </Frame>
-_-_-

[Picture]

XPath expressions are used to access the data from a java Map created with the following code.

 import java.util.HashMap;
 map = new HashMap();
 map.put("first", "Data");
 map.put("second", "Sources!");
 return map;
-_-_-

The code uses the java scripting system BeanShell.

Application context XML file

 <bean id="newTags"
       class="org.swixat.framework.TagLibraryExt">
   <property name="newTags">
     <map>
       <entry key="ScriptingDataSource">
          <value>org.swixat.databinding.ScriptingDataSource</value>
       </entry>
     </map>
   </property>
 </bean>
-_-_-

 <bean id="SetterFactory"
       class="org.swixat.databinding.SetterFactory">
   <property name="propertySetters">
     <map>
       <entry key="javax.swing.JLabel">
         <value>org.swixat.databinding.JLabelPropertySetter</value>
       </entry>
     </map>
   </property>
 </bean>
-_-_-