01: /*
02: ItsNat Java Web Application Framework
03: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
04: Author: Jose Maria Arranz Santamaria
05:
06: This program is free software: you can redistribute it and/or modify
07: it under the terms of the GNU Affero General Public License as published by
08: the Free Software Foundation, either version 3 of the License, or
09: (at your option) any later version. See the GNU Affero General Public
10: License for more details. See the copy of the GNU Affero General Public License
11: included in this program. If not, see <http://www.gnu.org/licenses/>.
12: */
13:
14: package org.itsnat.impl.comp.ui.free;
15:
16: import org.itsnat.comp.ItsNatListStructure;
17: import org.itsnat.comp.free.ItsNatFreeList;
18: import org.itsnat.core.domutil.ListElementInfo;
19: import org.itsnat.impl.comp.ui.ItsNatListStructureCoreAdapterImpl;
20: import org.itsnat.impl.comp.free.ItsNatFreeListImpl;
21: import org.itsnat.impl.comp.ui.*;
22: import org.itsnat.impl.core.ItsNatDocumentImpl;
23: import org.itsnat.impl.core.domutil.ElementListBaseImpl;
24: import org.itsnat.impl.core.domutil.ElementListImpl;
25: import org.w3c.dom.Element;
26: import org.w3c.dom.Node;
27:
28: /**
29: *
30: * @author jmarranz
31: */
32: public abstract class ItsNatFreeListUIImpl extends ItsNatListUIImpl {
33: protected boolean enabled = true;
34:
35: /**
36: * Creates a new instance of ItsNatFreeListUIImpl
37: */
38: public ItsNatFreeListUIImpl(ItsNatFreeListImpl parentComp) {
39: super (parentComp);
40:
41: Element parentElement = getElement();
42:
43: ItsNatListStructure structure = parentComp
44: .getItsNatListStructure();
45: ItsNatListStructureCoreAdapterImpl structAdapter;
46: structAdapter = new ItsNatListStructureCoreAdapterImpl(
47: structure, parentComp);
48:
49: ItsNatDocumentImpl itsNatDoc = getItsNatDocumentImpl();
50: this .elementList = itsNatDoc.createElementListInternal(
51: parentElement, true, structAdapter, null);
52: }
53:
54: public ItsNatFreeList getItsNatFreeListBase() {
55: return (ItsNatFreeList) parentComp;
56: }
57:
58: public Element getContentElementAt(int index, Element optionElem) {
59: ItsNatFreeList list = getItsNatFreeListBase();
60: return list.getItsNatListStructure().getContentElement(list,
61: index, optionElem);
62: }
63:
64: public void setEnabled(boolean b) {
65: this .enabled = b;
66: }
67:
68: public boolean isEnabled() {
69: return enabled;
70: }
71: }
|