Mercurial > dive4elements > framework
changeset 377:1ffc09fec1c8 2.6
Added a method ArtifactAndFacet.setFacetDescription().
artifacts/trunk@4008 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 09 Feb 2012 15:53:03 +0000 |
parents | 87c0393749f0 |
children | 71ff234713a6 |
files | ChangeLog artifact-database/src/main/java/de/intevation/artifactdatabase/state/ArtifactAndFacet.java |
diffstat | 2 files changed, 28 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Feb 09 10:33:14 2012 +0000 +++ b/ChangeLog Thu Feb 09 15:53:03 2012 +0000 @@ -1,3 +1,11 @@ +2012-02-09 Ingo Weinzierl <ingo@intevation.de> + + * artifact-database/src/main/java/de/intevation/artifactdatabase/state/ArtifactAndFacet.java: + Added a method setFacetDescription() which sets an alternative + description for the facet. getFacetDescription() will now return the + Facet's descritpion itself if no alternative description has been set; + otherwise the alternative description. + 012-02-09 Sascha L. Teichmann <sascha.teichmann@intevation.de> * artifacts-common/src/main/java/de/intevation/artifacts/common/utils/StringUtils.java(join):
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/ArtifactAndFacet.java Thu Feb 09 10:33:14 2012 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/ArtifactAndFacet.java Thu Feb 09 15:53:03 2012 +0000 @@ -17,7 +17,10 @@ /** The (native) facet. */ protected Facet facet; - + /** An alternative facet description that might be set from outside. */ + protected String facetDescription; + + /** Trivial constructor. */ public ArtifactAndFacet( Artifact a, @@ -72,9 +75,23 @@ } - /** Shortcut to facets name. */ + /** + * Returns the description for a facet. The return value depends on the + * internal <i>facetDescription</i> instance variable. If this has been set + * by setFacetDescription, this value is returned, otherwise the return + * value of facet.getDescription(). + */ public String getFacetDescription() { - return facet.getDescription(); + if (facetDescription == null) { + return facet.getDescription(); + } + + return facetDescription; + } + + + public void setFacetDescription(String facetDescription) { + this.facetDescription = facetDescription; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :