comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java @ 1512:685bce693617

Issue451. Avoid loading more than one map output tab. flys-client/trunk@3657 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 12 Jan 2012 09:19:49 +0000
parents 07b9404d7170
children 298a4ce64c2e
comparison
equal deleted inserted replaced
1511:9119bf1f9e5e 1512:685bce693617
107 107
108 /** The layout. */ 108 /** The layout. */
109 protected Layout layout; 109 protected Layout layout;
110 110
111 protected int artifactsQueue; 111 protected int artifactsQueue;
112 protected int recommendationQueue;
112 protected Stack<Recommendation> newRecommendations; 113 protected Stack<Recommendation> newRecommendations;
113 114
114 115
115 /** 116 /**
116 * This constructor creates a new CollectionView that is used to display the 117 * This constructor creates a new CollectionView that is used to display the
130 this.outHandlers = new ArrayList<OutputModesChangeHandler>(); 131 this.outHandlers = new ArrayList<OutputModesChangeHandler>();
131 this.layout = new VLayout(); 132 this.layout = new VLayout();
132 this.parameterList = new ParameterList( 133 this.parameterList = new ParameterList(
133 flys, this, messages.new_project()); 134 flys, this, messages.new_project());
134 this.artifactsQueue = 0; 135 this.artifactsQueue = 0;
136 this.recommendationQueue = 0;
135 this.newRecommendations = new Stack<Recommendation>(); 137 this.newRecommendations = new Stack<Recommendation>();
136 138
137 addCollectionChangeHandler(this); 139 addCollectionChangeHandler(this);
138 addCollectionChangeHandler(parameterList); 140 addCollectionChangeHandler(parameterList);
139 addCollectionChangeHandler(flys); 141 addCollectionChangeHandler(flys);
379 } 381 }
380 382
381 383
382 public void onSuccess(Collection newCollection) { 384 public void onSuccess(Collection newCollection) {
383 GWT.log("Successfully DESCRIBED collection."); 385 GWT.log("Successfully DESCRIBED collection.");
384 setCollection(newCollection); 386 boolean loaded = false;
387 List<Recommendation> r = newCollection.getRecommendations();
388 for (Recommendation rec: r) {
389 loaded = newCollection.loadedRecommendation(rec);
390 }
391 if (loaded) {
392 setCollection(newCollection);
393 }
385 } 394 }
386 } 395 }
387 ); 396 );
388 } 397 }
389 else { 398 else {
586 GWT.log("Successfully added artifact."); 595 GWT.log("Successfully added artifact.");
587 setCollection(newCollection); 596 setCollection(newCollection);
588 597
589 artifactsQueue--; 598 artifactsQueue--;
590 addRecommendationsToCollection(); 599 addRecommendationsToCollection();
600 recommendationQueue++;
591 } 601 }
592 } 602 }
593 ); 603 );
594 } 604 }
595 605
612 } 622 }
613 623
614 public void onSuccess(Collection newCol) { 624 public void onSuccess(Collection newCol) {
615 GWT.log("Successfully saved recommendations."); 625 GWT.log("Successfully saved recommendations.");
616 newRecommendations.removeAllElements(); 626 newRecommendations.removeAllElements();
617 setCollection(newCol); 627 recommendationQueue--;
628 if(recommendationQueue == 0) {
629 setCollection(newCol);
630 }
618 } 631 }
619 } 632 }
620 ); 633 );
621 } 634 }
622 635

http://dive4elements.wald.intevation.org