changeset 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 e08f1475facc
children 111d4e28c45e
files ChangeLog artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java
diffstat 3 files changed, 49 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed May 02 16:42:24 2012 +0000
+++ b/ChangeLog	Thu May 03 07:55:23 2012 +0000
@@ -1,3 +1,9 @@
+2012-05-03  Ingo Weinzierl <ingo@intevation.de>
+
+	* artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java,
+	  artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java:
+	  Defined and implemented a method getHelpText().
+
 2012-05-02	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XSLTransformer.java:
--- 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);
     }
 
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java	Wed May 02 16:42:24 2012 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java	Thu May 03 07:55:23 2012 +0000
@@ -47,6 +47,14 @@
 
 
     /**
+     * Returns the help text configured for the state.
+     *
+     * @return the help text configured for the state.
+     */
+    public String getHelpText();
+
+
+    /**
      * Returns the data provided by this state.
      *
      * @return the data stored in this state.

http://dive4elements.wald.intevation.org