| 1 package org.appfuse.webapp.action; 2 3 import java.util.List ; 4 5 import org.apache.tapestry.form.IPropertySelectionModel; 6 7 import org.appfuse.model.LabelValue; 8 9 public class RoleModel implements IPropertySelectionModel { 10 private List roles = null; 11 12 public RoleModel(List roles) { 13 this.roles = roles; 14 } 15 16 public int getOptionCount() { 17 return this.roles.size(); 18 } 19 20 public Object getOption(int index) { 21 LabelValue option = (LabelValue) this.roles.get(index); 22 23 return option.getValue(); 24 } 25 26 public String getLabel(int index) { 27 LabelValue option = (LabelValue) this.roles.get(index); 28 29 return option.getLabel(); 30 } 31 32 public String getValue(int index) { 33 LabelValue option = (LabelValue) this.roles.get(index); 34 35 return option.getValue(); 36 } 37 38 public Object translateValue(String value) { 39 return value; 40 } 41 } 42 | Popular Tags |