1 4 package org.oddjob.designer.components; 5 6 import org.oddjob.designer.elements.SimpleDE; 7 import org.oddjob.designer.factory.SimpleHierarchy; 8 import org.oddjob.designer.model.ComponentAction; 9 import org.oddjob.designer.model.DesignAdult; 10 import org.oddjob.designer.model.DesignComponent; 11 import org.oddjob.designer.model.ElementField; 12 import org.oddjob.designer.model.FieldGroup; 13 14 21 public abstract class BaseDC extends DesignAdult 22 implements DesignComponent { 23 24 protected SimpleDE idField = new SimpleDE(); 25 protected SimpleDE nameField = new SimpleDE(); 26 27 private String tag; 28 29 public SimpleHierarchy availableActions() { 30 return new SimpleHierarchy(ComponentAction.class); 31 } 32 33 36 public SimpleDE getId() { 37 return idField; 38 } 39 40 43 public void setId(SimpleDE id) { 44 idField = id; 45 } 46 47 public SimpleDE getName() { 48 return nameField; 49 } 50 51 public void setName(SimpleDE name) { 52 nameField = name; 53 } 54 55 public String name() { 56 return nameField.attribute(); 57 } 58 59 public void name(String name) { 60 nameField.attribute(name); 61 } 62 63 public String tag() { 64 return tag; 65 } 66 67 public void tag(String tag) { 68 this.tag = tag; 69 } 70 71 public FieldGroup basePanel() { 72 FieldGroup fg = new FieldGroup("General"); 73 fg.add(new ElementField("Id", idField)); 74 fg.add(new ElementField("Name", nameField)); 75 return fg; 76 } 77 78 } 79 | Popular Tags |