1 28 29 30 package com.caucho.widget; 31 32 import com.caucho.util.L10N; 33 34 import java.util.logging.Logger ; 35 36 37 public class TextWidgetState 38 extends WidgetState 39 { 40 private static L10N L = new L10N( TextWidgetState.class ); 41 42 static protected final Logger log = 43 Logger.getLogger( TextWidgetState.class.getName() ); 44 45 private String _value; 46 47 public void decode( String [] data ) 48 throws WidgetException 49 { 50 String value = null; 51 52 if ( data != null && data.length > 0 ) { 53 value = data[0]; 54 55 if ( value.length() == 0 ) 56 value = null; 57 } 58 59 _value = value; 60 } 61 62 public String [] encode() 63 throws WidgetException 64 { 65 if ( _value == null || _value.length() == 0 ) 66 return null; 67 else 68 return new String [] { _value }; 69 } 70 71 public String getValue() 72 { 73 return _value; 74 } 75 76 public void reset() 77 { 78 _value = null; 79 } 80 } 81 | Popular Tags |