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;
032:
033: import de.ug2t.channel.ho.client.swing.*;
034: import de.ug2t.channel.ho.session.*;
035: import de.ug2t.kernel.*;
036: import de.ug2t.unifiedGui.interfaces.*;
037:
038: public final class HoDelayedCall
039:
040: {
041: private int pem_delay = 200;
042: private IHoSession pem_session = null;
043: private String pem_call = null;
044: private volatile boolean pem_run = false;
045: private volatile boolean pem_ready = false;
046: private IUnComponent pem_submit = null;
047: private String pem_submitValue = null;
048: private static Object pem_mutex = new Object();
049: private boolean pem_testSubmit = false;
050: private boolean pem_refresh = false;
051:
052: public HoDelayedCall(String xCall, IHoSession xSession, int xDelay) {
053: this .pem_call = xCall;
054: this .pem_session = xSession;
055: this .pem_delay = xDelay;
056:
057: // @@
058:
059: if (this .pem_call != null)
060: this .pem_session.pcmf_call(this .pem_call);
061:
062: this .pcmf_doSubmit();
063: this .pem_ready = true;
064: }
065:
066: public HoDelayedCall(String xCall, IHoSession xSession, int xDelay,
067: IUnComponent xSubmit, boolean xRefresh) {
068: this .pem_call = xCall;
069: this .pem_session = xSession;
070: this .pem_delay = xDelay;
071: this .pem_submit = xSubmit;
072: Object l_value = xSubmit.pcmf_getValue();
073: this .pem_submitValue = l_value != null ? l_value.toString()
074: : null;
075: this .pem_testSubmit = true;
076: this .pem_refresh = xRefresh;
077:
078: // @@
079:
080: if (this .pem_call != null)
081: this .pem_session.pcmf_call(this .pem_call);
082:
083: this .pcmf_doSubmit();
084: this .pem_ready = true;
085: }
086:
087: public HoDelayedCall(String xCall, IHoSession xSession, int xDelay,
088: IUnComponent xSubmit, String xSubmitVal) {
089: this .pem_call = xCall;
090: this .pem_session = xSession;
091: this .pem_delay = xDelay;
092: this .pem_submit = xSubmit;
093: this .pem_submitValue = xSubmitVal;
094: this .pem_testSubmit = true;
095: this .pem_refresh = true;
096:
097: // @@
098:
099: if (this .pem_call != null)
100: this .pem_session.pcmf_call(this .pem_call);
101:
102: this .pcmf_doSubmit();
103: this .pem_ready = true;
104: }
105:
106: public synchronized void pcmf_refreshCall(String xCall) {
107: // @@
108: }
109:
110: public synchronized void pcmf_refreshCall(String xCall,
111: String xSubmitVal) {
112: // @@
113: }
114:
115: // @@
116:
117: public synchronized boolean pcmf_isReady() {
118: return this .pem_ready;
119: }
120:
121: private void pcmf_doSubmit() {
122: if (this .pem_testSubmit) {
123: IUnApplication l_appl = this .pem_submit.pcmf_getAppl();
124: if (l_appl == null
125: && this .pem_submit instanceof IUnEventChannel)
126: l_appl = ((IUnComponent) this .pem_submit
127: .pcmf_getUnComponent().pcmf_getParentNode())
128: .pcmf_getAppl();
129:
130: if (this .pem_refresh) {
131: if (this .pem_submit instanceof IUnApplication)
132: ((HoSwingPage) l_appl.pcmf_getActive())
133: .pcmf_setSubmitValue(
134: IUnApplication.MY_APPL,
135: this .pem_submitValue);
136: else
137: ((HoSwingPage) l_appl.pcmf_getActive())
138: .pcmf_setSubmitValue(this .pem_submit
139: .pcmf_getUnComponent()
140: .pcmf_getObjName(),
141: this .pem_submitValue);
142: }
143: if (this .pem_submit != null
144: && this .pem_submit.pcmf_isSubmit())
145: ((HoSwingPage) l_appl.pcmf_getActive()).pcmf_submit();
146: }
147: }
148: }
|