1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.chenillekit.access.pages;
16
17 import java.util.Collections;
18 import java.util.List;
19
20 import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
21
22
23
24
25
26 public class Start
27 {
28 public static class Item implements Comparable<Item>
29 {
30 private final String _pageName;
31 private final String _label;
32 private final String _description;
33
34 public Item(String pageName, String label, String description)
35 {
36 _pageName = pageName;
37 _label = label;
38 _description = description;
39 }
40
41 public String getPageName()
42 {
43 return _pageName;
44 }
45
46 public String getLabel()
47 {
48 return _label;
49 }
50
51 public String getDescription()
52 {
53 return _description;
54 }
55
56 public int compareTo(Item o)
57 {
58 return _label.compareTo(o._label);
59 }
60 }
61
62 private static final List<Item> ITEMS = CollectionFactory.newList(
63 new Item("RestrictedPage", "Restricted", "tests Restricted page"),
64 new Item("UnRestrictedPage", "UnRestricted", "tests UnRestricted page"),
65 new Item("RestrictedTextField", "RestrictedTextField", "tests RestrictedTextField page"),
66 new Item("NotEnoughRights", "NotEnoughRights", "test Restricted page without rights to access")
67 );
68
69 static
70 {
71 Collections.sort(ITEMS);
72 }
73
74 private Item _item;
75
76 public List<Item> getItems()
77 {
78 return ITEMS;
79 }
80
81 public Item getItem()
82 {
83 return _item;
84 }
85
86 public void setItem(Item item)
87 {
88 _item = item;
89 }
90 }