1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
package org.apache.tapestry.form; |
16 | |
|
17 | |
import org.apache.hivemind.HiveMind; |
18 | |
import org.apache.hivemind.impl.MessageFormatter; |
19 | |
import org.apache.tapestry.IComponent; |
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
final class FormMessages |
26 | |
{ |
27 | 0 | private static final MessageFormatter _formatter = new MessageFormatter(FormMessages.class); |
28 | |
|
29 | |
|
30 | 0 | private FormMessages() { } |
31 | |
|
32 | |
static String formTooManyIds(IComponent form, int actualCount, IComponent component) |
33 | |
{ |
34 | 0 | return _formatter.format( |
35 | |
"form-too-many-ids", |
36 | |
form.getExtendedId(), |
37 | |
new Integer(actualCount), |
38 | |
component.getExtendedId()); |
39 | |
} |
40 | |
|
41 | |
static String formIdMismatch(IComponent form, int mismatchIndex, String expectedId, |
42 | |
String actualId, IComponent component) |
43 | |
{ |
44 | 0 | return _formatter.format("form-id-mismatch", new Object[] |
45 | |
{ form.getExtendedId(), new Integer(mismatchIndex + 1), expectedId, actualId, |
46 | |
component.getExtendedId() }); |
47 | |
} |
48 | |
|
49 | |
static String formTooFewIds(IComponent form, int remainingCount, String nextExpectedId) |
50 | |
{ |
51 | 0 | return _formatter.format("form-too-few-ids", form.getExtendedId(), new Integer( |
52 | |
remainingCount), nextExpectedId); |
53 | |
} |
54 | |
|
55 | |
static String encodingTypeContention(IComponent form, String establishedEncodingType, |
56 | |
String newEncodingType) |
57 | |
{ |
58 | 0 | return _formatter.format( |
59 | |
"encoding-type-contention", |
60 | |
form.getExtendedId(), |
61 | |
establishedEncodingType, |
62 | |
newEncodingType); |
63 | |
} |
64 | |
|
65 | |
static String fieldAlreadyPrerendered(IComponent field) |
66 | |
{ |
67 | 0 | return _formatter.format("field-already-prerendered", field); |
68 | |
} |
69 | |
|
70 | |
static String linkSubmitMayNotNest(IComponent inner, IComponent outer) |
71 | |
{ |
72 | 0 | return _formatter.format("link-submit-may-not-nest", inner.getExtendedId(), outer |
73 | |
.getExtendedId(), HiveMind.getLocationString(outer)); |
74 | |
} |
75 | |
} |