01: package org.osbl.inventory.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.inventory.model.Location;
11:
12: public class LocationForm extends GenericObjectForm {
13: protected Instruction createLayoutInstruction() {
14: return new PageSet(new Page(Location.class.getName(),
15: new Division(Location.class.getName(), new Column(
16: new LabelAndEditor(ComponentProvider.ROOT,
17: "key"), new LabelAndEditor(
18: ComponentProvider.ROOT, "name")),
19: new Column(new LabelAndEditors(
20: "businessobject.created", new Editor(
21: ComponentProvider.ROOT,
22: "created"), new Editor(
23: ComponentProvider.ROOT,
24: "createdBy"))))));
25: }
26:
27: protected Object getObject(String path) {
28: return object;
29: }
30:
31: protected void setObject(String path, Object object) {
32: this .object = object;
33: }
34:
35: protected BeanMeta createBeanMeta(String path) {
36: VariationBeanMetaProvider provider = new VariationBeanMetaProvider(
37: Client.getInstance().getBeanMetaProvider());
38: provider.addModifier(new InlineModifier() {
39: protected void configure() {
40: property("key").setWritable(true);
41: }
42: });
43: return provider.getBeanMeta(Location.class);
44: }
45: }
|