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 HoSrvGenericLabel extends AHoSrvGenericComponent
038: implements IUnLabel {
039: private IUnImage pem_icon = null;
040: private boolean pem_isAutoRepaintLabel = false;
041: private boolean pem_dynamic = true;
042: private boolean pem_forcedInline = false;
043:
044: public HoSrvGenericLabel(String xName, String xValue,
045: IUnApplication xAppl, String xClass) throws Exception {
046: super (xName);
047: this .pcmf_setAppl(xAppl);
048: this .pcmf_setLocalValue(xValue);
049:
050: if (xClass == null)
051: pdm_clientClass = "de.ug2t.channel.ho.client.swing.HoSwingLabel";
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, xName, "false",
068: "java.lang.String");
069:
070: Object l_obj = KeTools.pcmf_deRef(xValue, null);
071: if (l_obj != null) {
072: ScXmlScript.pcmf_addDeclPar(l_remCall, l_obj.toString(),
073: "false", "java.lang.String");
074:
075: // @@
076: } else
077: ScXmlScript.pcmf_addDeclPar(l_remCall, xValue, "false",
078: "java.lang.String");
079:
080: ScXmlScript.pcmf_addDeclPar(l_remCall,
081: ((HoSrvGenericApplication) xAppl).pcmf_getRemName(),
082: "true", "de.ug2t.unifiedGui.interfaces.IUnApplication");
083:
084: ScXmlScript.pcmf_endAll(l_remCall);
085:
086: this .pdm_session.pcmf_call(l_remCall.toString(), this );
087:
088: return;
089: };
090:
091: private int pem_talign = IUnInputField.TEXT_ALIGN_WEST;
092:
093: public void pcmf_setTextAlign(int xAlign) {
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_setTextAlign");
106: ScXmlScript.pcmf_addCallPar(l_remCall,
107: Integer.toString(xAlign), "false", "int");
108: ScXmlScript.pcmf_endAll(l_remCall);
109:
110: this .pdm_session.pcmf_call(l_remCall.toString(), this );
111:
112: this .pem_talign = xAlign;
113: }
114:
115: public int pcmf_getTextAlign() {
116: return (this .pem_talign);
117: }
118:
119: public AHoSrvGenericComponent pcmf_buildRefObj() throws Exception {
120: AHoSrvGenericComponent l_obj = new HoSrvGenericLabel(this
121: .pcmf_getName(), this .pcmf_getValue().toString(), this
122: .pcmf_getAppl(), this .pdm_clientClass);
123: l_obj.pcmf_setGlobal(true);
124: l_obj.pcmf_setRefFrom(this );
125: l_obj.pcmf_setAutoEcho(this .pcmf_doAutoEcho());
126: this .pcmf_setGlobal(true);
127: this .pcmf_addRef(l_obj);
128:
129: return l_obj;
130: };
131:
132: public void pcmf_setIcon(IUnImage xIcon) {
133: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
134: "");
135:
136: if (this .pdm_session.pcmf_isInTransaction()) {
137: ScXmlScript.pcmf_createPBody(l_remCall);
138: } else {
139: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
140: ScXmlScript.pcmf_addProc(l_remCall, null);
141: }
142: ;
143: ScXmlScript.pcmf_addCall(l_remCall, null, this
144: .pcmf_getRemName(), "pcmf_setIcon");
145:
146: if (xIcon != null)
147: ScXmlScript.pcmf_addCallPar(l_remCall, xIcon
148: .pcmf_getUnComponent().pcmf_getRemName(), "true",
149: "de.ug2t.unifiedGui.interfaces.IUnImage");
150: else
151: ScXmlScript.pcmf_addCallPar(l_remCall, "null", "true",
152: "de.ug2t.unifiedGui.interfaces.IUnImage");
153:
154: ScXmlScript.pcmf_endAll(l_remCall);
155:
156: this .pdm_session.pcmf_call(l_remCall.toString(), this );
157:
158: if (this .pem_icon != null)
159: this .pem_icon.pcmf_detach();
160:
161: this .pem_icon = xIcon;
162: if (this .pem_icon != null)
163: this .pem_icon.pcmf_attach();
164: };
165:
166: public IUnImage pcmf_getIcon() {
167: return (this .pem_icon);
168: };
169:
170: public void pcmf_setDynamic(boolean xDyn) {
171: // @@
172: }
173:
174: public boolean pcmf_isDynamic() {
175: return (this .pem_dynamic);
176: }
177:
178: public void pcmf_delete() throws Exception {
179: if (this .pdm_deleted == true)
180: return;
181:
182: if (this .pem_icon != null) {
183: this .pem_icon.pcmf_detach();
184: this .pem_icon.pcmf_getUnComponent().pcmf_delete();
185: }
186:
187: // @@
188:
189: super .pcmf_delete();
190: }
191:
192: public void pcmf_setValue(Object xValue) {
193: // @@
194:
195: Object l_obj = KeTools.pcmf_deRef(xValue.toString(), null);
196: if (l_obj != null) {
197: this .pcmf_setRemoteValue(l_obj);
198: this .pcmf_setLocalValue(xValue);
199:
200: // @@
201:
202: } else {
203: // @@
204:
205: super .pcmf_setValue(xValue);
206: }
207: }
208:
209: public void pcmf_forceInline(boolean xInline) {
210: return;
211: }
212:
213: public boolean pcmf_isInlineForced() {
214: return (this.pem_forcedInline);
215: }
216: }
|