ADF Skin Editor的使用

介紹

自從Oracle發佈Skin Editor之後,開發ADF Skin變的比之前要簡單了,利用Skin Editor做好Skin之後,可以直接將Skin打包成jar,在任何一個ADF的應用中使用。本文就介紹如何使用Skin Editor開發ADF Skin以及發佈和使用。

目前Skin Editor的版本是11.1.2.3,點此處訪問,通過它可以爲ADF11g R2中的11.1.2.0.0~11.1.2.3.0,以及R1版本的11.1.1.4.0~11.1.1.6.0的ADF應用開發Skin。另外,在11.1.2.3.0的Jdeveloper中包含了Skin Editor的功能,不過好像只能爲R2版本的ADF開發Skin。

安裝

下載好Skin Editor之後,直接解壓到文件目錄,運行skineditor.exe即可運行。 

使用Skin Editor開發ADF Skin,以ADF Table爲例

1.創建Skin Application,

選擇菜單Application→New

選擇目標ADF應用的版本

2.創建ADF Skin File

3.創建發佈的ADF Library

4.使用skin Editor編輯css文件

  1. /**ADFFaces_Skin_File / DO NOT REMOVE**/  
  2. @namespace af "http://xmlns.oracle.com/adf/faces/rich";  
  3. @namespace dvt "http://xmlns.oracle.com/dss/adf/faces";  
  4.   
  5.   
  6. .AFTableCellPadding:alias {  
  7.     padding-left2px;  
  8.     padding-right2px;  
  9. }  
  10.   
  11. .AFTableCellDataBorder:alias {  
  12.     border-right1px solid #BBD3EB;  
  13.     border-bottom1px solid #BBD3EB;  
  14. }  
  15.   
  16. .AFTableCellData:alias {  
  17.     padding-right2px;  
  18.     padding-left2px;  
  19. }  
  20.   
  21. .AFTableCellDataVGrid:alias {  
  22.     /* 垂直線 */  
  23.     padding-right2px;  
  24.     border-right1px solid #BBD3EB;  
  25. }  
  26.   
  27. .AFTableCellDataHGrid:alias {  
  28.     /* 水平線 */  
  29.     border-bottom1px solid #BBD3EB;  
  30. }  
  31.   
  32. .AFTableCellHeaderBorder:alias {  
  33.     border-bottom1px solid #BBD3EB;  
  34.     border-right1px solid #BBD3EB;  
  35. }  
  36.   
  37.   
  38.   
  39. af|table {  
  40.     -tr-padding-left-width2;  
  41.     -tr-padding-right-width2;  
  42.     background-color: InactiveBorder;  
  43.     border1px solid #BBD3EB;  
  44. }  
  45.   
  46. af|table::column-resize-indicator {border1px dotted #002f6c;}  
  47.   
  48. af|column::column-header-cell {  
  49.     background-imageurl("images/tb_header.gif");  
  50.     background-repeatrepeat-x ;  
  51.     background-positiontop left;  
  52.     text-indent0px;  
  53.     height25px;  
  54.     text-aligncenter;  
  55. }  
  56.   
  57. af|column::column-header-cell-content {  
  58.     font-weightbold;  
  59.     text-indent0px;  
  60. }  
  61. /* 奇數行 */  
  62. af|column::data-cell {  
  63.     background-color#ffffff;  
  64.     height22px;  
  65.     font-size12px;  
  66.     font-weightnormal;  
  67.     overflowhidden;  
  68. }  
  69. /* 偶數行 */  
  70. af|column::banded-data-cell {  
  71.     background-color#F7FAFF;  
  72.     height22px;  
  73.     font-size12px;  
  74.     font-weightnormal;  
  75.     overflowhidden;  
  76. }  
  77.   
  78. /* table focus時鼠標選中時樣式 */  
  79. af|table::data-row:selected:focused af|column::data-cell, af|table::data-row:selected:focused af|column::banded-data-cell {  
  80.     background-color#C1D8FD;  
  81. }  
  82. /* table 鼠標選中時樣式 */  
  83. af|table::data-row:selected af|column::data-cell, af|table::data-row:selected af|column::banded-data-cell {  
  84.     background-color#C1D8FD;  
  85. }  
  86. /* table 焦點離開時選中table的樣式 */  
  87. af|table::data-row:selected:inactive af|column::data-cell, af|table::data-row:selected:inactive af|column::banded-data-cell {  
  88.     background-color#C1D8FD;  
  89. }  
  90. /* table 鼠標劃過時樣式 */  
  91. af|table::data-row:highlighted af|column::data-cell, af|table::data-row:highlighted af|column::banded-data-cell {  
  92.     background-color#E2EBFA;  
  93. }  

5.發佈

在項目中使用以上發佈的jar包

1.新建一個ADF應用程序(11.1.1.6.0,和以上skin匹配),將jar包引入View Controller Project

此處一定需選擇deployed by default,否則部署的時候,jar包不會被打包部署到weblogic。

2.修改trinidad-config.xml(注意skin-family標籤,和前面步驟中的要一致)

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

運行結果

相關主題

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

參考文獻

http://docs.oracle.com/cd/E16162_01/user.1112/e17456/toc.htm

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

Using ADF Faces 11g Skinning for setting the styles of specific component instances or groups of instances

http://technology.amis.nl/2009/07/01/using-adf-faces-11g-skinning-for-setting-the-styles-of-specific-component-instances-or-groups-of-instances/

轉自:http://blog.csdn.net/ygj26/article/details/8299644

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章