1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| package org.apache.tapestry.engine; |
16 |
| |
17 |
| import java.util.List; |
18 |
| |
19 |
| import org.apache.hivemind.impl.MessageFormatter; |
20 |
| import org.apache.tapestry.IComponent; |
21 |
| import org.apache.tapestry.IPage; |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| |
27 |
| public class EngineMessages |
28 |
| { |
29 |
| protected static MessageFormatter _formatter = new MessageFormatter(EngineMessages.class, |
30 |
| "EngineStrings"); |
31 |
| |
32 |
2
| public static String serviceNoParameter(IEngineService service)
|
33 |
| { |
34 |
2
| return _formatter.format("service-no-parameter", service.getName());
|
35 |
| } |
36 |
| |
37 |
2
| static String wrongComponentType(IComponent component, Class expectedType)
|
38 |
| { |
39 |
2
| return _formatter.format("wrong-component-type", component.getExtendedId(), expectedType
|
40 |
| .getName()); |
41 |
| } |
42 |
| |
43 |
5
| static String requestStateSession(IComponent component)
|
44 |
| { |
45 |
5
| return _formatter.format("request-stale-session", component.getExtendedId());
|
46 |
| } |
47 |
| |
48 |
1
| static String pageNotCompatible(IPage page, Class expectedType)
|
49 |
| { |
50 |
1
| return _formatter.format("page-not-compatible", page.getPageName(), expectedType.getName());
|
51 |
| } |
52 |
| |
53 |
0
| static String exceptionDuringCleanup(Throwable cause)
|
54 |
| { |
55 |
0
| return _formatter.format("exception-during-cleanup", cause);
|
56 |
| } |
57 |
| |
58 |
1
| static String validateCycle(List pageNames)
|
59 |
| { |
60 |
1
| StringBuffer buffer = new StringBuffer();
|
61 |
1
| int count = pageNames.size();
|
62 |
| |
63 |
1
| for (int i = 0; i < count; i++)
|
64 |
| { |
65 |
3
| if (i > 0)
|
66 |
2
| buffer.append("; ");
|
67 |
| |
68 |
3
| buffer.append(pageNames.get(i));
|
69 |
| } |
70 |
| |
71 |
1
| return _formatter.format("validate-cycle", buffer);
|
72 |
| } |
73 |
| } |