Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java @ 3353:08f8524a81ad
Lock the screen when the parameterization of a Collection's master Artifact changes.
flys-client/trunk@5036 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 18 Jul 2012 12:12:46 +0000 |
parents | f2039d030b5e |
children | 8d3e48f189d2 |
comparison
equal
deleted
inserted
replaced
3352:2f533220af1c | 3353:08f8524a81ad |
---|---|
328 | 328 |
329 widget.setContainer(helperPanel); | 329 widget.setContainer(helperPanel); |
330 | 330 |
331 handler.addStepForwardHandler(new StepForwardHandler() { | 331 handler.addStepForwardHandler(new StepForwardHandler() { |
332 public void onStepForward(StepForwardEvent event) { | 332 public void onStepForward(StepForwardEvent event) { |
333 lockUI(); | |
333 Data[] data = event.getData(); | 334 Data[] data = event.getData(); |
334 | 335 |
335 DataItem[] moduleItems = data[0].getItems(); | 336 DataItem[] moduleItems = data[0].getItems(); |
336 DataItem[] riversItems = data[1].getItems(); | 337 DataItem[] riversItems = data[1].getItems(); |
337 | 338 |
338 String module = moduleItems[0].getStringValue(); | 339 String module = moduleItems[0].getStringValue(); |
339 String river = riversItems[0].getStringValue(); | 340 String river = riversItems[0].getStringValue(); |
340 | 341 |
341 if (module == null) { | 342 if (module == null) { |
342 // TODO throw / show error! | 343 // TODO throw / show error! |
344 unlockUI(); | |
343 return; | 345 return; |
344 } | 346 } |
345 | 347 |
346 String newTitle = MSG.getString(module); | 348 String newTitle = MSG.getString(module); |
347 setTitle(newTitle); | 349 setTitle(newTitle); |
353 | 355 |
354 artifactService.create( | 356 artifactService.create( |
355 locale, module.toLowerCase(), null, | 357 locale, module.toLowerCase(), null, |
356 new AsyncCallback<Artifact>() { | 358 new AsyncCallback<Artifact>() { |
357 public void onFailure(Throwable caught) { | 359 public void onFailure(Throwable caught) { |
360 unlockUI(); | |
358 GWT.log("Could not create the new artifact."); | 361 GWT.log("Could not create the new artifact."); |
359 SC.warn(MSG.getString(caught.getMessage())); | 362 SC.warn(MSG.getString(caught.getMessage())); |
360 } | 363 } |
361 | 364 |
362 public void onSuccess(Artifact artifact) { | 365 public void onSuccess(Artifact artifact) { |
363 GWT.log("Successfully created a new artifact."); | 366 GWT.log("Successfully created a new artifact."); |
364 | 367 |
365 forwardService.go(locale, artifact, feedData, | 368 forwardService.go(locale, artifact, feedData, |
366 new AsyncCallback<Artifact>() { | 369 new AsyncCallback<Artifact>() { |
367 public void onFailure(Throwable caught) { | 370 public void onFailure(Throwable caught) { |
371 unlockUI(); | |
368 GWT.log("Could not feed the artifact."); | 372 GWT.log("Could not feed the artifact."); |
369 SC.warn(caught.getMessage()); | 373 SC.warn(caught.getMessage()); |
370 } | 374 } |
371 | 375 |
372 public void onSuccess(Artifact artifact) { | 376 public void onSuccess(Artifact artifact) { |
373 GWT.log("Successfully feed the artifact."); | 377 GWT.log("Successfully feed the artifact."); |
374 old.clear(); | 378 old.clear(); |
375 cView.addArtifactToCollection(artifact); | 379 cView.addArtifactToCollection(artifact); |
376 setArtifact(artifact); | 380 setArtifact(artifact); |
381 unlockUI(); | |
377 } | 382 } |
378 }); | 383 }); |
379 } | 384 } |
380 }); | 385 }); |
381 } | 386 } |
580 * | 585 * |
581 * @param event The StepForwardEvent. | 586 * @param event The StepForwardEvent. |
582 */ | 587 */ |
583 public void onStepForward(StepForwardEvent event) { | 588 public void onStepForward(StepForwardEvent event) { |
584 GWT.log("CollectionView - onStepForward()"); | 589 GWT.log("CollectionView - onStepForward()"); |
590 lockUI(); | |
585 | 591 |
586 Config config = Config.getInstance(); | 592 Config config = Config.getInstance(); |
587 String locale = config.getLocale(); | 593 String locale = config.getLocale(); |
588 | 594 |
589 forwardService.go(locale, artifact, event.getData(), | 595 forwardService.go(locale, artifact, event.getData(), |
590 new AsyncCallback<Artifact>() { | 596 new AsyncCallback<Artifact>() { |
591 public void onFailure(Throwable caught) { | 597 public void onFailure(Throwable caught) { |
598 unlockUI(); | |
592 GWT.log("Could not feed the artifact."); | 599 GWT.log("Could not feed the artifact."); |
593 SC.warn(MSG.getString(caught.getMessage())); | 600 SC.warn(MSG.getString(caught.getMessage())); |
594 } | 601 } |
595 | 602 |
596 public void onSuccess(Artifact artifact) { | 603 public void onSuccess(Artifact artifact) { |
597 GWT.log("Successfully feed the artifact."); | 604 GWT.log("Successfully feed the artifact."); |
598 old.clear(); | 605 old.clear(); |
599 | 606 |
600 setArtifact(artifact, true); | 607 setArtifact(artifact, true); |
608 unlockUI(); | |
601 } | 609 } |
602 }); | 610 }); |
603 } | 611 } |
604 | 612 |
605 | 613 |
608 * has clicked the step back button. | 616 * has clicked the step back button. |
609 * | 617 * |
610 * @param e The StepBackEvent that holds the identifier of the target state. | 618 * @param e The StepBackEvent that holds the identifier of the target state. |
611 */ | 619 */ |
612 public void onStepBack(StepBackEvent e) { | 620 public void onStepBack(StepBackEvent e) { |
621 lockUI(); | |
613 final String target = e.getTarget(); | 622 final String target = e.getTarget(); |
614 | 623 |
615 Config config = Config.getInstance(); | 624 Config config = Config.getInstance(); |
616 final String locale = config.getLocale(); | 625 final String locale = config.getLocale(); |
617 | 626 |
618 advanceService.advance(locale, artifact, target, | 627 advanceService.advance(locale, artifact, target, |
619 new AsyncCallback<Artifact>() { | 628 new AsyncCallback<Artifact>() { |
620 public void onFailure(Throwable caught) { | 629 public void onFailure(Throwable caught) { |
630 unlockUI(); | |
621 GWT.log("Could not go back to '" + target + "'"); | 631 GWT.log("Could not go back to '" + target + "'"); |
622 SC.warn(MSG.getString(caught.getMessage())); | 632 SC.warn(MSG.getString(caught.getMessage())); |
623 } | 633 } |
624 | 634 |
625 public void onSuccess(Artifact artifact) { | 635 public void onSuccess(Artifact artifact) { |
626 GWT.log("Successfully step back to '" + target + "'"); | 636 GWT.log("Successfully step back to '" + target + "'"); |
627 | 637 |
628 old.clear(); | 638 old.clear(); |
629 | 639 |
630 setArtifact(artifact, false); | 640 setArtifact(artifact, false); |
641 unlockUI(); | |
631 } | 642 } |
632 } | 643 } |
633 ); | 644 ); |
634 } | 645 } |
635 | 646 |
872 | 883 |
873 | 884 |
874 public void registerCollectionViewTabHandler (TabSelectedHandler tsh) { | 885 public void registerCollectionViewTabHandler (TabSelectedHandler tsh) { |
875 this.cView.registerTabHandler (tsh); | 886 this.cView.registerTabHandler (tsh); |
876 } | 887 } |
888 | |
889 | |
890 protected void lockUI() { | |
891 cView.lockUI(); | |
892 } | |
893 | |
894 | |
895 protected void unlockUI() { | |
896 cView.unlockUI(); | |
897 } | |
877 } | 898 } |
878 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 899 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |