Mercurial > dive4elements > river
view flys-client/src/main/java/de/intevation/flys/client/client/ui/stationinfo/InfoListGrid.java @ 5144:2c31625d4e6a
New icons! Use the new icons in project list and for export buttons.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 28 Feb 2013 16:40:16 +0100 |
parents | 6f6461e07854 |
children |
line wrap: on
line source
package de.intevation.flys.client.client.ui.stationinfo; import com.google.gwt.core.client.GWT; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridRecord; import com.smartgwt.client.widgets.layout.VLayout; import de.intevation.flys.client.client.FLYS; import de.intevation.flys.client.client.FLYSConstants; import de.intevation.flys.client.shared.model.Data; import de.intevation.flys.client.shared.model.DataList; import de.intevation.flys.client.shared.model.RiverInfo; /** * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a> */ public abstract class InfoListGrid extends ListGrid { protected FLYS flys; protected DataList[] data; /** The message class that provides i18n strings.*/ protected FLYSConstants MSG = GWT.create(FLYSConstants.class); public InfoListGrid(FLYS flys) { super(); this.flys = flys; this.setCanExpandRecords(true); this.setCanExpandMultipleRecords(true); } public void openAll() { GWT.log("InfoListGrid - openAll"); for (ListGridRecord record: this.getRecords()) { expandRecord(record); } } public void setData(DataList[] data) { GWT.log("InfoListGrid - setData"); this.data = data; this.open(); } protected Double getDoubleValue(Data d) { String tmp = d.getStringValue(); if (tmp != null) { return Double.valueOf(tmp); } return null; } @Override protected Canvas getExpansionComponent(ListGridRecord record) { VLayout layout = new VLayout(); layout.setPadding(5); layout.addMember(this.getExpandPanel(record)); return layout; } public abstract void open(); public abstract void setRiverInfo(RiverInfo riverinfo); protected abstract Canvas getExpandPanel(ListGridRecord record); }