Mercurial > dive4elements > river
diff 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 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java Wed Jul 18 09:57:21 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java Wed Jul 18 12:12:46 2012 +0000 @@ -330,6 +330,7 @@ handler.addStepForwardHandler(new StepForwardHandler() { public void onStepForward(StepForwardEvent event) { + lockUI(); Data[] data = event.getData(); DataItem[] moduleItems = data[0].getItems(); @@ -340,6 +341,7 @@ if (module == null) { // TODO throw / show error! + unlockUI(); return; } @@ -355,6 +357,7 @@ locale, module.toLowerCase(), null, new AsyncCallback<Artifact>() { public void onFailure(Throwable caught) { + unlockUI(); GWT.log("Could not create the new artifact."); SC.warn(MSG.getString(caught.getMessage())); } @@ -365,6 +368,7 @@ forwardService.go(locale, artifact, feedData, new AsyncCallback<Artifact>() { public void onFailure(Throwable caught) { + unlockUI(); GWT.log("Could not feed the artifact."); SC.warn(caught.getMessage()); } @@ -374,6 +378,7 @@ old.clear(); cView.addArtifactToCollection(artifact); setArtifact(artifact); + unlockUI(); } }); } @@ -582,6 +587,7 @@ */ public void onStepForward(StepForwardEvent event) { GWT.log("CollectionView - onStepForward()"); + lockUI(); Config config = Config.getInstance(); String locale = config.getLocale(); @@ -589,6 +595,7 @@ forwardService.go(locale, artifact, event.getData(), new AsyncCallback<Artifact>() { public void onFailure(Throwable caught) { + unlockUI(); GWT.log("Could not feed the artifact."); SC.warn(MSG.getString(caught.getMessage())); } @@ -598,6 +605,7 @@ old.clear(); setArtifact(artifact, true); + unlockUI(); } }); } @@ -610,6 +618,7 @@ * @param e The StepBackEvent that holds the identifier of the target state. */ public void onStepBack(StepBackEvent e) { + lockUI(); final String target = e.getTarget(); Config config = Config.getInstance(); @@ -618,6 +627,7 @@ advanceService.advance(locale, artifact, target, new AsyncCallback<Artifact>() { public void onFailure(Throwable caught) { + unlockUI(); GWT.log("Could not go back to '" + target + "'"); SC.warn(MSG.getString(caught.getMessage())); } @@ -628,6 +638,7 @@ old.clear(); setArtifact(artifact, false); + unlockUI(); } } ); @@ -874,5 +885,15 @@ public void registerCollectionViewTabHandler (TabSelectedHandler tsh) { this.cView.registerTabHandler (tsh); } + + + protected void lockUI() { + cView.lockUI(); + } + + + protected void unlockUI() { + cView.unlockUI(); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :