1 16 package org.apache.cocoon.woody.formmodel; 17 18 25 public class RepeaterAction extends Action { 26 27 private Repeater repeater; 28 29 30 public RepeaterAction(ActionDefinition definition) { 31 super(definition); 32 } 33 34 37 public Repeater getRepeater() { 38 if (this.repeater == null) { 39 String name = ((RepeaterActionDefinition)this.definition).getRepeaterName(); 40 Widget widget; 41 if (name != null) { 42 widget = getParent().getWidget(name); 44 } else { 45 widget = getParent().getParent(); 47 } 48 49 if (widget == null || !(widget instanceof Repeater)) { 50 throw new RuntimeException (name != null ? 51 "Cannot find sibling repeater named '" + name + "'." : 52 "Parent widget is not a repeater"); 53 } 54 55 this.repeater = (Repeater)widget; 56 } 57 58 return this.repeater; 59 } 60 } 61 | Popular Tags |