1 23 package com.sun.enterprise.tools.jsfext.layout.descriptor; 24 25 import com.sun.enterprise.tools.jsfext.component.ComponentUtil; 26 27 import java.io.IOException ; 28 29 import javax.faces.context.FacesContext; 30 import javax.faces.context.ResponseWriter; 31 import javax.faces.component.UIComponent; 32 import javax.faces.el.ValueBinding; 33 34 35 42 public class LayoutStaticText extends LayoutElementBase implements LayoutElement { 43 44 47 public LayoutStaticText(LayoutElement parent, String id, String value) { 48 super(parent, id); 49 _value = value; 50 } 51 52 55 public String getValue() { 56 return _value; 57 } 58 59 69 protected boolean encodeThis(FacesContext context, UIComponent component) throws IOException { 70 ResponseWriter writer = context.getResponseWriter(); 72 73 Object value = ComponentUtil.setOption( 81 context, "__value", getValue(), 82 getLayoutDefinition(), component); 83 if (value instanceof ValueBinding) { 84 value = ((ValueBinding) value).getValue(context); 85 } 86 if (value != null) { 87 writer.write(value.toString()); 88 } 89 91 return false; 93 } 94 95 private String _value = null; 96 } 97 | Popular Tags |