使用 ADF Skin

来源:互联网 发布:达内大数据培训靠谱吗 编辑:程序博客网 时间:2024/05/17 09:01

本文描述如何在ADF项目中使用自定义SKIN。

1.新建ADF项目

2.在Jdeveloper中引入XML Schema

    进入菜单——Tools——Preference——XML Schemas

    

    单击添加按钮,将MW_HOME/oracle_common/modules/oracle.adf.view_11.1.1/trinidad-impl.jar!/org/apache/myfaces/trinidadinternal/ui/laf/xml/schemas/skin/trinidad-skins.xsd文件引入。如上图所示。

    3. 注册自定义Skin

     新建Skin的XML文件,步骤见下图

      

      

      

      4. 编辑XML

      

[html] view plaincopy
  1. <?xml version="1.0" encoding="UTF-8" ?>  
  2. <skins xmlns="http://myfaces.apache.org/trinidad/skin">  
  3.   <skin>  
  4.        <id>richdemo.desktop</id>  
  5.        <family>richDemo</family>  
  6.        <extends>fusion.desktop</extends>  
  7.        <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>  
  8.        <!-- 
  9.        <bundle-name></bundle-name> 
  10.        -->  
  11.        <style-sheet-name>skins/richdemo/richdemo.css</style-sheet-name>  
  12.     </skin>  
  13. </skins>  

     5.配置trinidad-config.xml

[html] view plaincopy
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <trinidad-config xmlns="http://myfaces.apache.org/trinidad/config">  
  3.   
  4.   <skin-family>richDemo</skin-family>  
  5. </trinidad-config>  

     6. 编写CSS文件

[css] view plaincopy
  1. af|commandButton {font-sizelarge;}  

     7. 运行结果

      


      如果想要修改CSS随时生效(不需要重新运行ADF项目),则需要修改如下配置。

      web.xml中修改

     

[html] view plaincopy
  1. <context-param>  
  2.     <description>If this parameter is true, there will be an automatic check of the modification date of your JSPs, and saved state will be discarded when JSP's change. It will also automatically check if your skinning css files have changed without you having to restart the server. This makes development easier, but adds overhead. For this reason this parameter should be set to false when your application is deployed.</description>  
  3.     <param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>  
  4.     <param-value>true</param-value>  
  5.   </context-param>  

相关文档:

http://jdevadf.oracle.com/adf-richclient-demo/docs/skin-selectors.html

http://docs.oracle.com/cd/E16764_01/web.1111/b31973/af_skin.htm

转自:http://blog.csdn.net/ygj26/article/details/7945446

0 0
原创粉丝点击