1 16 package org.apache.cocoon.woody.formmodel; 17 18 import org.apache.cocoon.woody.event.WidgetEventMulticaster; 19 import org.apache.cocoon.woody.event.ValueChangedEvent; 20 import org.apache.cocoon.woody.event.ValueChangedListener; 21 22 27 public class BooleanFieldDefinition extends AbstractWidgetDefinition { 28 private ValueChangedListener listener; 29 30 public Widget createInstance() { 31 return new BooleanField(this); 32 } 33 34 public void addValueChangedListener(ValueChangedListener listener) { 35 this.listener = WidgetEventMulticaster.add(this.listener, listener); 36 } 37 38 public void fireValueChangedEvent(ValueChangedEvent event) { 39 if (this.listener != null) { 40 this.listener.valueChanged(event); 41 } 42 } 43 44 public boolean hasValueChangedListeners() { 45 return listener != null; 46 } 47 } 48 | Popular Tags |