1 16 package org.apache.cocoon.woody.formmodel; 17 18 import java.util.ArrayList ; 19 import java.util.List ; 20 21 import org.apache.cocoon.woody.event.ProcessingPhaseEvent; 22 import org.apache.cocoon.woody.event.ProcessingPhaseListener; 23 import org.apache.cocoon.woody.event.WidgetEventMulticaster; 24 25 30 public class FormDefinition extends AbstractContainerDefinition { 31 private ProcessingPhaseListener listener; 32 33 public FormDefinition() { 34 super(); 35 } 36 37 public void resolve() throws Exception { 38 List parents = new ArrayList (); 39 parents.add(this); 40 resolve(parents, this); 41 } 42 43 public Widget createInstance() { 44 Form form = new Form(this); 45 createWidgets(form); 46 return form; 47 } 48 49 public void addProcessingPhaseListener(ProcessingPhaseListener listener) { 50 this.listener = WidgetEventMulticaster.add(this.listener, listener); 51 } 52 53 public boolean hasProcessingPhaseListeners() { 54 return this.listener != null; 55 } 56 57 public void fireEvent(ProcessingPhaseEvent event) { 58 if (this.listener != null) { 59 this.listener.phaseEnded(event); 60 } 61 } 62 } 63 | Popular Tags |