01: package org.osbl.riskmanagement.gui;
02:
03: import org.conform.BeanMeta;
04: import org.conform.VariationBeanMetaProvider;
05: import org.conform.modifier.InlineModifier;
06: import org.osbl.client.wings.form.ComponentProvider;
07: import org.osbl.client.wings.form.GenericObjectForm;
08: import org.osbl.client.wings.form.layouter.*;
09: import org.osbl.client.wings.shell.Client;
10: import org.osbl.riskmanagement.model.Classification;
11:
12: public class ClassificationForm extends GenericObjectForm {
13: @Override
14: protected Object getObject(String path) {
15: if (ComponentProvider.ROOT.equals(path))
16: return object;
17:
18: return null;
19: }
20:
21: @Override
22: protected void setObject(String path, Object object) {
23: if (ComponentProvider.ROOT.equals(path))
24: this .object = object;
25: }
26:
27: @Override
28: protected Instruction createLayoutInstruction() {
29: return new Page(Classification.class.getName(), new Division(
30: Classification.class.getName(), new Column(
31: new LabelAndEditor(ComponentProvider.ROOT,
32: "key"), new LabelAndEditor(
33: ComponentProvider.ROOT, "name")),
34: new Column(
35: new LabelAndEditors("businessobject.created",
36: new Editor(ComponentProvider.ROOT,
37: "created"), new Editor(
38: ComponentProvider.ROOT,
39: "createdBy")))));
40: }
41:
42: @Override
43: protected BeanMeta createBeanMeta(String path) {
44: return new VariationBeanMetaProvider(Client.getInstance()
45: .getBeanMetaProvider()).addModifier(
46: new InlineModifier() {
47: protected void configure() {
48: property("key").setWritable(true);
49: }
50: }).getBeanMeta(Classification.class);
51: }
52: }
|