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 MuGenericButton extends MuGenericComponent implements
039: IUnButton, IKePoolable {
040: protected char pdm_accKey = ' ';
041: private IKeView pem_view = new HtmlButtonRenderer();
042: protected IUnImage pdm_icon = null;
043:
044: public MuGenericButton(String xValue, ACoDataGetter xTplGetter,
045: Object xTplName, MuGenericApplication xAppl)
046: throws Exception {
047: super (xValue, xTplGetter, xTplName, xAppl);
048:
049: this .pcmf_setEventOnChange(true);
050: this .pcmf_setView(pem_view);
051: this .pcmf_setValue(xValue);
052:
053: String l_bg = this .pdm_kit.getBUT_BG();
054: if (l_bg.trim().equals("") == false)
055: this .pcmf_setBgColor(l_bg);
056:
057: return;
058: };
059:
060: // @@
061:
062: public void pcmf_setIcon(IUnImage xIcon) {
063: if (xIcon == this .pdm_icon)
064: return;
065:
066: if (this .pdm_icon != null)
067: this .pdm_icon.pcmf_detach();
068:
069: this .pdm_icon = xIcon;
070: this .pdm_icon.pcmf_attach();
071:
072: this .pcmf_setPropChanged(true);
073: }
074:
075: public IUnImage pcmf_getIcon() {
076: return (this .pdm_icon);
077: }
078:
079: public void pcmf_setKeyAccess(int xKey) {
080: if (this .pdm_accKey == (char) xKey)
081: return;
082:
083: this .pdm_accKey = (char) xKey;
084: this .pcmf_setPropChanged(true);
085: };
086:
087: public int pcmf_getAccKey() {
088: return (this .pdm_accKey);
089: }
090:
091: private boolean pem_readOnly = false;
092:
093: public void pcmf_setReadOnly(boolean xReadOnly) {
094: if (this .pem_readOnly == xReadOnly)
095: return;
096:
097: this .pem_readOnly = xReadOnly;
098: this .pcmf_setPropChanged(true);
099: }
100:
101: public boolean pcmf_isReadOnly() {
102: return (this .pem_readOnly);
103: }
104:
105: public void pcmf_delete() throws Exception {
106: if (this .pdm_deleted == true)
107: return;
108:
109: if (this .pdm_icon != null) {
110: this .pdm_icon.pcmf_detach();
111: this .pdm_icon.pcmf_getUnComponent().pcmf_delete();
112: }
113:
114: super .pcmf_delete();
115: }
116:
117: // @@
118: };
|