annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationListGrid.java @ 8426:4f6892d9dff5

Removed obsolete import.
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 17 Oct 2014 16:08:25 +0200
parents 8ef11fad27a2
children 5e38e2924c07
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.stationinfo;
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
10
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
11 import com.google.gwt.core.client.GWT;
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
12 import com.google.gwt.user.client.rpc.AsyncCallback;
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
13
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
14 import com.smartgwt.client.util.SC;
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
15 import com.smartgwt.client.widgets.Canvas;
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
16 import com.smartgwt.client.widgets.grid.ListGridField;
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
17 import com.smartgwt.client.widgets.grid.ListGridRecord;
5503
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
18 import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
19 import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
20
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
21 import org.dive4elements.river.client.client.Config;
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
22 import org.dive4elements.river.client.client.FLYS;
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
23 import org.dive4elements.river.client.client.services.ArtifactService;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
24 import org.dive4elements.river.client.client.services.ArtifactServiceAsync;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
25 import org.dive4elements.river.client.client.services.CreateCollectionService;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
26 import org.dive4elements.river.client.client.services.CreateCollectionServiceAsync;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
27 import org.dive4elements.river.client.client.services.StepForwardService;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
28 import org.dive4elements.river.client.client.services.StepForwardServiceAsync;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
29 import org.dive4elements.river.client.client.ui.CollectionView;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
30 import org.dive4elements.river.client.shared.model.Artifact;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
31 import org.dive4elements.river.client.shared.model.Collection;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
32 import org.dive4elements.river.client.shared.model.Data;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
33 import org.dive4elements.river.client.shared.model.DataItem;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
34 import org.dive4elements.river.client.shared.model.DefaultData;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
35 import org.dive4elements.river.client.shared.model.DefaultDataItem;
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
36 import org.dive4elements.river.client.shared.model.MeasurementStation;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
37 import org.dive4elements.river.client.shared.model.RiverInfo;
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
38
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
39 import java.util.List;
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
40
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
41 /**
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
42 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a>
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
43 */
5503
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
44 public class MeasurementStationListGrid
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
45 extends InfoListGrid
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
46 implements RecordClickHandler {
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
47
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
48 /** The ArtifactService used to communicate with the Artifact server. */
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
49 protected ArtifactServiceAsync artifactService =
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
50 GWT.create(ArtifactService.class);
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
51
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
52 /** The StepForwardService used to put data into an existing artifact. */
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
53 protected StepForwardServiceAsync forwardService =
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
54 GWT.create(StepForwardService.class);
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
55
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
56 /** The ArtifactService used to communicate with the Artifact server. */
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
57 protected CreateCollectionServiceAsync createCollectionService =
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
58 GWT.create(CreateCollectionService.class);
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
59
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
60 public MeasurementStationListGrid(FLYS flys) {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
61 super(flys);
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
62 ListGridField nfield = new ListGridField("name", "Messtelle");
7859
3fda73d9dc56 Fixes flys/issue1308. Add new column "Messstellenart" in "Messstellen-Info".
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6316
diff changeset
63 ListGridField mfield = new ListGridField("measurementtype", "Messstellenart");
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
64 ListGridField sfield = new ListGridField("kmstart", "Start [km]", 60);
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
65 ListGridField efield = new ListGridField("kmend", "Ende [km]", 60);
7873
d027964c4261 Issue1308 Forgot to rename columns.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7859
diff changeset
66 ListGridField lfield = new ListGridField("infolink", "Info");
d027964c4261 Issue1308 Forgot to rename columns.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7859
diff changeset
67 ListGridField cfield = new ListGridField("curvelink", "Feststofftransport-Abfluss-Beziehung");
5503
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
68 cfield.addRecordClickHandler(this);
6272
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
69
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
70 this.setShowRecordComponents(true);
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
71 this.setShowRecordComponentsByCell(true);
8409
8ef11fad27a2 Purge redundant station-column (the values will go to kmstart).
Tom Gottfried <tom@intevation.de>
parents: 8408
diff changeset
72 this.setFields(nfield, mfield, sfield, efield, lfield, cfield);
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
73 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
74
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
75 /**
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
76 * Resets the items of the tree.
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
77 * If the list of gauges is empty or null the tree will be empty.
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
78 */
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
79 @Override
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
80 public void setRiverInfo(RiverInfo riverinfo) {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
81 List<MeasurementStation> stations = riverinfo.getMeasurementStations();
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
82 GWT.log("MeasurmentStationListGrid - setRiverInfo " + stations);
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
83
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
84 if (stations != null && !stations.isEmpty()) {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
85
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
86 if (!riverinfo.isKmUp()) {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
87 for (MeasurementStation station : stations) {
8408
6c16b61ba9eb Purge sorting stations without range to end of list.
Tom Gottfried <tom@intevation.de>
parents: 8396
diff changeset
88 addStation(station);
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
89 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
90 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
91 else {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
92 for (int i = stations.size()-1; i >= 0; i--) {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
93 MeasurementStation station = stations.get(i);
8408
6c16b61ba9eb Purge sorting stations without range to end of list.
Tom Gottfried <tom@intevation.de>
parents: 8396
diff changeset
94 addStation(station);
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
95 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
96 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
97 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
98 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
99
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
100 private void addStation(MeasurementStation station) {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
101 ListGridRecord record = new MeasurementStationRecord(station);
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
102 this.addData(record);
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
103 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
104
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
105 @Override
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
106 public void open() {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
107 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
108
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
109 @Override
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
110 protected Canvas getExpandPanel(ListGridRecord record) {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
111 MeasurementStationRecord station = (MeasurementStationRecord)record;
7935
6f8f13d829e5 Removed unnecessary container widgets and layouts.
Raimund Renkert <rrenkert@intevation.de>
parents: 7873
diff changeset
112 return new MeasurementStationInfoPanel(station);
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
113 }
5503
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
114
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
115 @Override
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
116 public void onRecordClick(RecordClickEvent event) {
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
117 final MeasurementStationRecord station =
5503
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
118 (MeasurementStationRecord)event.getRecord();
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
119 Config config = Config.getInstance();
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
120 final String locale = config.getLocale();
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
121 createCollectionService.create(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
122 locale,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
123 flys.getCurrentUser().identifier(),
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
124 new AsyncCallback<Collection>() {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
125 @Override
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
126 public void onFailure(Throwable caught) {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
127 GWT.log("Could not create the new collection.");
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
128 SC.warn(FLYS.getExceptionString(MSG, caught));
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
129 }
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
130
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
131 @Override
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
132 public void onSuccess(Collection collection) {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
133 GWT.log("Successfully created a new collection.");
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
134 createArtifact(collection, locale, station);
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
135 }
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
136 }
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
137 );
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
138 }
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
139
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
140 private void createArtifact(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
141 final Collection collection,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
142 final String locale,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
143 final MeasurementStationRecord station
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
144 ) {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
145 artifactService.create(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
146 locale, "staticsqrelation", null,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
147 new AsyncCallback<Artifact>() {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
148 @Override
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
149 public void onFailure(Throwable caught) {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
150 GWT.log("Could not create the new artifact.");
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
151 SC.warn(FLYS.getExceptionString(MSG, caught));
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
152 }
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
153
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
154 @Override
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
155 public void onSuccess(Artifact artifact) {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
156 GWT.log("Successfully created a new artifact.");
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
157
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
158 DataItem riverItem = new DefaultDataItem(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
159 "river",
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
160 "river",
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
161 station.getRiverName());
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
162 Data river = new DefaultData(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
163 "river",
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
164 null,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
165 null,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
166 new DataItem[]{riverItem});
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
167
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
168 DataItem refItem = new DefaultDataItem(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
169 "station",
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
170 "station",
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
171 station.getID().toString());
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
172 Data ref = new DefaultData(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
173 "station",
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
174 null,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
175 null,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
176 new DataItem[]{refItem});
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
177
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
178 DataItem nameItem = new DefaultDataItem(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
179 "station_name",
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
180 "station_name",
8396
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
181 station.getName().toString());
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
182 Data name = new DefaultData(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
183 "station_name",
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
184 null,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
185 null,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
186 new DataItem[]{nameItem});
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
187
8396
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
188 DataItem locationItem = new DefaultDataItem(
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
189 "ld_locations",
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
190 "ld_locations",
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
191 station.getKmStart().toString());
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
192 Data location = new DefaultData(
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
193 "ld_locations",
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
194 null,
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
195 null,
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
196 new DataItem[]{locationItem});
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
197
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
198 Data[] data = new Data[]{river, ref, name, location};
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
199 forwardService.go(locale, artifact, data,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
200 new AsyncCallback<Artifact>() {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
201 @Override
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
202 public void onFailure(Throwable caught) {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
203 GWT.log("Could not feed the artifact.");
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
204 SC.warn(caught.getMessage());
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
205 }
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
206
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
207 @Override
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
208 public void onSuccess(Artifact artifact) {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
209 GWT.log("Successfully feed the artifact.");
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
210 CollectionView view = new CollectionView(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
211 flys,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
212 collection,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
213 artifact);
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
214 flys.getWorkspace().addView(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
215 collection.identifier(),
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
216 view);
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
217 view.addArtifactToCollection(artifact);
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
218 }
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
219 });
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
220 }
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
221 });
5503
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
222 }
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
223
6272
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
224 @Override
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
225 public String getCellCSSText(ListGridRecord record, int rowNum,
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
226 int colNum) {
8409
8ef11fad27a2 Purge redundant station-column (the values will go to kmstart).
Tom Gottfried <tom@intevation.de>
parents: 8408
diff changeset
227 if (colNum == 6) {
6272
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
228 return "text-decoration: underline; color: #0000EE; cursor: pointer;";
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
229 }
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
230 else {
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
231 return super.getCellCSSText(record, rowNum, colNum);
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
232 }
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
233 }
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
234
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
235 }

http://dive4elements.wald.intevation.org