001: // @@
002: // @@
003: /*
004: * Wi.Ser Framework
005: *
006: * Version: 1.8.1, 20-September-2007
007: * Copyright (C) 2005 Dirk von der Weiden <dvdw@imail.de>
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library located in LGPL.txt in the
021: * license directory; if not, write to the
022: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
023: * Boston, MA 02111-1307, USA.
024: *
025: * If this agreement does not cover your requirements, please contact us
026: * via email to get detailed information about the commercial license
027: * or our service offerings!
028: *
029: */
030: // @@
031: package de.ug2t.channel.markup.html.renderer;
032:
033: import de.ug2t.channel.markup.generic.*;
034: import de.ug2t.kernel.*;
035: import de.ug2t.unifiedGui.interfaces.*;
036: import de.ug2t.xmlScript.*;
037:
038: public final class HtmlTextAreaRenderer implements IKeView {
039: private MuGenericCache pem_cache = new MuGenericCache();
040: private MuGenericApplication pem_appl = null;
041:
042: public boolean pcmf_supportsCaching() {
043: return (true);
044: }
045:
046: public void pcmf_clearCache() {
047: this .pem_cache.pcmf_clearCache();
048: }
049:
050: public void pcmf_reset() {
051: this .pem_appl = null;
052: };
053:
054: public void pcmf_activateCache(boolean xAc) {
055: this .pem_cache.pcmf_activateThisCache(xAc);
056: return;
057: }
058:
059: public Object pcmf_output(KeTreeElement xTreeEl) {
060: MuGenericTextArea html_xTreeEl = (MuGenericTextArea) xTreeEl;
061:
062: // @@
063:
064: if (pem_appl == null) {
065: Object l_appl = KeRegisteredObject
066: .pcmf_getObjByName(IUnApplication.MY_APPL);
067: if (l_appl instanceof MuGenericApplication)
068: pem_appl = (MuGenericApplication) l_appl;
069: else
070: pem_appl = (MuGenericApplication) html_xTreeEl
071: .pcmf_getAppl();
072: }
073:
074: pem_appl.pcmf_getRenderer().pcmf_addScrollPos(
075: html_xTreeEl.pcmf_getScrollCrt());
076:
077: // @@
078:
079: KeStringTemplate l_string = html_xTreeEl
080: .pcmf_getMarkupString("MAIN");
081:
082: l_string = html_xTreeEl.pcmf_insertToolTip(l_string);
083: l_string = html_xTreeEl
084: .pcmf_insertColorandFontandBorder(l_string);
085: l_string = html_xTreeEl.pcmf_insertPosition(l_string);
086: l_string = html_xTreeEl.pcmf_insertChannelandMenu(l_string);
087: l_string = html_xTreeEl.pcmf_insertTabIndex(l_string);
088:
089: l_string.pcmf_beginTR();
090:
091: Object l_obj = html_xTreeEl.pcmf_getValue();
092: if (l_obj == null)
093: l_obj = "";
094:
095: String l_value = l_obj.toString();
096:
097: l_string = KeTools.pcmf_stringSubst(l_string, "$NAME",
098: html_xTreeEl.pcmf_getObjName());
099: l_string = KeTools.pcmf_stringSubst(l_string, "$OID",
100: html_xTreeEl.pcmf_getObjName());
101: l_string = KeTools.pcmf_stringSubst(l_string, "$VALUE",
102: ScXmlScript.pcmf_filterSignsHTML(l_value));
103: l_string = KeTools.pcmf_stringSubst(l_string, "$COLS", Integer
104: .toString(html_xTreeEl.pcmf_getCols()));
105: l_string = KeTools.pcmf_stringSubst(l_string, "$ROWS", Integer
106: .toString(html_xTreeEl.pcmf_getRows()));
107:
108: if (html_xTreeEl.pcmf_isDisabled())
109: l_string = KeTools.pcmf_stringSubst(l_string, "$DISABLED",
110: "disabled");
111: else
112: l_string = KeTools.pcmf_stringSubst(l_string, "$DISABLED",
113: "");
114:
115: if (html_xTreeEl.pcmf_isReadOnly())
116: l_string = KeTools.pcmf_stringSubst(l_string, "$READONLY",
117: "readonly");
118: else
119: l_string = KeTools.pcmf_stringSubst(l_string, "$READONLY",
120: "");
121:
122: if (html_xTreeEl.pcmf_isSelected())
123: l_string = KeTools.pcmf_stringSubst(l_string, "$SELECT",
124: html_xTreeEl.pcmf_getMarkupString("SEL"));
125: else
126: l_string = KeTools
127: .pcmf_stringSubst(l_string, "$SELECT", "");
128:
129: IUnTextInputComponent.SelectionInterval l_iv = html_xTreeEl
130: .pcmf_getSelectionInterval();
131: if (l_iv != null) {
132: KeStringTemplate l_sTpl = html_xTreeEl
133: .pcmf_getMarkupString("SELIV");
134: l_sTpl.pcmf_stringdirectSingleSubst("$B", Integer
135: .toString(l_iv.pcm_begin));
136: l_sTpl.pcmf_stringdirectSingleSubst("$L", Integer
137: .toString(l_iv.pcm_len));
138: l_string = KeTools.pcmf_stringSubst(l_string, "$SELECT",
139: l_sTpl.toString());
140: }
141: if (html_xTreeEl.pcmf_getInputFilter() != null) {
142: l_string = KeTools.pcmf_stringSubst(l_string, "$KEYS",
143: html_xTreeEl.pcmf_getInputFilter());
144: l_string = KeTools.pcmf_stringSubst(l_string, "$VALSIGNS",
145: html_xTreeEl.pcmf_getMarkupString("VALSIGNS"));
146: } else {
147: l_string = KeTools.pcmf_stringSubst(l_string, "$KEYS", "");
148: l_string = KeTools.pcmf_stringSubst(l_string, "$VALSIGNS",
149: "");
150: }
151:
152: if (html_xTreeEl.pcmf_isSubmit()) {
153: KeStringTemplate l_stpl = html_xTreeEl
154: .pcmf_getMarkupString("SUBMIT");
155: if (l_stpl != null)
156: l_string = KeTools.pcmf_stringSubst(l_string,
157: "$SUBMIT", l_stpl);
158: else
159: l_string = KeTools.pcmf_stringSubst(l_string,
160: "$SUBMIT", html_xTreeEl.pcmf_getKit()
161: .getSUBMIT_T());
162: } else
163: l_string = KeTools
164: .pcmf_stringSubst(l_string, "$SUBMIT", "");
165:
166: l_string = KeTools.pcmf_stringSubst(l_string, "$PNAME",
167: html_xTreeEl.pcmf_getScrollCrt().pcmf_getObjName());
168: l_string = KeTools.pcmf_stringSubst(l_string, "$POS_SCROLL",
169: html_xTreeEl.pcmf_getScrollCrt().pcmf_getValue()
170: .toString());
171:
172: l_string.pcmf_endTR(true);
173:
174: // @@
175:
176: return (l_string);
177: };
178:
179: public Object pcmf_execView(KeTreeElement xTreeEl) {
180: return (xTreeEl.pcmf_execView());
181: };
182: };
|