1 4 package org.oddjob.designer.components; 5 6 import org.oddjob.designer.elements.ListDE; 7 import org.oddjob.designer.factory.DesignFactory; 8 import org.oddjob.designer.factory.SimpleHierarchy; 9 import org.oddjob.designer.model.ComponentAction; 10 import org.oddjob.designer.model.ComponentElement; 11 import org.oddjob.designer.model.DesignComponent; 12 import org.oddjob.designer.model.FormDefinition; 13 import org.oddjob.designer.model.StandardForm; 14 import org.oddjob.designer.model.TransferComponentAction; 15 16 19 public class ForEachDC extends StructuralDC { 20 21 private ListDE values = new ListDE(); 22 23 public FormDefinition form() { 24 return new StandardForm(tag()) 25 .addGroup(basePanel()) 26 .addGroup(values.detail()); 27 } 28 29 public SimpleHierarchy availableActions() { 30 return new SimpleHierarchy(ComponentAction.class) 31 .addHierarchy(DesignFactory.childActions(this, "child").setName("Set Job")); 32 } 33 34 37 public ComponentAction[] transferActions(String xml) { 38 return new ComponentAction[] { 39 new TransferComponentAction(this, xml, "Set Job", "child") 40 }; 41 } 42 43 public void setValues(ListDE values) { 44 this.values = values; 45 } 46 47 public ListDE getValues() { 48 return values; 49 } 50 51 public void addComponentChild(DesignComponent child) { 52 childHelper.removeAllChildren(); 53 childHelper.addChild(child); 54 } 55 56 public Object elementChild() { 57 return ComponentElement.createNested(childHelper.getChildren()); 58 } 59 60 } 61 | Popular Tags |