Mercurial > dive4elements > framework
comparison artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java @ 386:fd32dc33a24c
Added a method State.getHelpText().
artifacts/trunk@4338 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 03 May 2012 07:55:23 +0000 |
parents | 6072f84608c2 |
children | f367be55dd35 |
comparison
equal
deleted
inserted
replaced
385:e08f1475facc | 386:fd32dc33a24c |
---|---|
45 | 45 |
46 /** The XPath to the description of the state relative to the state node in | 46 /** The XPath to the description of the state relative to the state node in |
47 * the configuration. */ | 47 * the configuration. */ |
48 public static final String XPATH_DESCRIPTION = "@description"; | 48 public static final String XPATH_DESCRIPTION = "@description"; |
49 | 49 |
50 /** The XPath that points to the help text.*/ | |
51 public static final String XPATH_HELP_TEXT = "@helpText"; | |
52 | |
50 /** The XPath to the output nodes of the state configuration. */ | 53 /** The XPath to the output nodes of the state configuration. */ |
51 public static final String XPATH_OUTPUT_MODES = "outputmodes/outputmode"; | 54 public static final String XPATH_OUTPUT_MODES = "outputmodes/outputmode"; |
52 | 55 |
53 /** The XPath to the list of facets relative to the output mode it belongs | 56 /** The XPath to the list of facets relative to the output mode it belongs |
54 * to. */ | 57 * to. */ |
63 protected String id; | 66 protected String id; |
64 | 67 |
65 /** The description of the state. */ | 68 /** The description of the state. */ |
66 protected String description; | 69 protected String description; |
67 | 70 |
71 /** The help text for this state.*/ | |
72 protected String helpText; | |
73 | |
68 /** The data provided by this state. */ | 74 /** The data provided by this state. */ |
69 protected Map<String, StateData> data; | 75 protected Map<String, StateData> data; |
70 | 76 |
71 /** A list of output modes which are available for this state. */ | 77 /** A list of output modes which are available for this state. */ |
72 protected List<Output> outputs; | 78 protected List<Output> outputs; |
89 this.id = id; | 95 this.id = id; |
90 this.description = description; | 96 this.description = description; |
91 } | 97 } |
92 | 98 |
93 | 99 |
100 public AbstractState(String id, String description, String helpText) { | |
101 this(id, description); | |
102 this.helpText = helpText; | |
103 } | |
104 | |
105 | |
94 /** | 106 /** |
95 * Returns the ID of the state. | 107 * Returns the ID of the state. |
96 * | 108 * |
97 * @return the ID of the state. | 109 * @return the ID of the state. |
98 */ | 110 */ |
126 * | 138 * |
127 * @param description The description of the state. | 139 * @param description The description of the state. |
128 */ | 140 */ |
129 public void setDescription(String description) { | 141 public void setDescription(String description) { |
130 this.description = description; | 142 this.description = description; |
143 } | |
144 | |
145 | |
146 /** | |
147 * Returns the help text of this state. | |
148 * | |
149 * @return the help text. | |
150 */ | |
151 public String getHelpText() { | |
152 return helpText; | |
153 } | |
154 | |
155 | |
156 /** | |
157 * Set the help text for this state. | |
158 * | |
159 * @param helpText The help text. | |
160 */ | |
161 public void setHelpText(String helpText) { | |
162 this.helpText = helpText; | |
131 } | 163 } |
132 | 164 |
133 | 165 |
134 /** | 166 /** |
135 * Returns the data of the state. | 167 * Returns the data of the state. |
194 | 226 |
195 id = (String) XMLUtils.xpath(config, XPATH_ID, XPathConstants.STRING); | 227 id = (String) XMLUtils.xpath(config, XPATH_ID, XPathConstants.STRING); |
196 | 228 |
197 description = (String) XMLUtils.xpath( | 229 description = (String) XMLUtils.xpath( |
198 config, XPATH_DESCRIPTION, XPathConstants.STRING); | 230 config, XPATH_DESCRIPTION, XPathConstants.STRING); |
231 | |
232 helpText = (String) XMLUtils.xpath( | |
233 config, XPATH_HELP_TEXT, XPathConstants.STRING); | |
199 | 234 |
200 setupOutputs(config); | 235 setupOutputs(config); |
201 } | 236 } |
202 | 237 |
203 | 238 |