01: package org.osbl.client.wings.form;
02:
03: import org.wings.SComponent;
04: import org.osbl.client.wings.shell.Environment;
05:
06: /**
07: * An ObjectDetail displays a single Object.
08: * Implememtations may operate in different modes like view and edit.
09: * @author hengels
10: * @version $Revision$
11: */
12: public interface ObjectForm {
13: /**
14: * Readonly ViewMode.
15: * All properties are displayed read only.
16: */
17: static final int VIEW = 0;
18:
19: /**
20: * Editor ViewMode.
21: * All properties are displayed read write.
22: */
23: static final int EDIT = 1;
24:
25: /**
26: * The environment provided by the editor.
27: */
28: Environment getEnvironment();
29:
30: /**
31: * Get the object, that is currently shown.
32: * @return the object
33: */
34: Object getObject();
35:
36: /**
37: * Set the object to be shown.
38: * @param object the object to be shown
39: */
40: void setObject(Object object);
41:
42: Class getType();
43:
44: /**
45: * Return the SComponent, that shows the object.
46: * Consecutive calls to this method must always return the same component instance. The implementor might choose to
47: * create the component lazily on the first call.
48: *
49: * @return the component showing the object
50: */
51: SComponent getComponent();
52:
53: /**
54: * Set the view mode.
55: * Implementations may support multiple view modes, among them VIEW and EDIT. Typically the concrete
56: * implementation will use BeanMeta variations to accomplish mode specific behaviours. The default mode is VIEW.
57: * @param viewMode one of the default modes: VIEW and EDIT or a custom mode
58: */
59: void setViewMode(int viewMode);
60:
61: /**
62: * In EDIT mode, are there changes?
63: * @return true, if there are changes
64: */
65: boolean hasChanges();
66:
67: /**
68: * In EDIT mode, are there validation issues?
69: * @return true, if there are validation issues
70: */
71: boolean hasValidationIssues();
72: }
|