Commit | Line | Data |
---|---|---|
7f3a0a9f MS |
1 | /* |
2 | * To change this template, choose Tools | Templates | |
3 | * and open the template in the editor. | |
4 | */ | |
5 | package org.ufcspa.simdecs.bn.ui; | |
6 | ||
7 | import java.util.ArrayList; | |
8 | import java.util.List; | |
9 | import javax.faces.bean.ApplicationScoped; | |
10 | import javax.faces.bean.ManagedBean; | |
11 | import javax.faces.model.SelectItem; | |
12 | import org.ufcspa.simdecs.bn.entity.NodeRole; | |
13 | ||
14 | /** | |
15 | * | |
16 | * @author mchelem | |
17 | */ | |
18 | @ManagedBean(name = "nodeRoleController") | |
19 | @ApplicationScoped | |
20 | public class NodeRoleController { | |
21 | private NodeRole nodeRole; | |
22 | ||
23 | public void setNodeRole(NodeRole nodeRole) { this.nodeRole=nodeRole; } | |
24 | ||
25 | public NodeRole getNodeRole() { return this.nodeRole; } | |
26 | ||
27 | public List<SelectItem> getNodeRoles() { | |
28 | List<SelectItem> items = new ArrayList<SelectItem>(); | |
29 | for (NodeRole role: NodeRole.values()) { | |
30 | items.add(new SelectItem(role, role.toString())); | |
31 | } | |
32 | return items; | |
33 | } | |
34 | } |