1
16package org.tp23.antinstaller.input;
17
18import java.util.MissingResourceException;
19import java.util.ResourceBundle;
20
21
28public abstract class InputField
29 extends OutputField {
30
31 private static ResourceBundle langPack = null;
33 static{
34 try {
35 langPack = ResourceBundle.getBundle("resources.LanguagePack");
36 } catch (MissingResourceException e) {
37 }
39 }
40
41 private String property;
42 protected String defaultValue;
43
44
47 private boolean editted = false;
48
49 public InputField() {
50 }
51
52 public String getDisplayText() {
53 if(langPack != null){
54 return langPack.getString(getProperty() + ".displayText");
55 }
56 return displayText;
57 }
58 public String getExplanatoryText() {
59 if(langPack != null){
60 try {
61 return langPack.getString(getProperty() + ".explanatoryText");
62 } catch (MissingResourceException e) {
63 }
65 }
66 return explanatoryText;
67 }
68
69
73 public String getInputResult() {
74 return resultContainer.getProperty(property);
75 }
76
77 public void setInputResult(String inputResult) {
78 resultContainer.setProperty(property, inputResult);
79 }
80 public boolean isEditted() {
81 return editted;
82 }
83 public void setEditted(boolean editted) {
84 this.editted = editted;
85 }
86 public void setResultContainer(ResultContainer resultContainer) {
87 this.resultContainer = resultContainer;
88 }
89
90 public String getProperty() {
91 return property;
92 }
93
94 public void setProperty(String property) {
95 this.property = property;
96 }
97
98 public String getDefaultValue() {
99 return resultContainer.getDefaultValue(defaultValue);
00 }
01
02 public void setDefaultValue(String defaultValue) {
03 this.defaultValue = defaultValue;
04 }
05
06
07}
08