KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > appfuse > webapp > action > RoleModel


1 package org.appfuse.webapp.action;
2
3 import java.util.List JavaDoc;
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 JavaDoc roles = null;
11
12     public RoleModel(List JavaDoc roles) {
13         this.roles = roles;
14     }
15
16     public int getOptionCount() {
17         return this.roles.size();
18     }
19
20     public Object JavaDoc getOption(int index) {
21         LabelValue option = (LabelValue) this.roles.get(index);
22
23         return option.getValue();
24     }
25
26     public String JavaDoc getLabel(int index) {
27         LabelValue option = (LabelValue) this.roles.get(index);
28
29         return option.getLabel();
30     }
31
32     public String JavaDoc getValue(int index) {
33         LabelValue option = (LabelValue) this.roles.get(index);
34
35         return option.getValue();
36     }
37
38     public Object JavaDoc translateValue(String JavaDoc value) {
39         return value;
40     }
41 }
42
Popular Tags