Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
1351:19f621663b7a | 1352:01b18db3b288 |
---|---|
20 Recommendation first; | 20 Recommendation first; |
21 | 21 |
22 /** The "second" recommendation (typically the subtrahend). */ | 22 /** The "second" recommendation (typically the subtrahend). */ |
23 Recommendation second; | 23 Recommendation second; |
24 | 24 |
25 /** Human-readable short information about the "first" recommendation. */ | |
26 String firstName; | |
27 | |
28 /** Human-readable short information about the "second" recommendation. */ | |
29 String secondName; | |
30 | |
31 /** | 25 /** |
32 * Whether the RecommendationPairRecord was restored from data and thus | 26 * Whether the RecommendationPairRecord was restored from data and thus |
33 * already loaded (usually cloned) in an ArtifactCollection or not. | 27 * already loaded (usually cloned) in an ArtifactCollection or not. |
34 */ | 28 */ |
35 boolean alreadyLoaded; | 29 boolean alreadyLoaded; |
41 | 35 |
42 | 36 |
43 /** | 37 /** |
44 * Create a new RecommendationPairRecord. | 38 * Create a new RecommendationPairRecord. |
45 * | 39 * |
46 * @param firstName Name for the first recommendation (typical minuend). | 40 * @param first The first recommendation (typically the minuend). |
47 * @param first The first recommendation (typically the minuend). | 41 * @param second The second recommendation (typically the subtrahend). |
48 * @param secondName Name for the second recommendation (subtrahend). | |
49 * @param first The second recommendation (typically the subtrahend). | |
50 */ | 42 */ |
51 public RecommendationPairRecord( | 43 public RecommendationPairRecord( |
52 String firstName, | |
53 Recommendation first, | 44 Recommendation first, |
54 String secondName, | |
55 Recommendation second) | 45 Recommendation second) |
56 { | 46 { |
57 setFirst(first, firstName); | 47 setFirst(first); |
58 setSecond(second, secondName); | 48 setSecond(second); |
59 alreadyLoaded = false; | 49 alreadyLoaded = false; |
60 } | 50 } |
61 | 51 |
62 | 52 |
63 /** | 53 /** |
64 * Sets the first recommendation with info (minuend). | 54 * Sets the first recommendation with info (minuend). |
65 * @param first Recommendation to store. | 55 * @param first Recommendation to store. |
66 * @param name human-readable name to identify recommendation | |
67 */ | 56 */ |
68 public void setFirst(Recommendation first, String name) { | 57 public void setFirst(Recommendation first) { |
69 this.first = first; | 58 this.first = first; |
70 this.firstName = name; | 59 setAttribute(ATTRIBUTE_FIRST, first.getDisplayName()); |
71 setAttribute(ATTRIBUTE_FIRST, name); | |
72 } | 60 } |
73 | 61 |
74 | 62 |
75 /** | 63 /** |
76 * Sets the second recommendation with info (subtrahend). | 64 * Sets the second recommendation with info (subtrahend). |
77 * @param second Recommendation to store. | 65 * @param second Recommendation to store. |
78 * @param name human-readable name to identify recommendation. | |
79 */ | 66 */ |
80 public void setSecond(Recommendation second, String name) { | 67 public void setSecond(Recommendation second) { |
81 this.second = second; | 68 this.second = second; |
82 this.secondName = name; | 69 setAttribute(ATTRIBUTE_SECOND, second.getDisplayName()); |
83 setAttribute(ATTRIBUTE_SECOND, name); | |
84 } | 70 } |
85 | 71 |
86 | 72 |
87 /** | 73 /** |
88 * Get first recommendation (typically the minuend). | 74 * Get first recommendation (typically the minuend). |
105 /** | 91 /** |
106 * Get name of first recommendation (typically the minuend). | 92 * Get name of first recommendation (typically the minuend). |
107 * @return name of first recommendation (typically the minuend). | 93 * @return name of first recommendation (typically the minuend). |
108 */ | 94 */ |
109 public String getFirstName() { | 95 public String getFirstName() { |
110 return firstName; | 96 return first.getDisplayName(); |
111 } | 97 } |
112 | 98 |
113 | 99 |
114 /** | 100 /** |
115 * Get name of second recommendation (typically the subtrahend). | 101 * Get name of second recommendation (typically the subtrahend). |
116 * @return name of second recommendation (typically the subtrahend). | 102 * @return name of second recommendation (typically the subtrahend). |
117 */ | 103 */ |
118 public String getSecondName() { | 104 public String getSecondName() { |
119 return secondName; | 105 return second.getDisplayName(); |
120 } | 106 } |
121 | 107 |
122 | 108 |
123 /** | 109 /** |
124 * Sets whether or not the Recommendation is already loaded (in contrast | 110 * Sets whether or not the Recommendation is already loaded (in contrast |