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.generic;
032:
033: import de.ug2t.channel.markup.html.renderer.*;
034: import de.ug2t.connector.*;
035: import de.ug2t.kernel.*;
036: import de.ug2t.unifiedGui.interfaces.*;
037:
038: public final class MuGenericTextArea extends MuGenericComponent
039: implements IUnTextArea, IKePoolable {
040: private IKeView pem_view = new HtmlTextAreaRenderer();
041:
042: private int pem_cols = 0;
043: private int pem_rows = 0;
044: protected MuGenericScrollController pem_scrCrt = null;
045: protected String pdm_validSigns = null;
046: private boolean pem_selected = false;
047: private SelectionInterval pem_selIv = null;
048:
049: public MuGenericTextArea(String xName, int xCols, int xRows,
050: String xValue, ACoDataGetter xTplGetter, Object xTplName,
051: MuGenericApplication xAppl) throws Exception {
052: super (xName, xTplGetter, xTplName, xAppl);
053:
054: pem_cols = xCols;
055: pem_rows = xRows;
056:
057: if (pem_cols == 0 || pem_rows == 0)
058: this .pcmf_setFill(true, true);
059:
060: this .pcmf_setView(pem_view);
061: this .pcmf_setValue(xValue);
062: this .pem_scrCrt = new MuGenericScrollController("myscrcrt",
063: this );
064:
065: return;
066: };
067:
068: // @@
069:
070: public int pcmf_getCols() {
071: return pem_cols;
072: };
073:
074: public int pcmf_getRows() {
075: return pem_rows;
076: };
077:
078: public void pcmf_scrollXRel(int xPx) {
079: this .pem_scrCrt.pcmf_scrollXRel(xPx);
080: }
081:
082: public void pcmf_scrollXAbs(int xPx) {
083: this .pem_scrCrt.pcmf_scrollXAbs(xPx);
084: }
085:
086: public void pcmf_scrollYRel(int xPy) {
087: this .pem_scrCrt.pcmf_scrollYRel(xPy);
088: }
089:
090: public void pcmf_scrollYAbs(int xPy) {
091: this .pem_scrCrt.pcmf_scrollYAbs(xPy);
092: }
093:
094: public int pcmf_getXScroll() {
095: return (this .pem_scrCrt.pcmf_getX());
096: }
097:
098: public int pcmf_getYScroll() {
099: return (this .pem_scrCrt.pcmf_getY());
100: }
101:
102: public MuGenericScrollController pcmf_getScrollCrt() {
103: return (this .pem_scrCrt);
104: }
105:
106: private boolean pem_readOnly = false;
107:
108: public void pcmf_setReadOnly(boolean xReadOnly) {
109: if (this .pem_readOnly == xReadOnly)
110: return;
111:
112: this .pem_readOnly = xReadOnly;
113: this .pcmf_setPropChanged(true);
114: }
115:
116: public boolean pcmf_isReadOnly() {
117: return (this .pem_readOnly);
118: }
119:
120: public void pcmf_delete() throws Exception {
121: if (this .pdm_deleted == true)
122: return;
123:
124: this .pem_scrCrt.pcmf_delete();
125:
126: super .pcmf_delete();
127: }
128:
129: public String pcmf_getInputFilter() {
130: return (this .pdm_validSigns);
131: }
132:
133: // @@
134:
135: public void pcmf_setInputFilter(String xSigns) {
136: this .pdm_validSigns = xSigns;
137: }
138:
139: public void pcmf_removeInputFilter() {
140: this .pdm_validSigns = null;
141: }
142:
143: public void pcmf_setSelected() {
144: this .pem_selected = true;
145: }
146:
147: public void pcmf_unSelect() {
148: this .pem_selected = false;
149: }
150:
151: public boolean pcmf_isSelected() {
152: return (this .pem_selected);
153: }
154:
155: public void pcmf_setCaretPosition(int xPos) {
156: this .pcmf_setSelectionInterval(new SelectionInterval(xPos, 0));
157: }
158:
159: public void pcmf_setSelectionInterval(SelectionInterval xIntervall) {
160: if (xIntervall == null)
161: this .pcmf_unSelect();
162: this .pem_selIv = xIntervall;
163: }
164:
165: public SelectionInterval pcmf_getSelectionInterval() {
166: return (this.pem_selIv);
167: }
168: }
|