01: /*
02: * Created on 24 Oct 2006
03: */
04: package uk.org.ponder.rsf.renderer.html.decorators;
05:
06: import java.util.Map;
07:
08: import uk.org.ponder.rsf.components.decorators.UIDecorator;
09: import uk.org.ponder.rsf.components.decorators.UILabelTargetDecorator;
10: import uk.org.ponder.rsf.renderer.decorator.DecoratorRenderer;
11:
12: public class HTMLLabelTargetDecoratorRenderer implements
13: DecoratorRenderer {
14:
15: public Class getRenderedType() {
16: return UILabelTargetDecorator.class;
17: }
18:
19: public String getContentTypes() {
20: return "HTML, HTML-FRAGMENT";
21: }
22:
23: public void modifyAttributes(UIDecorator decoratoro,
24: String tagname, Map tomodify) {
25: UILabelTargetDecorator decorator = (UILabelTargetDecorator) decoratoro;
26: if (tagname.equals("label")) {
27: tomodify.put("for", decorator.targetFullID);
28: } else
29: throw new IllegalArgumentException(
30: "UILabelTargetDecorator peered with unrecognised tag "
31: + tagname
32: + " (only <label> is supported for HTML)");
33: }
34:
35: }
|