1 15 package org.apache.tapestry.form; 16 17 28 29 public class StringPropertySelectionModel implements IPropertySelectionModel 30 { 31 private String [] options; 32 33 38 39 public StringPropertySelectionModel(String [] options) 40 { 41 this.options = options; 42 } 43 44 public int getOptionCount() 45 { 46 return options.length; 47 } 48 49 public Object getOption(int index) 50 { 51 return options[index]; 52 } 53 54 58 59 public String getLabel(int index) 60 { 61 return options[index]; 62 } 63 64 68 69 public String getValue(int index) 70 { 71 return Integer.toString(index); 72 } 73 74 public Object translateValue(String value) 75 { 76 int index; 77 78 index = Integer.parseInt(value); 79 80 return options[index]; 81 } 82 83 } | Popular Tags |