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.channel.markup.generic;
032:
033: import de.ug2t.channel.markup.html.renderer.*;
034: import de.ug2t.connector.*;
035: import de.ug2t.kernel.*;
036: import de.ug2t.unifiedGui.interfaces.*;
037: import de.ug2t.unifiedGui.views.*;
038:
039: public final class MuGenericLabel extends MuGenericComponent implements
040: IUnLabel, IKePoolable {
041: private IKeView pem_view = new HtmlLabelRenderer();
042: private MuGenericImage pem_icon = null;
043: private boolean pem_forcedInline = false;
044: private boolean pem_dynamic = true;
045: private boolean pem_wrap = true;
046:
047: public MuGenericLabel(String xID, String xValue,
048: ACoDataGetter xTplGetter, Object xTplName,
049: MuGenericApplication xAppl) throws Exception {
050: super (xID, xTplGetter, xTplName, xAppl);
051:
052: this .pcmf_setView(pem_view);
053: this .pcmf_setValue(xValue);
054:
055: return;
056: };
057:
058: // @@
059:
060: public void pcmf_setValue(Object xValue) {
061: if (xValue instanceof IKeViewable) {
062: Object l_view = ((IKeViewable) xValue).pcmf_getView();
063: if (l_view instanceof UnIconValueView)
064: ((UnIconValueView) l_view).pcmf_applyStdView(this );
065: } else if (this .pcmf_getValue() instanceof IKeViewable) {
066: Object l_view = ((IKeViewable) this .pcmf_getValue())
067: .pcmf_getView();
068: if (l_view instanceof UnIconValueView)
069: ((UnIconValueView) l_view).pcmf_restStdView(this );
070: }
071:
072: super .pcmf_setValue(xValue);
073:
074: return;
075: };
076:
077: private int pem_talign = IUnInputField.TEXT_ALIGN_WEST;
078:
079: public void pcmf_setTextAlign(int xAlign) {
080: this .pem_talign = xAlign;
081: }
082:
083: public int pcmf_getTextAlign() {
084: return (this .pem_talign);
085: }
086:
087: public void pcmf_setIcon(IUnImage xIcon) {
088: if (xIcon == this .pem_icon)
089: return;
090:
091: if (this .pem_icon != null)
092: this .pem_icon.pcmf_detach();
093:
094: this .pem_icon = (MuGenericImage) xIcon;
095:
096: if (this .pem_icon != null)
097: this .pem_icon.pcmf_attach();
098:
099: this .pcmf_setPropChanged(true);
100: }
101:
102: public IUnImage pcmf_getIcon() {
103: return (this .pem_icon);
104: }
105:
106: public void pcmf_setWrap(boolean xWrap) {
107: this .pem_wrap = xWrap;
108: }
109:
110: public boolean pcmf_getWrap() {
111: return (this .pem_wrap);
112: }
113:
114: public void pcmf_forceInline(boolean xInline) {
115: this .pem_forcedInline = xInline;
116: }
117:
118: public boolean pcmf_isInlineForced() {
119: return (this .pem_forcedInline);
120: }
121:
122: public void pcmf_delete() throws Exception {
123: if (this .pdm_deleted == true)
124: return;
125:
126: if (this .pem_icon != null) {
127: this .pem_icon.pcmf_detach();
128: this .pem_icon.pcmf_getUnComponent().pcmf_delete();
129: }
130:
131: super .pcmf_delete();
132: }
133:
134: public void pcmf_setDynamic(boolean xDyn) {
135: this .pem_dynamic = xDyn;
136: }
137:
138: public boolean pcmf_isDynamic() {
139: return (this .pem_dynamic);
140: }
141:
142: // @@
143: }
|