Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/RecommendationPairRecord.java @ 1352:01b18db3b288
In WDiff datacage input make names survive backjumps.
flys-client/trunk@3027 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 19 Oct 2011 11:08:03 +0000 |
parents | 1627a28c4504 |
children | 51ed89b754ae |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/RecommendationPairRecord.java Wed Oct 19 09:35:41 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/RecommendationPairRecord.java Wed Oct 19 11:08:03 2011 +0000 @@ -22,12 +22,6 @@ /** The "second" recommendation (typically the subtrahend). */ Recommendation second; - /** Human-readable short information about the "first" recommendation. */ - String firstName; - - /** Human-readable short information about the "second" recommendation. */ - String secondName; - /** * Whether the RecommendationPairRecord was restored from data and thus * already loaded (usually cloned) in an ArtifactCollection or not. @@ -43,19 +37,15 @@ /** * Create a new RecommendationPairRecord. * - * @param firstName Name for the first recommendation (typical minuend). - * @param first The first recommendation (typically the minuend). - * @param secondName Name for the second recommendation (subtrahend). - * @param first The second recommendation (typically the subtrahend). + * @param first The first recommendation (typically the minuend). + * @param second The second recommendation (typically the subtrahend). */ public RecommendationPairRecord( - String firstName, Recommendation first, - String secondName, Recommendation second) { - setFirst(first, firstName); - setSecond(second, secondName); + setFirst(first); + setSecond(second); alreadyLoaded = false; } @@ -63,24 +53,20 @@ /** * Sets the first recommendation with info (minuend). * @param first Recommendation to store. - * @param name human-readable name to identify recommendation */ - public void setFirst(Recommendation first, String name) { + public void setFirst(Recommendation first) { this.first = first; - this.firstName = name; - setAttribute(ATTRIBUTE_FIRST, name); + setAttribute(ATTRIBUTE_FIRST, first.getDisplayName()); } /** * Sets the second recommendation with info (subtrahend). * @param second Recommendation to store. - * @param name human-readable name to identify recommendation. */ - public void setSecond(Recommendation second, String name) { + public void setSecond(Recommendation second) { this.second = second; - this.secondName = name; - setAttribute(ATTRIBUTE_SECOND, name); + setAttribute(ATTRIBUTE_SECOND, second.getDisplayName()); } @@ -107,7 +93,7 @@ * @return name of first recommendation (typically the minuend). */ public String getFirstName() { - return firstName; + return first.getDisplayName(); } @@ -116,7 +102,7 @@ * @return name of second recommendation (typically the subtrahend). */ public String getSecondName() { - return secondName; + return second.getDisplayName(); }