1 16 package org.apache.cocoon.forms.formmodel; 17 18 import org.apache.cocoon.forms.FormContext; 19 import org.apache.cocoon.forms.validation.WidgetValidator; 20 import org.apache.cocoon.forms.event.WidgetEvent; 21 import org.apache.cocoon.util.location.Locatable; 22 import org.apache.cocoon.util.location.Location; 23 import org.xml.sax.ContentHandler ; 24 import org.xml.sax.SAXException ; 25 26 import java.util.Locale ; 27 28 56 public interface Widget extends Locatable { 57 58 62 char PATH_SEPARATOR = '/'; 63 64 69 void initialize(); 70 71 74 Location getLocation(); 75 76 80 String getName(); 81 82 86 String getId(); 87 88 92 Widget getParent(); 93 94 99 void setParent(Widget widget); 100 101 105 Form getForm(); 106 107 112 WidgetDefinition getDefinition(); 113 114 121 WidgetState getState(); 122 123 129 void setState(WidgetState state); 130 131 139 WidgetState getCombinedState(); 140 141 145 String getFullName(); 146 147 151 String getRequestParameterName(); 152 153 158 Widget getWidget(String id); 159 160 167 Widget lookupWidget(String path); 168 169 174 void readFromRequest(FormContext formContext); 175 176 184 boolean validate(); 185 186 void addValidator(WidgetValidator validator); 187 188 boolean removeValidator(WidgetValidator validator); 189 190 198 boolean isValid(); 199 200 205 void generateSaxFragment(ContentHandler contentHandler, Locale locale) throws SAXException ; 206 207 211 void generateLabel(ContentHandler contentHandler) throws SAXException ; 212 213 222 Object getValue() throws UnsupportedOperationException ; 223 224 233 void setValue(Object value) throws UnsupportedOperationException ; 234 235 239 boolean isRequired(); 240 241 244 void broadcastEvent(WidgetEvent event); 245 246 252 Object getAttribute(String name); 253 254 258 void setAttribute(String name, Object value); 259 260 265 void removeAttribute(String name); 266 } 267 | Popular Tags |