01: /*
02: * Copyright 2006 Luca Garulli (luca.garulli@assetdata.it)
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.romaframework.aspect.view.echo2.component;
18:
19: import org.romaframework.aspect.view.form.ContentComponent;
20: import org.romaframework.core.schema.SchemaField;
21: import org.romaframework.core.schema.SchemaObject;
22:
23: import echopointng.ContainerEx;
24:
25: public abstract class AbstractContentComponent extends ContainerEx
26: implements ContentComponent {
27:
28: public AbstractContentComponent(ContentComponent iParent) {
29: containerComponent = iParent;
30: }
31:
32: public void destroy() {
33: schemaInstance = null;
34: schemaField = null;
35: content = null;
36: }
37:
38: public void close() {
39: }
40:
41: public void render() {
42: render(this );
43: }
44:
45: public void renderContent() {
46: }
47:
48: public ContentComponent getContainerComponent() {
49: return containerComponent;
50: }
51:
52: public void setMetaDataSchema(SchemaObject iSchema) {
53: schemaInstance = iSchema;
54: }
55:
56: public void setMetaDataField(SchemaField iField) {
57: schemaField = iField;
58: }
59:
60: public SchemaObject getSchemaInstance() {
61: return schemaInstance;
62: }
63:
64: public SchemaField getSchemaField() {
65: return schemaField;
66: }
67:
68: public Object getContent() {
69: return content;
70: }
71:
72: public void setContent(Object content) {
73: this .content = content;
74: }
75:
76: public void bind(SchemaField iSchemaField, Object iValue) {
77: bind(iSchemaField, iValue, null);
78: }
79:
80: public void bind(SchemaField iSchemaField, Object iValue,
81: Object iComponent) {
82: containerComponent.bind(iSchemaField, iValue, iComponent);
83: }
84:
85: public void handleException(Throwable t) {
86: containerComponent.handleException(t);
87: }
88:
89: protected ContentComponent containerComponent;
90: protected SchemaObject schemaInstance;
91: protected SchemaField schemaField;
92: protected Object content;
93: }
|