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 MuGenericCheckBox extends MuGenericComponent
039: implements IUnCheckBox, IKePoolable {
040: private String pem_string;
041: protected IUnImage pdm_icon = null;
042: protected char pdm_accKey = ' ';
043: private boolean pem_wrap = true;
044:
045: private IKeView pem_view = new HtmlCheckBoxRenderer();
046:
047: public MuGenericCheckBox(String xValue, String xString,
048: ACoDataGetter xTplGetter, Object xTplName,
049: MuGenericApplication xAppl) throws Exception {
050: super (xValue, xTplGetter, xTplName, xAppl);
051:
052: pem_string = xString;
053:
054: this .pcmf_setView(pem_view);
055: this .pcmf_setValue(xValue);
056:
057: return;
058: };
059:
060: // @@
061:
062: public void pcmf_setWrap(boolean xWrap) {
063: this .pem_wrap = xWrap;
064: }
065:
066: public boolean pcmf_getWrap() {
067: return (this .pem_wrap);
068: }
069:
070: public String pcmf_getLabel() {
071: return (pem_string);
072: };
073:
074: public void pcmf_setLabel(String xLabel) {
075: if (xLabel.equals(this .pem_string))
076: return;
077:
078: this .pem_string = xLabel;
079: this .pcmf_setPropChanged(true);
080: };
081:
082: public void pcmf_setIcon(IUnImage xIcon) {
083: if (xIcon == this .pdm_icon)
084: return;
085:
086: if (this .pdm_icon != null)
087: this .pdm_icon.pcmf_detach();
088:
089: this .pdm_icon = xIcon;
090: this .pdm_icon.pcmf_attach();
091:
092: this .pcmf_setPropChanged(true);
093: }
094:
095: public IUnImage pcmf_getIcon() {
096: return (this .pdm_icon);
097: }
098:
099: private boolean pem_readOnly = false;
100:
101: public void pcmf_setReadOnly(boolean xReadOnly) {
102: if (this .pem_readOnly == xReadOnly)
103: return;
104:
105: this .pem_readOnly = xReadOnly;
106: this .pcmf_setPropChanged(true);
107: }
108:
109: public boolean pcmf_isReadOnly() {
110: return (this .pem_readOnly);
111: }
112:
113: public void pcmf_delete() throws Exception {
114: if (this .pdm_deleted == true)
115: return;
116:
117: if (this .pdm_icon != null) {
118: this .pdm_icon.pcmf_detach();
119: this .pdm_icon.pcmf_getUnComponent().pcmf_delete();
120: }
121:
122: super .pcmf_delete();
123: }
124:
125: public void pcmf_setKeyAccess(int xKey) {
126: if (this .pdm_accKey == (char) xKey)
127: return;
128:
129: this .pdm_accKey = (char) xKey;
130: this .pcmf_setPropChanged(true);
131: };
132:
133: public int pcmf_getAccKey() {
134: return (this .pdm_accKey);
135: }
136:
137: // @@
138: };
|