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.client.swing;
032:
033: import javax.swing.*;
034:
035: import de.ug2t.unifiedGui.*;
036: import de.ug2t.unifiedGui.interfaces.*;
037:
038: public final class HoSwingOptionDialog extends HoSwingComponent
039: implements IUnOptionDialog {
040:
041: /**
042: *
043: */
044: public HoSwingOptionDialog(String xName, IUnApplication xAppl)
045: throws Exception {
046: super (xName, xAppl);
047: this .pcmf_setEventOnChange(true);
048: }
049:
050: public void pcmf_showAlert(String xMessage) {
051: JOptionPane.showMessageDialog(null, xMessage);
052: ((HoSwingPage) this .pcmf_getAppl().pcmf_getActive())
053: .pcmf_setSubmitValue(this .pcmf_getObjName(),
054: IUnOptionDialog.DLG_CONFIRMED);
055: this .pcmf_addSyncedWidgets((HoSwingPage) this .pcmf_getAppl()
056: .pcmf_getActive(), this );
057: if (this .pcmf_isSubmit() && !this .pcmf_isDeleted())
058: ((HoSwingPage) this .pcmf_getAppl().pcmf_getActive())
059: .pcmf_submit();
060: }
061:
062: public void pcmf_showOption(String xMessage) {
063: int l_ret = JOptionPane.showConfirmDialog(null, xMessage);
064:
065: if (l_ret == JOptionPane.YES_OPTION)
066: ((HoSwingPage) this .pcmf_getAppl().pcmf_getActive())
067: .pcmf_setSubmitValue(this .pcmf_getObjName(),
068: IUnOptionDialog.DLG_CONFIRMED);
069: else if (l_ret == JOptionPane.CANCEL_OPTION)
070: ((HoSwingPage) this .pcmf_getAppl().pcmf_getActive())
071: .pcmf_setSubmitValue(this .pcmf_getObjName(),
072: IUnOptionDialog.DLG_CANCELED);
073: else if (l_ret == JOptionPane.NO_OPTION)
074: ((HoSwingPage) this .pcmf_getAppl().pcmf_getActive())
075: .pcmf_setSubmitValue(this .pcmf_getObjName(),
076: IUnOptionDialog.DLG_NOTCONFIRMED);
077:
078: this .pcmf_addSyncedWidgets((HoSwingPage) this .pcmf_getAppl()
079: .pcmf_getActive(), this );
080:
081: if (this .pcmf_isSubmit() && !this .pcmf_isDeleted())
082: ((HoSwingPage) this .pcmf_getAppl().pcmf_getActive())
083: .pcmf_submit();
084:
085: }
086:
087: public void pcmf_showTextInput(String xMessage) {
088: String l_ret = JOptionPane.showInputDialog(null, xMessage);
089:
090: ((HoSwingPage) this .pcmf_getAppl().pcmf_getActive())
091: .pcmf_setSubmitValue(this .pcmf_getObjName(),
092: l_ret == null ? "" : l_ret);
093: this .pcmf_addSyncedWidgets((HoSwingPage) this .pcmf_getAppl()
094: .pcmf_getActive(), this );
095: if (this .pcmf_isSubmit() && !this .pcmf_isDeleted())
096: ((HoSwingPage) this .pcmf_getAppl().pcmf_getActive())
097: .pcmf_submit();
098: }
099:
100: public void pcmf_disable() {
101: return;
102: };
103:
104: public void pcmf_enable() {
105: return;
106: };
107:
108: public void pcmf_setFont(UnFontDescriptor xFont) {
109: return;
110: }
111: }
|