01: /*
02: * Created on 9 Feb 2007
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.UIDisabledDecorator;
10: import uk.org.ponder.rsf.renderer.decorator.DecoratorRenderer;
11:
12: public class HTMLDisabledDecoratorRenderer implements DecoratorRenderer {
13: public Class getRenderedType() {
14: return UIDisabledDecorator.class;
15: }
16:
17: public void modifyAttributes(UIDecorator decoratoro,
18: String tagname, Map tomodify) {
19: UIDisabledDecorator decorator = (UIDisabledDecorator) decoratoro;
20: if (decorator.disabled) {
21: tomodify.put("disabled", "disabled");
22: } else {
23: tomodify.remove("disabled");
24: }
25: }
26:
27: public String getContentTypes() {
28: return "HTML, HTML-FRAGMENT";
29: }
30:
31: }
|