view flys-client/src/main/java/de/intevation/flys/client/client/ui/range/DischargeInfoDataSource.java @ 4253:a1bc5b8cff0f

Refactor GaugePanel to create it's own SectionStackSection The GaugePanel constructor now creates a SectionStackSection instead of using a provided one. Improve the rendering of the GaugePanel by having access to the SmartGWT wrapper (WidgetCanvas) object for the GWT Tree (GaugeTree) directly. Add methods to close and open the section. Also add a getter for the section.
author Björn Ricks <bjoern.ricks@intevation.de>
date Thu, 25 Oct 2012 13:52:58 +0200
parents 0cc2c3d89a9d
children 651b93c10dc5
line wrap: on
line source
package de.intevation.flys.client.client.ui.range;

import java.util.Date;

import com.google.gwt.core.client.GWT;

import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.types.DSDataFormat;
import com.smartgwt.client.types.FieldType;
import com.smartgwt.client.util.DateDisplayFormatter;


public class DischargeInfoDataSource extends DataSource {

    public static final String XPATH_DISCHARGE_DEFAULT = "/discharges/discharge";


    public DischargeInfoDataSource(String url, long gauge) {
        setDataFormat(DSDataFormat.XML);
        setRecordXPath(XPATH_DISCHARGE_DEFAULT);

        DataSourceField desc = new DataSourceField(
            "description", FieldType.TEXT, "description");

        DataSourceField start = new DataSourceField(
            "start", FieldType.TEXT, "start");

        DataSourceField end = new DataSourceField(
            "end", FieldType.TEXT, "end");

        setFields(desc, start, end);
        setDataURL(getServiceURL(url, gauge));
    }


    protected String getServiceURL(String server, long gauge) {
        String url = GWT.getModuleBaseURL();
        url += "dischargeinfoxml";
        url += "?server=" + server;
        url += "&gauge=" + String.valueOf(gauge);

        return url;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org