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 class HoSrvGenericLink extends AHoSrvGenericComponent implements
038: IUnLink {
039: private int pem_accKey = 0;
040: private IUnImage pem_icon = null;
041:
042: public HoSrvGenericLink(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.HoSwingLink";
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 HoSrvGenericLink(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 void pcmf_setKeyAccess(int xKey) {
121: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
122: "");
123:
124: if (this .pdm_session.pcmf_isInTransaction()) {
125: ScXmlScript.pcmf_createPBody(l_remCall);
126: } else {
127: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
128: ScXmlScript.pcmf_addProc(l_remCall, null);
129: }
130: ;
131: ScXmlScript.pcmf_addCall(l_remCall, null, this
132: .pcmf_getRemName(), "pcmf_setKeyAccess");
133: ScXmlScript.pcmf_addCallPar(l_remCall, Integer.toString(xKey),
134: "false", "int");
135: ScXmlScript.pcmf_endAll(l_remCall);
136:
137: this .pdm_session.pcmf_call(l_remCall.toString(), this );
138:
139: this .pem_accKey = xKey;
140: };
141:
142: public int pcmf_getAccKey() {
143: return (this .pem_accKey);
144: }
145:
146: public IUnImage pcmf_getIcon() {
147: return (this .pem_icon);
148: };
149:
150: public void pcmf_delete() throws Exception {
151: if (this .pdm_deleted == true)
152: return;
153:
154: if (this .pem_icon != null) {
155: this .pem_icon.pcmf_detach();
156: this .pem_icon.pcmf_getUnComponent().pcmf_delete();
157: }
158:
159: super .pcmf_delete();
160: }
161:
162: private int pem_talign = IUnInputField.TEXT_ALIGN_WEST;
163:
164: public void pcmf_setTextAlign(int xAlign) {
165: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
166: "");
167:
168: if (this .pdm_session.pcmf_isInTransaction()) {
169: ScXmlScript.pcmf_createPBody(l_remCall);
170: } else {
171: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
172: ScXmlScript.pcmf_addProc(l_remCall, null);
173: }
174: ;
175: ScXmlScript.pcmf_addCall(l_remCall, null, this
176: .pcmf_getRemName(), "pcmf_setTextAlign");
177: ScXmlScript.pcmf_addCallPar(l_remCall,
178: Integer.toString(xAlign), "false", "int");
179: ScXmlScript.pcmf_endAll(l_remCall);
180:
181: this .pdm_session.pcmf_call(l_remCall.toString(), this );
182:
183: this .pem_talign = xAlign;
184: }
185:
186: public int pcmf_getTextAlign() {
187: return (this.pem_talign);
188: }
189: }
|