Mercurial > dive4elements > river
view flys-client/src/main/java/de/intevation/flys/client/client/ui/RecommendationPairRecord.java @ 1336:ceb989d64cd2
Request redraw on style attribute change.
flys-client/trunk@2981 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Mon, 17 Oct 2011 10:07:48 +0000 |
parents | 1627a28c4504 |
children | 01b18db3b288 |
line wrap: on
line source
package de.intevation.flys.client.client.ui; import com.smartgwt.client.widgets.grid.ListGridRecord; import de.intevation.flys.client.shared.model.Recommendation; /** * Two strings to be displayed in a GridList, derived from two * Recommendations. */ public class RecommendationPairRecord extends ListGridRecord { /** First attribute-name for StringPairRecord. */ protected static final String ATTRIBUTE_FIRST = "first"; /** Second attribute-name for StringPairRecord. */ protected static final String ATTRIBUTE_SECOND = "second"; /** The "first" recommendation (typically the minuend). */ Recommendation first; /** 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. */ boolean alreadyLoaded; /** Trivial, blocked constructor. */ private RecommendationPairRecord() { } /** * 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). */ public RecommendationPairRecord( String firstName, Recommendation first, String secondName, Recommendation second) { setFirst(first, firstName); setSecond(second, secondName); alreadyLoaded = false; } /** * 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) { this.first = first; this.firstName = name; setAttribute(ATTRIBUTE_FIRST, name); } /** * 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) { this.second = second; this.secondName = name; setAttribute(ATTRIBUTE_SECOND, name); } /** * Get first recommendation (typically the minuend). * @return first recommendation (typically the minuend). */ public Recommendation getFirst() { return first; } /** * Get second recommendation (typically the subtrahend). * @return second recommendation (typically the subtrahend). */ public Recommendation getSecond() { return second; } /** * Get name of first recommendation (typically the minuend). * @return name of first recommendation (typically the minuend). */ public String getFirstName() { return firstName; } /** * Get name of second recommendation (typically the subtrahend). * @return name of second recommendation (typically the subtrahend). */ public String getSecondName() { return secondName; } /** * Sets whether or not the Recommendation is already loaded (in contrast * to not yet loaded). * @param isAlreadyLoaded new value. */ public void setIsAlreadyLoaded(boolean isAlreadyLoaded) { this.alreadyLoaded = isAlreadyLoaded; } /** * Whether or not this pair of recommendations is already laoded (usually * cloned) in an ArtifactCollection. * @return whether pair of recommendations is already loaded. */ public boolean isAlreadyLoaded() { return this.alreadyLoaded; } }