`
bclxz520
  • 浏览: 66005 次
  • 性别: Icon_minigender_2
社区版块
存档分类
最新评论

Not yet ready for use. APIs subject to change without notice

阅读更多
在tapestry4.1中创建自己的jodo组件,运行的时候,有这样的提示,Not yet ready for use. APIs subject to change without notice不知道是什么东东,有哪位可以指教一下,代码如下
Circles.script
xml 代码
 
  1. xml version="1.0"?>  
  2.   "-//Apache Software Foundation//Tapestry Script Specification 3.0//EN"  
  3.   "http://tapestry.apache.org/dtd/Script_3_0.dtd">  
  4. <script>  
  5.   
  6.     <body>  
  7.         <unique>  
  8.             dojo.require("dojo.gfx.*");  
  9.         <!---->unique>  
  10.     <!---->body>  
  11.   
  12. <!---->script>  

Circles.jwc
xml 代码
 
  1. xml version="1.0" encoding="UTF-8"?>  
  2. <!---->
  3.    Copyright 2004, 2005, 2006 The Apache Software Foundation  
  4.   
  5.    Licensed under the Apache License, Version 2.0 (the "License");  
  6.    you may not use this file except in compliance with the License.  
  7.    You may obtain a copy of the License at  
  8.   
  9.        http://www.apache.org/licenses/LICENSE-2.0  
  10.   
  11.    Unless required by applicable law or agreed to in writing, software  
  12.    distributed under the License is distributed on an "AS IS" BASIS,  
  13.    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
  14.    See the License for the specific language governing permissions and  
  15.    limitations under the License.  
  16. -->  
  17.   
  18.         "-//Apache Software Foundation//Tapestry Specification 4.0//EN"  
  19.         "http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">  
  20.   
  21. <component-specification class="myComponent.Circles"  
  22.                          allow-body="yes" allow-informal-parameters="yes">  
  23.   
  24.     <description>  
  25.         Creates a modal Circles.  
  26.     <!---->description>  
  27.     <inject property="script" type="script" object="Circles.script"/>  
  28.   
  29. <!---->component-specification>  

Circles.java
java 代码
 
  1. package myComponent;  
  2.   
  3. import java.util.HashMap;  
  4. import java.util.Map;  
  5.   
  6. import org.apache.tapestry.IMarkupWriter;  
  7. import org.apache.tapestry.IRequestCycle;  
  8. import org.apache.tapestry.IScript;  
  9. import org.apache.tapestry.PageRenderSupport;  
  10. import org.apache.tapestry.TapestryUtils;  
  11. import org.apache.tapestry.dojo.form.IFormWidget;  
  12. import org.apache.tapestry.form.AbstractFormComponent;  
  13.   
  14. public  abstract class Circles extends AbstractFormComponent implements IFormWidget  
  15. {  
  16.   
  17. public abstract void setDestroy(boolean destroy);  
  18. public abstract IScript getScript();  
  19.   
  20. public abstract String getClientId();  
  21.   
  22. public abstract void setClientId(String id);  
  23. /** 
  24.  * Determined dynamically at runtime during rendering, informs widget implementations 
  25.  * if they should destroy their client side widget equivalents or leave them in tact. 
  26.  *  
  27.  * @return True if the widget should be destroyed on this render, false otherwise. 
  28.  */  
  29. public abstract boolean getDestroy();  
  30.   
  31. /** 
  32.  * {@inheritDoc} 
  33.  */  
  34. public void renderWidget(IMarkupWriter writer, IRequestCycle cycle)  
  35. {  
  36.     renderComponent(writer, cycle);  
  37. }  
  38.   
  39. /** 
  40.  * {@inheritDoc} 
  41.  */  
  42. protected void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle)  
  43. {  
  44.     if(!cycle.isRewinding()) {  
  45.           
  46.         if (!cycle.getResponseBuilder().isDynamic()   
  47.                 || cycle.getResponseBuilder().explicitlyContains(this)) {  
  48.               
  49.             setDestroy(false);  
  50.         } else  
  51.             setDestroy(true);  
  52.     }  
  53.       
  54.     // don't render if not part of update response  
  55.       
  56.     if (cycle.getResponseBuilder().isDynamic()  
  57.             && (!cycle.getResponseBuilder().explicitlyContains(this)   
  58.                     && !cycle.getResponseBuilder().contains(this))) {  
  59.           
  60.         return;  
  61.     }  
  62.       
  63.     renderFormWidget(writer, cycle);  
  64. }  
  65.   
  66. /** 
  67.  * {@inheritDoc} 
  68.  */  
  69. protected void rewindFormComponent(IMarkupWriter writer, IRequestCycle cycle)  
  70. {  
  71.     rewindFormWidget(writer, cycle);  
  72. }  
  73.   
  74. /** 
  75.  * Called when rendering a form widget.  
  76.  *  
  77.  * @param writer 
  78.  *          The markup writer to render with. 
  79.  * @param cycle 
  80.  *          The cycle associated with request. 
  81.  */  
  82. protected void renderFormWidget(IMarkupWriter writer, IRequestCycle cycle)  
  83. {  
  84.     Map parms = new HashMap();  
  85.     parms.put("id", getClientId());  
  86.     parms.put("widget"this);  
  87.     PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle, this);  
  88.     getScript().execute(this , cycle, pageRenderSupport , parms);  
  89. }  
  90.   
  91. /** 
  92.  * Called during form submission to retrieve submitted input values.  
  93.  * Components should do any validation/retrieval of values in this method.  
  94.  *  
  95.  * @param writer 
  96.  *          The passed in {@link IMarkupWriter} will be a {@link NullMarkupWriter}, making  
  97.  *          any content written ignored.  
  98.  * @param cycle 
  99.  *           Typically used to retrieve submitted value via cycle.getParameter(getName()). 
  100.  */  
  101. protected void rewindFormWidget(IMarkupWriter writer, IRequestCycle cycle)  
  102. {  
  103. }  
  104.   
  105. }  


application文件
xml 代码
 
  1. xml version="1.0"?>  
  2.   
  3.   "-//Apache Software Foundation//Tapestry Specification 4.0//EN"   
  4.   "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">  
  5.       
  6. <application name="workbench">  
  7.   <meta key="org.apache.tapestry.visit-class" value="org.apache.tapestry.workbench.Visit"/>  
  8.   <meta key="org.apache.tapestry.template-encoding" value="ISO-8859-1"/>  
  9.   <meta key="org.apache.tapestry.page-class-packages" value="org.apache.tapestry.workbench"/>  
  10.   <meta key="org.apache.tapestry.component-class-packages" value="org.apache.tapestry.workbench.components"/>  
  11.           
  12.   <library id="contrib" specification-path="classpath:/org/apache/tapestry/contrib/Contrib.library"/>  
  13.     
  14.   
  15.   
  16.   
  17.    <page name="Home" specification-path="/WEB-INF/home/Home.page"/>  
  18.    <page name="Page1" specification-path="/WEB-INF/pages/Page1.page"/>  
  19.      
  20.    <component-type type="Circles" specification-path="/myComponent/Circles.jwc"/>  
  21. <!---->application>  

代码就是这些,如有哪位高手遇到过这个问题,希望可以帮忙一下.
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics