KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > faces > core > component > UIStringInput


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

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 /**
12  * Wed, Dec 22, 2003 @ 23:14
13  * @author: Tuan Nguyen
14  * @email: tuan08@users.sourceforge.net
15  * @version: $Id: UIStringInput.java,v 1.11 2004/08/18 02:37:24 tuan08 Exp $
16  */

17 public class UIStringInput extends UIInput {
18   public static final String JavaDoc 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 JavaDoc value_ ;
23   protected String JavaDoc title_ ;
24   protected int type = 0;
25
26   public UIStringInput(String JavaDoc name, String JavaDoc 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 JavaDoc getFamily() { return COMPONENT_FAMILY ; }
36   
37   final public String JavaDoc getValue() { return value_ ; }
38   final public UIStringInput setValue(String JavaDoc s) {
39     value_ = s ;
40     return this ;
41   }
42
43   final public String JavaDoc getText() { return value_ ; }
44   final public UIStringInput setText(String JavaDoc s) {
45     value_ = s ;
46     return this ;
47   }
48
49   final public String JavaDoc getTitle() { return title_ ; }
50   final public UIStringInput setTitle(String JavaDoc 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 JavaDoc clazz) {
68     addComponentValidator(clazz) ;
69     return this ;
70   }
71   
72   final public void processValidators(FacesContext context) {
73     processValidators(context, value_) ;
74   }
75 }
Popular Tags