1
16package org.tp23.antinstaller.input;
17
18
19import org.tp23.antinstaller.InstallerContext;
20import org.tp23.antinstaller.ValidationException;
21
22
23
24
31public class CheckboxInput
32 extends InputField{
33
34
35 private String force;
36
37 public CheckboxInput() {
38 }
39
40 public String getForce() {
41 return force;
42 }
43
44 public void setForce(String force) {
45 this.force = force;
46 }
47
48 public void setValue(String trueOrFalse){
49 setInputResult(trueOrFalse);
50 }
51
55 public boolean validate(InstallerContext cxt) throws ValidationException{
56 return true;
57 }
58
59
60
65 public boolean validateObject() {
66 if(getProperty()==null){
67 System.out.println("Checkbox:property must be set");
68 return false;
69 }
70 if(getDisplayText()==null){
71 System.out.println("Checkbox:displayText must be set");
72 return false;
73 }
74 if(!InputField.requiredBoolean(getDefaultValue())){
75 System.out.println("Checkbox:defaultValue must be true or false");
76 return false;
77 }
78 if(!InputField.optionalBoolean(getForce())){
79 System.out.println("Checkbox:defaultValue must be true or false or null");
80 return false;
81 }
82 return true;
83 }
84
85
86}
87