1 14 15 package com.sun.facelets.compiler; 16 17 import javax.faces.component.UIComponent; 18 19 import java.io.IOException ; 20 21 import javax.el.ELException; 22 import javax.faces.FacesException; 23 24 import com.sun.facelets.FaceletContext; 25 import com.sun.facelets.FaceletException; 26 import com.sun.facelets.FaceletHandler; 27 import com.sun.facelets.tag.TextHandler; 28 import com.sun.facelets.tag.jsf.ComponentSupport; 29 30 final class UILiteralTextHandler implements FaceletHandler, TextHandler { 31 32 protected final String txtString; 33 34 public UILiteralTextHandler(String txtString) { 35 this.txtString = txtString; 36 } 37 38 public void apply(FaceletContext ctx, UIComponent parent) 39 throws IOException , FacesException, FaceletException, ELException { 40 if (parent != null) { 41 UIComponent c = new UILiteralText(this.txtString); 42 c.setId(ComponentSupport.getViewRoot(ctx, parent).createUniqueId()); 43 parent.getChildren().add(c); 44 } 45 } 46 47 public String getText() { 48 return this.txtString; 49 } 50 51 public String getText(FaceletContext ctx) { 52 return this.txtString; 53 } 54 } 55 | Popular Tags |