001: // @@
002: // @@
003: /*
004: * Wi.Ser Framework
005: *
006: * Version: 1.8.1, 20-September-2007
007: * Copyright (C) 2005 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.kernel;
032:
033: import de.ug2t.unifiedGui.*;
034: import de.ug2t.unifiedGui.interfaces.*;
035: import de.ug2t.unifiedGui.views.*;
036:
037: public interface IKeViewable {
038: public static boolean pdm_cloneCompleteViews = false;
039:
040: public static class ViewTools {
041: public static IKeView pcmf_cloneViewToLocal(IKeViewable xValue,
042: IKeView xView) {
043: boolean l_reg = true;
044: if (!KeRegisteredObject.pcmf_isLocal(xValue)
045: && xView instanceof UnIconValueView) {
046: UnIconValueView l_view = (UnIconValueView) xView;
047: IUnImage l_clOImg = l_view.pcmf_getCloseIcon();
048: IUnImage l_opOImg = l_view.pcmf_getOpenIcon();
049: IUnImage l_stdOImg = l_view.pcmf_getStdIcon();
050: UnFontDescriptor l_font = l_view.pcmf_getFontDesc();
051:
052: if (!pdm_cloneCompleteViews && l_font == null
053: && l_clOImg == null && l_opOImg == null
054: && l_stdOImg == null) {
055: xValue.pcmf_setView(xView);
056: return (xView);
057: }
058:
059: try {
060: if (!KeRegisteredObject.pcmf_getRegister()) {
061: l_reg = false;
062: KeRegisteredObject.pcmf_setRegister(true);
063: }
064:
065: if (l_font != null && (!l_font.pcmf_isLocal())) {
066: String l_name = l_font.pcmf_getObjName();
067: l_font = l_font.pcmf_clone();
068: l_font.pcmf_reRegister(l_name);
069: l_font.pcmf_setEarlyAutoDelete(true);
070: }
071:
072: if (l_clOImg != null
073: && (!l_clOImg.pcmf_getUnComponent()
074: .pcmf_isLocal())) {
075: String l_name = l_clOImg.pcmf_getUnComponent()
076: .pcmf_getObjName();
077: l_clOImg = l_clOImg.pcmf_clone();
078: l_clOImg.pcmf_getUnComponent().pcmf_reRegister(
079: l_name);
080: l_clOImg.pcmf_getUnComponent()
081: .pcmf_setEarlyAutoDelete(true);
082: }
083:
084: if (l_opOImg != null
085: && (!l_opOImg.pcmf_getUnComponent()
086: .pcmf_isLocal())) {
087: String l_name = l_opOImg.pcmf_getUnComponent()
088: .pcmf_getObjName();
089: l_opOImg = l_opOImg.pcmf_clone();
090: l_opOImg.pcmf_getUnComponent().pcmf_reRegister(
091: l_name);
092: l_opOImg.pcmf_getUnComponent()
093: .pcmf_setEarlyAutoDelete(true);
094: }
095:
096: if (l_stdOImg != null
097: && (!l_stdOImg.pcmf_getUnComponent()
098: .pcmf_isLocal())) {
099: String l_name = l_stdOImg.pcmf_getUnComponent()
100: .pcmf_getObjName();
101: l_stdOImg = l_stdOImg.pcmf_clone();
102: l_stdOImg.pcmf_getUnComponent()
103: .pcmf_reRegister(l_name);
104: l_stdOImg.pcmf_getUnComponent()
105: .pcmf_setEarlyAutoDelete(true);
106: }
107:
108: UnIconValueView l_new = new UnIconValueView(
109: l_stdOImg, l_opOImg, l_clOImg, l_font,
110: l_view.pcmf_getTpl(), l_view
111: .pcmf_getTransformer());
112: l_new.pcmf_setBg(l_view.pcmf_getBg());
113: l_new.pcmf_setFg(l_view.pcmf_getFg());
114: l_new.pcmf_setCss(l_view.pcmf_getCss());
115:
116: l_new.pcmf_setEarlyAutoDelete(true);
117:
118: if (!l_reg)
119: KeRegisteredObject.pcmf_setRegister(false);
120:
121: return (l_new);
122: } catch (Exception e) {
123: if (!l_reg)
124: KeRegisteredObject.pcmf_setRegister(false);
125: } catch (Throwable t) {
126: if (!l_reg)
127: KeRegisteredObject.pcmf_setRegister(false);
128: }
129: return (null);
130: } else {
131: xValue.pcmf_setView(xView);
132: return (xView);
133: }
134: }
135: }
136:
137: public IKeView pcmf_getView();
138:
139: public Object pcmf_execView();
140:
141: public void pcmf_setView(IKeView xView);
142: }
|