view flys-client/src/main/java/de/intevation/flys/client/client/ui/RecommendationPairRecord.java @ 1299:f4f30d758550

Cosmetics (docs). flys-client/trunk@2923 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 10 Oct 2011 10:46:04 +0000
parents b0ed67cb5197
children 18b0414bde44
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;


    public 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);
    }


    /**
     * Sets the first recommendation with info (minuend).
     */
    public void setFirst(Recommendation first, String name) {
        this.first = first;
        this.firstName = name;
        setAttribute(ATTRIBUTE_FIRST, name);
    }


    /**
     * Sets the second recommendation with info (subtrahend).
     */
    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;
    }
}

http://dive4elements.wald.intevation.org