| CODENOTIFIER | HelpYou are not signed inSign in |
Project: gwt-ext
Revision: 1821
Author: mlim1972
Date: 05 Sep 2008 03:30:21
Changes:New method to update the html/code and extending the textarea to occupied the whole panel
Files:| ... | ...@@ -68,7 +68,7 @@ | |
| 68 | 68 | * Create a new SyntaxHighlightPanel. |
| 69 | 69 | */ |
| 70 | 70 | public SyntaxHighlightPanel() { |
| 71 | setBorder(true); | |
| 71 | this(null, SYNTAX_XML); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
| ... | ...@@ -120,6 +120,30 @@ | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
| 123 | * This method can be called after the component is rendered | |
| 124 | * so that it can update the code | |
| 125 | * @param html the code fragment to hightlight | |
| 126 | * @param syntaxType the syntax type | |
| 127 | */ | |
| 128 | public void updateHtml(String html, String syntaxType) | |
| 129 | { | |
| 130 | this.html = html; | |
| 131 | this.syntaxType = syntaxType; | |
| 132 | setSuperHtml(setSyntaxHighlight()); | |
| 133 | executeSh(name, showGutter, showControls, collapseAll, firstLine, showColumns); | |
| 134 | } | |
| 135 | ||
| 136 | /** | |
| 137 | * This method can be called after the component is rendered | |
| 138 | * so that it can update the code | |
| 139 | * @param html the code fragment to hightlight | |
| 140 | */ | |
| 141 | public void updateHtml(String html) | |
| 142 | { | |
| 143 | updateHtml(html, syntaxType); | |
| 144 | } | |
| 145 | ||
| 146 | /** | |
| 123 | 147 | * used internally to call the super method for setHtml... |
| 124 | 148 | * @param html the html to set for the panel |
| 125 | 149 | */ |
| ... | ...@@ -135,7 +159,7 @@ | |
| 135 | 159 | */ |
| 136 | 160 | protected String setSyntaxHighlight(){ |
| 137 | 161 | StringBuffer buffer = new StringBuffer(); |
| 138 | buffer.append("<textarea name=\""); | |
| 162 | buffer.append("<textarea style='width:100%;height:100%;' name=\""); | |
| 139 | 163 | buffer.append(name); |
| 140 | 164 | buffer.append("\" class=\""); |
| 141 | 165 | buffer.append(syntaxType); |