Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ExportPanel.java @ 9580:839b2aa84dd0
minuend/subtrahend-UI-switch
author | gernotbelger |
---|---|
date | Tue, 08 Jan 2019 17:01:09 +0100 |
parents | 787fc085459b |
children |
rev | line source |
---|---|
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
9 package org.dive4elements.river.client.client.ui; |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
9190 | 11 import java.util.ArrayList; |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import java.util.List; |
2931
d6983b78de45
Export panel: Make code more robust when trying to resolve missing i18n strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1356
diff
changeset
|
13 import java.util.MissingResourceException; |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 |
9190 | 15 import org.dive4elements.river.client.client.Config; |
16 import org.dive4elements.river.client.client.FLYSConstants; | |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
17 import org.dive4elements.river.client.shared.model.Collection; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
18 import org.dive4elements.river.client.shared.model.ExportMode; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
19 import org.dive4elements.river.client.shared.model.Facet; |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 |
9190 | 21 import com.google.gwt.core.client.GWT; |
22 import com.smartgwt.client.types.Alignment; | |
23 import com.smartgwt.client.widgets.Canvas; | |
24 import com.smartgwt.client.widgets.Label; | |
25 import com.smartgwt.client.widgets.form.DynamicForm; | |
26 import com.smartgwt.client.widgets.form.fields.FormItem; | |
27 import com.smartgwt.client.widgets.form.fields.TextAreaItem; | |
28 import com.smartgwt.client.widgets.layout.HLayout; | |
29 import com.smartgwt.client.widgets.layout.VLayout; | |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 /** |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 * A panel that displays an download icon for all available export modes of a |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 * Collection. |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 * |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 */ |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 public class ExportPanel extends VLayout { |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 |
9481 | 39 private static final String LABEL_URL_SEPARATOR = ";LABEL_URL_SEPARATOR;";// always sync with server (InundationDurationState) |
9190 | 40 /** The message class that provides i18n strings. */ |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 |
9190 | 43 protected Collection c; |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 protected List<ExportMode> exports; |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 |
9190 | 46 /** This layout will store a list of available export types. */ |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 protected HLayout container; |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 |
9190 | 49 public ExportPanel(final Collection c, final List<ExportMode> exports) { |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 super(); |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 |
9190 | 52 this.c = c; |
53 this.exports = exports; | |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 this.container = new HLayout(); |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 |
9190 | 56 final Label title = new Label(this.MSG.dataexport()); |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 title.setHeight(15); |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 title.setStyleName("fontNormalSmallUnderlined"); |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 addMember(title); |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 addMember(createExportItems()); |
9190 | 62 addMember(createVlayoutExportItems()); |
277
50b88b641be6
Changed the height of the export panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
275
diff
changeset
|
63 setHeight(45); |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 setMembersMargin(5); |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 } |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 |
9190 | 67 private VLayout createVlayoutExportItems() { |
68 final VLayout layout = new VLayout(); | |
69 final DynamicForm form1 = new DynamicForm(); | |
70 form1.setColWidths("10%"); | |
71 form1.setWidth(400); | |
72 form1.setAlign(Alignment.LEFT); | |
73 final List<FormItem> items = new ArrayList<FormItem>(); | |
74 for (final ExportMode mode : this.exports) { | |
75 final String name = mode.getName(); | |
76 final List<Facet> facets = mode.getFacets(); | |
77 | |
78 for (int i = 0; i < facets.size(); i++) { | |
79 final Facet facet = facets.get(i); | |
80 final String facetName = facet.getName(); | |
81 | |
82 if (!facetName.equals("wms_url")) | |
83 continue; | |
84 if ("wms_url".equals(facetName)) | |
85 items.add(createUrlLine(facet.getDescription(), i)); | |
86 } | |
87 } | |
88 form1.setFields(items.toArray(new FormItem[items.size()])); | |
89 layout.addMember(form1); | |
90 return layout; | |
91 } | |
92 | |
93 private FormItem createUrlLine(final String labelAndUrl, final int count) { | |
94 | |
95 final String[] labelAndurlSplit = labelAndUrl.split(LABEL_URL_SEPARATOR); | |
96 if (labelAndurlSplit.length == 2) { | |
97 | |
9195 | 98 final TextAreaItem item = new TextAreaItem(); |
99 item.setTitle(labelAndurlSplit[0]); | |
9190 | 100 |
9195 | 101 item.setWrapTitle(true); |
102 item.setTitleColSpan(3); | |
103 item.setColSpan(7); | |
104 item.setWidth(250); | |
105 item.setHeight(48); | |
106 item.setTitleAlign(Alignment.LEFT); | |
9190 | 107 |
9195 | 108 item.setValue(labelAndurlSplit[1]); |
109 item.setCanEdit(false); | |
9190 | 110 |
9195 | 111 return item; |
9190 | 112 } |
113 return null; | |
114 } | |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 /** |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 * This method is used to create an item (created by createExportButton) for |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 * each facet for each export mode. |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 * |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 * @return a horizontal list of buttons. |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 */ |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 protected HLayout createExportItems() { |
9190 | 123 final HLayout layout = new HLayout(); |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 |
9190 | 125 for (final ExportMode mode : this.exports) { |
126 final String name = mode.getName(); | |
127 final List<Facet> facets = mode.getFacets(); | |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 |
9190 | 129 for (final Facet facet : facets) { |
130 final String facetName = facet.getName(); | |
131 | |
132 if (name.equals("fix_wq_curve_at_export")) | |
3525
b67af5b44d68
Hide the W/Q AT export button in fix analysis parameter tab.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2931
diff
changeset
|
133 continue; |
9190 | 134 |
4912
94b95e002fb9
Added filename to export url.
Raimund Renkert <rrenkert@intevation.de>
parents:
3525
diff
changeset
|
135 String filename = name; |
9190 | 136 if (name.equals("computed_dischargecurve_at_export")) |
4912
94b95e002fb9
Added filename to export url.
Raimund Renkert <rrenkert@intevation.de>
parents:
3525
diff
changeset
|
137 filename = "dischargecurve"; |
9190 | 138 |
139 if ("wms_url".equals(facetName)) | |
140 continue; | |
141 | |
142 layout.addMember(createExportButton(name, facetName, filename)); | |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 } |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 } |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 return layout; |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 } |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 /** |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 * This method is used to create a button (with click handler) for a |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 * concrete export mode / type. |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
152 * |
9190 | 153 * @param name |
154 * The name of the export. | |
155 * @param facet | |
156 * The name of the export type (e.g. CSV, WST). | |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
157 * |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
158 * @return an image with click handler. |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
159 */ |
9190 | 160 protected Canvas createExportButton(final String name, final String facet, final String filename) { |
161 String url = getExportUrl(name, facet, filename); | |
5144
2c31625d4e6a
New icons! Use the new icons in project list and for export buttons.
Raimund Renkert <rrenkert@intevation.de>
parents:
4912
diff
changeset
|
162 String imgUrl = GWT.getHostPageBaseURL(); |
2c31625d4e6a
New icons! Use the new icons in project list and for export buttons.
Raimund Renkert <rrenkert@intevation.de>
parents:
4912
diff
changeset
|
163 if (facet.equals("pdf")) { |
9190 | 164 imgUrl += this.MSG.downloadPDF(); |
165 } else if (facet.equals("at")) { | |
166 imgUrl += this.MSG.downloadAT(); | |
167 } else if (facet.equals("wst")) { | |
168 imgUrl += this.MSG.downloadWST(); | |
169 } else if (facet.equals("csv")) { | |
170 url += "&encoding=UTF-8"; | |
171 imgUrl += this.MSG.downloadCSV(); | |
172 } else { | |
173 imgUrl += this.MSG.imageSave(); | |
5144
2c31625d4e6a
New icons! Use the new icons in project list and for export buttons.
Raimund Renkert <rrenkert@intevation.de>
parents:
4912
diff
changeset
|
174 } |
9190 | 175 final ImgLink link = new ImgLink(imgUrl, url, 30, 30); |
1343
0d3d3860beb5
Added a ImgLink class which creates an html link with an image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
433
diff
changeset
|
176 link.setTooltip(getTooltipText(name, facet)); |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
177 |
1343
0d3d3860beb5
Added a ImgLink class which creates an html link with an image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
433
diff
changeset
|
178 return link; |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
179 } |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
180 |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
181 /** |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
182 * Creates the URL used to trigger an export. |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
183 * |
9190 | 184 * @param name |
185 * The name of the export. | |
186 * @param facet | |
187 * The name of the export type (e.g. CSV, WST). | |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
188 * |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
189 * @return the export URL. |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
190 */ |
9190 | 191 protected String getExportUrl(final String name, final String facet, final String filename) { |
192 final Config config = Config.getInstance(); | |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
193 |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
194 String url = GWT.getModuleBaseURL(); |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
195 url += "export"; |
9190 | 196 url += "?uuid=" + this.c.identifier(); |
4912
94b95e002fb9
Added filename to export url.
Raimund Renkert <rrenkert@intevation.de>
parents:
3525
diff
changeset
|
197 url += "&name=" + filename; |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
198 url += "&mode=" + name; |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
199 url += "&type=" + facet; |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
200 url += "&server=" + config.getServerUrl(); |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
201 url += "&locale=" + config.getLocale(); |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
202 |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
203 return url; |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
204 } |
433
ad2c4fb17318
Adjusted the width of an export button and added a tooltip to distinguish different exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
205 |
ad2c4fb17318
Adjusted the width of an export button and added a tooltip to distinguish different exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
206 /** |
ad2c4fb17318
Adjusted the width of an export button and added a tooltip to distinguish different exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
207 * Creates a text used as tooltip for a specific export and type. |
ad2c4fb17318
Adjusted the width of an export button and added a tooltip to distinguish different exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
208 * |
9190 | 209 * @param name |
210 * The name of the export. | |
211 * @param facet | |
212 * The name of the export type (e.g. CSV, WST). | |
433
ad2c4fb17318
Adjusted the width of an export button and added a tooltip to distinguish different exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
213 * |
ad2c4fb17318
Adjusted the width of an export button and added a tooltip to distinguish different exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
214 * @return a tooltip text. |
ad2c4fb17318
Adjusted the width of an export button and added a tooltip to distinguish different exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
215 */ |
9190 | 216 protected String getTooltipText(final String name, final String facet) { |
2931
d6983b78de45
Export panel: Make code more robust when trying to resolve missing i18n strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1356
diff
changeset
|
217 try { |
9190 | 218 return this.MSG.getString(name) + " | " + this.MSG.getString(facet); |
2931
d6983b78de45
Export panel: Make code more robust when trying to resolve missing i18n strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1356
diff
changeset
|
219 } |
9190 | 220 catch (final MissingResourceException mre) { |
2931
d6983b78de45
Export panel: Make code more robust when trying to resolve missing i18n strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1356
diff
changeset
|
221 return name + " | " + facet; |
d6983b78de45
Export panel: Make code more robust when trying to resolve missing i18n strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1356
diff
changeset
|
222 } |
433
ad2c4fb17318
Adjusted the width of an export button and added a tooltip to distinguish different exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
223 } |
275
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
224 } |
8264b02091ef
ISSUE-56 Display download buttons to export the computed data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
225 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |