1 5 package org.exoplatform.faces.core.component; 6 7 import javax.faces.context.FacesContext; 8 import javax.faces.validator.Validator ; 9 import org.exoplatform.faces.FacesUtil; 10 11 17 public class UIStringInput extends UIInput { 18 public static final String COMPONENT_FAMILY = "org.exoplatform.faces.core.component.UIStringInput" ; 19 public static final int TEXT = 0; 20 public static final int PASSWORD = 1; 21 22 protected String value_ ; 23 protected String title_ ; 24 protected int type = 0; 25 26 public UIStringInput(String name, String text) { 27 setId(name) ; 28 name_ = name ; 29 value_ = text; 30 editable_ = true ; 31 setRendererType("StringInputRenderer") ; 32 FacesUtil.createValueBinding(getFacesContext(), this, "text", text); 33 } 34 35 public String getFamily() { return COMPONENT_FAMILY ; } 36 37 final public String getValue() { return value_ ; } 38 final public UIStringInput setValue(String s) { 39 value_ = s ; 40 return this ; 41 } 42 43 final public String getText() { return value_ ; } 44 final public UIStringInput setText(String s) { 45 value_ = s ; 46 return this ; 47 } 48 49 final public String getTitle() { return title_ ; } 50 final public UIStringInput setTitle(String title) { 51 title_ = title ; 52 return this ; 53 } 54 55 public int getType() { 56 return type; 57 } 58 public void setType(int type) { 59 this.type = type; 60 } 61 62 public UIStringInput addValidator(Validator validator) { 63 addComponentValidator(validator) ; 64 return this ; 65 } 66 67 public UIStringInput addValidator(Class clazz) { 68 addComponentValidator(clazz) ; 69 return this ; 70 } 71 72 final public void processValidators(FacesContext context) { 73 processValidators(context, value_) ; 74 } 75 } | Popular Tags |