| <!-- | |
| #* Licensed to the Apache Software Foundation (ASF) under one | |
| or more contributor license agreements. See the NOTICE file | |
| distributed with this work for additional information | |
| regarding copyright ownership. The ASF licenses this file | |
| to you under the Apache License, Version 2.0 (the | |
| "License"); you may not use this file except in compliance | |
| with the License. You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, | |
| software distributed under the License is distributed on an | |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| KIND, either express or implied. See the License for the | |
| specific language governing permissions and limitations | |
| under the License.*# | |
| --> | |
| <style type="text/css"> | |
| td.fields { margin-top: 1em; line-height: 2; } | |
| </style> | |
| $form | |
| <p> </p> | |
| The form demonstrates a custom | |
| <a href="$context/source-viewer.htm?filename=WEB-INF/classes/org/apache/click/examples/control/RichTextArea.java">RichTextArea</a> | |
| control using the | |
| <a target="blank" href="http://developer.yahoo.com/yui/editor/">YUI editor</a>. | |
| The control overrides the Field method <tt>getHeadElements()</tt> to include its | |
| JavaScript imports automatically: | |
| <pre class="codeJava"> | |
| <span class="kw">public</span> List getHeadElements() { | |
| if (headElements == <span class="kw">null</span>) { | |
| headElements = <span class="kw">super</span>.getHeadElements(); | |
| headElements.add(<span class="kw">new</span> CssImport(<span class="st">"/yui/fonts/fonts-min.css"</span>)); | |
| headElements.add(<span class="kw">new</span> CssImport(<span class="st">"/yui/editor/skins/sam/simpleeditor.css"</span>)); | |
| headElements.add(<span class="kw">new</span> JsImport(<span class="st">"/yui/yahoo-dom-event/yahoo-dom-event.js"</span>)); | |
| headElements.add(<span class="kw">new</span> JsImport(<span class="st">"/yui/element/element-beta-min.js"</span>)); | |
| headElements.add(<span class="kw">new</span> JsImport(<span class="st">"/yui/container/container_core-min.js"</span>)); | |
| headElements.add(<span class="kw">new</span> JsImport(<span class="st">"/yui/editor/simpleeditor-min.js"</span>)); | |
| } | |
| ... | |
| <span class="kw">return</span> headElements; | |
| } </pre> |