📄 firsttree4.html
字号:
<html jwcid="@Shell" title="Using The Tapestry Tree Control" stylesheet="ognl:assets.stylesheet"><head jwcid="@Block"> <link rel="stylesheet" type="text/css" href="../css/style.css"/></head><body jwcid="@Body"> <h1>Changing the open and close icons</h1> <div class="note"> This page demonstrates how to supply custom open and close icons to the <code>TreeNodeView</code>. </div> <p> It's really quite simple to change the open and close icons in the tree: <table border="1"> <tr> <td valign="top"> <span class="tree" jwcid="treeView"> <span jwcid="treeDataView"> <span jwcid="treeNodeView"/> </span> </span> </td> </tr> <tr> <td colspan="4"> <code class="highlight"><span jwcid="@Insert" value="ognl:lastNodeSelectedMsg"/></code> <td> </tr> </table> <p> Here are the relevent snippets from <code>FirstTree4.page</code> that change the open and close icons:<div class="code"><pre><code class="highlight"> <context-asset name="closeNodeImage" path="images/TreeClosed.gif"/> <context-asset name="openNodeImage" path="images/TreeOpen.gif"/></code> <component id="treeNodeView" type="contrib:TreeNodeView"> <binding name="treeDataView" expression='components.treeDataView'/> <binding name="makeNodeDirect" expression="true"/><code class="highlight"> <binding name="closeNodeImage" expression="assets.closeNodeImage"/> <binding name="openNodeImage" expression="assets.openNodeImage"/></code> </component></pre></div><p> Unfortunately, TreeNodeView does not differentiate between nodes that have children and leaf nodes. The same icons will be displayed for every node. If this doesn't meet your needs you will have to create some custom Java classes.<p> If you do not want open and close icons to be displayed, add the following binding to the <code>"treeNodeView"</code> component:<div class="code"><pre> <binding name="showNodeImages" expression="false"/></pre></div> <p><a href="#" jwcid="@PageLink" page="Home">Return to Home Page...</a></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -