001: // @@
002: // @@
003: /*
004: * Wi.Ser Framework
005: *
006: * LGPL Version: 1.8.1, 20-September-2007
007: * Copyright (C) 2005-2006 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.ho.server.generic;
032:
033: import de.ug2t.kernel.*;
034: import de.ug2t.unifiedGui.interfaces.*;
035: import de.ug2t.xmlScript.*;
036:
037: public final class HoSrvGenericButton extends AHoSrvGenericComponent
038: implements IUnButton {
039: private int pem_accKey = 0;
040: private IUnImage pem_icon = null;
041:
042: public HoSrvGenericButton(String xValue, IUnApplication xAppl,
043: String xClass) throws Exception {
044: super (xValue);
045: this .pcmf_setAppl(xAppl);
046: this .pcmf_setLocalValue(xValue);
047: this .pcmf_setEventOnChange(true);
048: this .pcmf_setAutoEcho(false);
049:
050: if (xClass == null)
051: pdm_clientClass = "de.ug2t.channel.ho.client.swing.HoSwingButton";
052: else
053: pdm_clientClass = xClass;
054:
055: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
056: "");
057:
058: if (this .pdm_session.pcmf_isInTransaction()) {
059: ScXmlScript.pcmf_createPBody(l_remCall);
060: } else {
061: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
062: ScXmlScript.pcmf_addProc(l_remCall, null);
063: }
064: ;
065: ScXmlScript.pcmf_addDecl(l_remCall, this .pcmf_getRemName(),
066: this .pdm_clientClass, "global");
067: ScXmlScript.pcmf_addDeclPar(l_remCall, xValue, "false",
068: "java.lang.String");
069: ScXmlScript.pcmf_addDeclPar(l_remCall,
070: ((HoSrvGenericApplication) xAppl).pcmf_getRemName(),
071: "true", "de.ug2t.unifiedGui.interfaces.IUnApplication");
072:
073: ScXmlScript.pcmf_endAll(l_remCall);
074:
075: this .pdm_session.pcmf_call(l_remCall.toString(), this );
076: this .pcmf_enableSubmit();
077: return;
078: };
079:
080: public AHoSrvGenericComponent pcmf_buildRefObj() throws Exception {
081: AHoSrvGenericComponent l_obj = new HoSrvGenericButton(this
082: .pcmf_getValue().toString(), this .pcmf_getAppl(),
083: this .pdm_clientClass);
084: l_obj.pcmf_setGlobal(true);
085: this .pcmf_setGlobal(true);
086: l_obj.pcmf_setAutoEcho(this .pcmf_doAutoEcho());
087: l_obj.pcmf_setRefFrom(this );
088: this .pcmf_addRef(l_obj);
089:
090: return l_obj;
091: };
092:
093: public void pcmf_setIcon(IUnImage xIcon) {
094: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
095: "");
096:
097: if (this .pdm_session.pcmf_isInTransaction()) {
098: ScXmlScript.pcmf_createPBody(l_remCall);
099: } else {
100: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
101: ScXmlScript.pcmf_addProc(l_remCall, null);
102: }
103: ;
104: ScXmlScript.pcmf_addCall(l_remCall, null, this
105: .pcmf_getRemName(), "pcmf_setIcon");
106: ScXmlScript.pcmf_addCallPar(l_remCall, xIcon
107: .pcmf_getUnComponent().pcmf_getRemName(), "true",
108: "de.ug2t.unifiedGui.interfaces.IUnImage");
109: ScXmlScript.pcmf_endAll(l_remCall);
110:
111: this .pdm_session.pcmf_call(l_remCall.toString(), this );
112:
113: if (this .pem_icon != null)
114: this .pem_icon.pcmf_detach();
115:
116: this .pem_icon = xIcon;
117: this .pem_icon.pcmf_attach();
118: }
119:
120: public IUnImage pcmf_getIcon() {
121: return (this .pem_icon);
122: };
123:
124: public void pcmf_setKeyAccess(int xKey) {
125: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
126: "");
127:
128: if (this .pdm_session.pcmf_isInTransaction()) {
129: ScXmlScript.pcmf_createPBody(l_remCall);
130: } else {
131: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
132: ScXmlScript.pcmf_addProc(l_remCall, null);
133: }
134: ;
135: ScXmlScript.pcmf_addCall(l_remCall, null, this
136: .pcmf_getRemName(), "pcmf_setKeyAccess");
137: ScXmlScript.pcmf_addCallPar(l_remCall, Integer.toString(xKey),
138: "false", "int");
139: ScXmlScript.pcmf_endAll(l_remCall);
140:
141: this .pdm_session.pcmf_call(l_remCall.toString(), this );
142:
143: this .pem_accKey = xKey;
144: };
145:
146: public int pcmf_getAccKey() {
147: return (this .pem_accKey);
148: }
149:
150: private boolean pem_readOnly = false;
151:
152: public void pcmf_setReadOnly(boolean xReadOnly) {
153: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
154: "");
155:
156: if (this .pdm_session.pcmf_isInTransaction()) {
157: ScXmlScript.pcmf_createPBody(l_remCall);
158: } else {
159: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
160: ScXmlScript.pcmf_addProc(l_remCall, null);
161: }
162: ;
163: ScXmlScript.pcmf_addCall(l_remCall, null, this
164: .pcmf_getRemName(), "pcmf_setReadOnly");
165: ScXmlScript.pcmf_addCallPar(l_remCall, Boolean
166: .toString(xReadOnly), "false", "boolean");
167: ScXmlScript.pcmf_endAll(l_remCall);
168:
169: this .pdm_session.pcmf_call(l_remCall.toString(), this );
170: this .pem_readOnly = xReadOnly;
171: }
172:
173: public boolean pcmf_isReadOnly() {
174: return (this .pem_readOnly);
175: }
176:
177: public void pcmf_delete() throws Exception {
178: if (this .pdm_deleted == true)
179: return;
180:
181: if (this.pem_icon != null) {
182: this.pem_icon.pcmf_detach();
183: this.pem_icon.pcmf_getUnComponent().pcmf_delete();
184: }
185:
186: super.pcmf_delete();
187: }
188: }
|