Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java @ 589:942bd0e7e332
Filter reports and dispatch them to updateReports().
flys-client/trunk@2184 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 21 Jun 2011 16:43:59 +0000 |
parents | 78907f0fb939 |
children | 84d3c5fde5bb |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java Tue Jun 21 16:41:09 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java Tue Jun 21 16:43:59 2011 +0000 @@ -23,6 +23,7 @@ import de.intevation.flys.client.shared.model.DataList; import de.intevation.flys.client.shared.model.DefaultData; import de.intevation.flys.client.shared.model.DefaultDataItem; +import de.intevation.flys.client.shared.model.ReportMode; import de.intevation.flys.client.shared.model.ExportMode; import de.intevation.flys.client.shared.model.OutputMode; import de.intevation.flys.client.shared.model.River; @@ -516,20 +517,40 @@ } updateExportModes(c, getExportModes(outputs)); + updateReportModes(c, getReportModes(outputs)); } public void onOutputModesChange(OutputModesChangeEvent event) { - List<ExportMode> exports = getExportModes(event.getOutputModes()); Collection c = cView.getCollection(); if (c != null) { - updateExportModes(c, exports); + OutputMode [] outs = event.getOutputModes(); + updateExportModes(c, getExportModes(outs)); + updateReportModes(c, getReportModes(outs)); } } + protected List<ReportMode> getReportModes(OutputMode [] outs) { + + List<ReportMode> reports = new ArrayList<ReportMode>(); + + if (outs == null || outs.length == 0) { + return reports; + } + + for (OutputMode out: outs) { + if (out instanceof ReportMode) { + reports.add((ReportMode)out); + } + } + + return reports; + } + + protected List<ExportMode> getExportModes(OutputMode[] outs) { List<ExportMode> exports = new ArrayList<ExportMode>(); @@ -558,6 +579,16 @@ } } + protected void updateReportModes(Collection c, List<ReportMode> reports) { + int num = reports != null ? reports.size() : 0; + GWT.log("Update report modes: " + num); + + for (ReportMode report: reports) { + GWT.log("report '" + report.toString() + "'"); + } + + } + /** * Adds a table to the parameterlist to show calculated data.