1 4 package org.oddjob.designer.components; 5 6 import org.oddjob.designer.factory.SimpleHierarchy; 7 import org.oddjob.designer.model.ComponentAction; 8 import org.oddjob.designer.model.DesignComponent; 9 import org.oddjob.designer.model.FormDefinition; 10 import org.oddjob.designer.model.TextInput; 11 12 15 public class UnknownDC implements DesignComponent { 16 17 private String xml; 18 19 private String name; 20 private String tag; 21 22 public String tag() { 23 return tag; 24 } 25 26 public void tag(String tag) { 27 this.tag = tag; 28 } 29 30 public String name() { 31 return name == null ? tag : name; 32 } 33 34 public void setTag(String tag) { 35 this.tag = tag; 36 } 37 38 public void setName(String name) { 39 this.name = name; 40 } 41 42 public void name(String name) { 43 this.name = name; 44 } 45 46 public void unknown(String xml) { 47 this.xml = xml; 48 } 49 50 public String unknown() { 51 return this.xml; 52 } 53 54 public FormDefinition form() { 55 return new TextInput("XML") { 56 public String getText() { 57 return xml; 58 } 59 62 public void setText(String text) { 63 xml = text; 64 this.setChanged(); 65 this.notifyObservers(); 66 } 67 }; 68 } 69 70 public SimpleHierarchy availableActions() { 71 return new SimpleHierarchy(ComponentAction.class); 72 } 73 } 74 | Popular Tags |