01: package org.osbl.client.wings.form;
02:
03: import org.osbl.client.wings.form.ObjectForm;
04: import org.osbl.client.wings.form.DelegateEnvironment;
05: import org.osbl.client.wings.shell.Environment;
06: import org.wings.SComponent;
07:
08: public abstract class NestedObjectForm implements ObjectForm,
09: ObjectContextAware {
10: protected ObjectForm nestedForm;
11: protected Object object;
12: protected ObjectContext context;
13:
14: protected DelegateEnvironment nestedEnvironment = new DelegateEnvironment();
15: protected DelegateEnvironment environment = new DelegateEnvironment();
16: {
17: environment.setNestedEnvironment(nestedEnvironment);
18: }
19:
20: public Environment getEnvironment() {
21: return environment;
22: }
23:
24: public ObjectContext getContext() {
25: if (context == null) {
26: System.out.println("new context: " + context);
27: context = new ObjectContext();
28: }
29: return context;
30: }
31:
32: public void setContext(ObjectContext context) {
33: this .context = context;
34: }
35:
36: public Object getObject() {
37: return object;
38: }
39:
40: public void setObject(Object object) {
41: this .object = object;
42: }
43:
44: public SComponent getComponent() {
45: return nestedForm.getComponent();
46: }
47:
48: public void setViewMode(int viewMode) {
49: nestedForm.setViewMode(viewMode);
50: }
51:
52: public boolean hasChanges() {
53: return nestedForm.hasChanges();
54: }
55:
56: public boolean hasValidationIssues() {
57: return nestedForm.hasValidationIssues();
58: }
59:
60: public Class getType() {
61: return nestedForm.getType();
62: }
63: }
|