Mercurial > dive4elements > framework
diff 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 |
line wrap: on
line diff
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java Wed May 02 16:42:24 2012 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java Thu May 03 07:55:23 2012 +0000 @@ -47,6 +47,9 @@ * the configuration. */ public static final String XPATH_DESCRIPTION = "@description"; + /** The XPath that points to the help text.*/ + public static final String XPATH_HELP_TEXT = "@helpText"; + /** The XPath to the output nodes of the state configuration. */ public static final String XPATH_OUTPUT_MODES = "outputmodes/outputmode"; @@ -65,6 +68,9 @@ /** The description of the state. */ protected String description; + /** The help text for this state.*/ + protected String helpText; + /** The data provided by this state. */ protected Map<String, StateData> data; @@ -91,6 +97,12 @@ } + public AbstractState(String id, String description, String helpText) { + this(id, description); + this.helpText = helpText; + } + + /** * Returns the ID of the state. * @@ -132,6 +144,26 @@ /** + * Returns the help text of this state. + * + * @return the help text. + */ + public String getHelpText() { + return helpText; + } + + + /** + * Set the help text for this state. + * + * @param helpText The help text. + */ + public void setHelpText(String helpText) { + this.helpText = helpText; + } + + + /** * Returns the data of the state. * * @return the data of the state. @@ -197,6 +229,9 @@ description = (String) XMLUtils.xpath( config, XPATH_DESCRIPTION, XPathConstants.STRING); + helpText = (String) XMLUtils.xpath( + config, XPATH_HELP_TEXT, XPathConstants.STRING); + setupOutputs(config); }