1 /* 
2  * Copyright 2005 Paul Hinds
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.tp23.antinstaller.input;
17
18
19import org.tp23.antinstaller.InstallerContext;
20import org.tp23.antinstaller.ValidationException;
21
22
23/**
24 *
25 * <p>Free text input type </p>
26 * @author Paul Hinds
27 * @version $Id: UnvalidatedTextInput.java,v 1.1.1.1 2005/10/18 18:20:54 teknopaul Exp $
28 */
29public class UnvalidatedTextInput
30    extends InputField{
31
32    public UnvalidatedTextInput() {
33    }
34
35    public void setValue(String dir){
36        setInputResult(dir);
37    }
38
39    /**
40     * Called to validate the user input
41     */
42    public boolean validate(InstallerContext cxt) throws ValidationException{
43        return true;
44    }
45
46    /**
47     * Used by checkConfig to validate the configuration file.
48     * Not used at runtime.
49     * @return boolean
50     */
51    public boolean validateObject() {
52        if(getDisplayText()==null){
53            System.out.println("Simple:displayText must be set");
54            return false;
55        }
56        if(getProperty()==null){
57            System.out.println("Simple:property must be set");
58            return false;
59        }
60        if(getDefaultValue()==null){
61            System.out.println("Simple:defualtValue must be set");
62            return false;
63        }
64        return true;
65    }
66}
67