comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java @ 4127:1e9e7b7d9f15

More fixes for #897: missing resource exceptions when handling other exceptions
author Christian Lins <christian.lins@intevation.de>
date Sun, 14 Oct 2012 09:46:58 +0200
parents 51ed89b754ae
children 360e22afb98b
comparison
equal deleted inserted replaced
4126:e0354aed0cd3 4127:1e9e7b7d9f15
1 package de.intevation.flys.client.client.ui; 1 package de.intevation.flys.client.client.ui;
2
3 import com.google.gwt.core.client.GWT;
4 import com.google.gwt.user.client.rpc.AsyncCallback;
5
6 import com.smartgwt.client.data.Record;
7 import com.smartgwt.client.types.ListGridFieldType;
8 import com.smartgwt.client.widgets.Canvas;
9 import com.smartgwt.client.widgets.events.ClickEvent;
10 import com.smartgwt.client.widgets.grid.ListGrid;
11 import com.smartgwt.client.widgets.grid.ListGridField;
12 import com.smartgwt.client.widgets.grid.ListGridRecord;
13 import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
14 import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
15 import com.smartgwt.client.widgets.layout.HLayout;
16 import com.smartgwt.client.widgets.layout.VLayout;
17
18 import de.intevation.flys.client.client.Config;
19 import de.intevation.flys.client.client.FLYSConstants;
20 import de.intevation.flys.client.client.event.StepForwardEvent;
21 import de.intevation.flys.client.client.services.LoadArtifactServiceAsync;
22 import de.intevation.flys.client.client.services.RemoveArtifactServiceAsync;
23 import de.intevation.flys.client.shared.model.Artifact;
24 import de.intevation.flys.client.shared.model.Collection;
25 import de.intevation.flys.client.shared.model.Data;
26 import de.intevation.flys.client.shared.model.DataItem;
27 import de.intevation.flys.client.shared.model.DataList;
28 import de.intevation.flys.client.shared.model.DefaultData;
29 import de.intevation.flys.client.shared.model.DefaultDataItem;
30 import de.intevation.flys.client.shared.model.Recommendation;
31 import de.intevation.flys.client.shared.model.Recommendation.Facet;
32 import de.intevation.flys.client.shared.model.Recommendation.Filter;
33 import de.intevation.flys.client.shared.model.User;
2 34
3 import java.util.ArrayList; 35 import java.util.ArrayList;
4 import java.util.List; 36 import java.util.List;
5 import java.util.Map; 37 import java.util.Map;
6 import java.util.Set; 38 import java.util.Set;
7
8 import com.google.gwt.core.client.GWT;
9 import com.google.gwt.user.client.rpc.AsyncCallback;
10
11 import com.smartgwt.client.data.Record;
12 import com.smartgwt.client.types.ListGridFieldType;
13 import com.smartgwt.client.widgets.Canvas;
14 import com.smartgwt.client.widgets.layout.HLayout;
15 import com.smartgwt.client.widgets.layout.VLayout;
16 import com.smartgwt.client.widgets.grid.ListGrid;
17 import com.smartgwt.client.widgets.grid.ListGridField;
18 import com.smartgwt.client.widgets.grid.ListGridRecord;
19 import com.smartgwt.client.widgets.events.ClickEvent;
20 import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
21 import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
22
23 import de.intevation.flys.client.shared.model.Artifact;
24 import de.intevation.flys.client.shared.model.Collection;
25 import de.intevation.flys.client.shared.model.Data;
26 import de.intevation.flys.client.shared.model.DataItem;
27 import de.intevation.flys.client.shared.model.DefaultData;
28 import de.intevation.flys.client.shared.model.DefaultDataItem;
29 import de.intevation.flys.client.shared.model.DataList;
30 import de.intevation.flys.client.shared.model.User;
31
32 import de.intevation.flys.client.client.FLYSConstants;
33 import de.intevation.flys.client.client.event.StepForwardEvent;
34 import de.intevation.flys.client.shared.model.Recommendation;
35 import de.intevation.flys.client.shared.model.Recommendation.Facet;
36 import de.intevation.flys.client.shared.model.Recommendation.Filter;
37
38 import de.intevation.flys.client.client.Config;
39 import de.intevation.flys.client.client.services.LoadArtifactService;
40 import de.intevation.flys.client.client.services.LoadArtifactServiceAsync;
41 import de.intevation.flys.client.client.services.RemoveArtifactService;
42 import de.intevation.flys.client.client.services.RemoveArtifactServiceAsync;
43 39
44 // TODO Probably better to branch off AbstractUIProvider. 40 // TODO Probably better to branch off AbstractUIProvider.
45 // TODO Merge with other datacage-widget impls. 41 // TODO Merge with other datacage-widget impls.
46 /** 42 /**
47 * Panel containing a Grid and a "next" button. The Grid is fed by a 43 * Panel containing a Grid and a "next" button. The Grid is fed by a
245 241
246 differencesList.setFields(new ListGridField[] {nameField, 242 differencesList.setFields(new ListGridField[] {nameField,
247 capitalField, removeField}); 243 capitalField, removeField});
248 244
249 differencesList.addRecordClickHandler(new RecordClickHandler() { 245 differencesList.addRecordClickHandler(new RecordClickHandler() {
246 @Override
250 public void onRecordClick(final RecordClickEvent event) { 247 public void onRecordClick(final RecordClickEvent event) {
251 // Just handle remove-clicks 248 // Just handle remove-clicks
252 if(!event.getField().getName().equals(removeField.getName())) { 249 if(!event.getField().getName().equals(removeField.getName())) {
253 return; 250 return;
254 } 251 }
368 for(final String uuid: artifactIdsToRemove) { 365 for(final String uuid: artifactIdsToRemove) {
369 removeArtifactService.remove(this.collection, 366 removeArtifactService.remove(this.collection,
370 uuid, 367 uuid,
371 locale, 368 locale,
372 new AsyncCallback<Collection>() { 369 new AsyncCallback<Collection>() {
370 @Override
373 public void onFailure(Throwable caught) { 371 public void onFailure(Throwable caught) {
374 GWT.log("RemoveArtifact (" + uuid + ") failed."); 372 GWT.log("RemoveArtifact (" + uuid + ") failed.");
375 } 373 }
374 @Override
376 public void onSuccess(Collection collection) { 375 public void onSuccess(Collection collection) {
377 GWT.log("RemoveArtifact succeeded"); 376 GWT.log("RemoveArtifact succeeded");
378 } 377 }
379 }); 378 });
380 } 379 }
385 toClone, 384 toClone,
386 //"staticwkms" and "waterlevel" 385 //"staticwkms" and "waterlevel"
387 null, 386 null,
388 locale, 387 locale,
389 new AsyncCallback<Artifact[]>() { 388 new AsyncCallback<Artifact[]>() {
389 @Override
390 public void onFailure(Throwable caught) { 390 public void onFailure(Throwable caught) {
391 GWT.log("Failure of cloning with factories!"); 391 GWT.log("Failure of cloning with factories!");
392 } 392 }
393 @Override
393 public void onSuccess(Artifact[] artifacts) { 394 public void onSuccess(Artifact[] artifacts) {
394 GWT.log("Successfully cloned " + toClone.length + 395 GWT.log("Successfully cloned " + toClone.length +
395 " with factories."); 396 " with factories.");
396 397
397 fireStepForwardEvent(new StepForwardEvent( 398 fireStepForwardEvent(new StepForwardEvent(

http://dive4elements.wald.intevation.org