KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > workbench > fields > Fields


1 // Copyright 2004, 2005 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.tapestry.workbench.fields;
16
17 import java.math.BigDecimal JavaDoc;
18
19 import org.apache.tapestry.IRequestCycle;
20 import org.apache.tapestry.html.BasePage;
21 import org.apache.tapestry.valid.IValidationDelegate;
22
23 /**
24  * @author Howard Lewis Ship
25  * @since 1.0.7
26  */

27
28 public abstract class Fields extends BasePage
29 {
30     public static final int INT_MIN = 5;
31
32     public static final int INT_MAX = 20;
33
34     public static final double DOUBLE_MIN = 3.14;
35
36     public static final double DOUBLE_MAX = 27.5;
37
38     public static final BigDecimal JavaDoc DECIMAL_MIN = new BigDecimal JavaDoc("2");
39
40     public static final BigDecimal JavaDoc DECIMAL_MAX = new BigDecimal JavaDoc(
41             "100.123456234563456734563456356734567456784567456784567845675678456785678");
42
43     public static final long LONG_MIN = 6;
44
45     public static final long LONG_MAX = 21;
46
47     public static final int STRING_MIN_LENGTH = 3;
48
49     public void formSubmit(IRequestCycle cycle)
50     {
51         IValidationDelegate delegate = getDelegate();
52
53         // If no error message, advance to the Results page,
54

55         // otherwise, stay here and show the error message.
56

57         if (!delegate.getHasErrors())
58             cycle.activate("FieldsResults");
59     }
60
61     /**
62      * Injected.
63      *
64      * @since 4.0
65      */

66     public abstract IValidationDelegate getDelegate();
67 }
Popular Tags