[Dive4elements-commits] [PATCH 3 of 3] DatacageWidget: Use ScreenLock when loading dc data, solves flys/issue1152

Wald Commits scm-commit at wald.intevation.org
Thu Mar 28 09:22:57 CET 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1364459382 -3600
# Node ID 6ec7c8ebb2c98708ed18c22f5adbb5b276a4ee27
# Parent  a87fe0d2c928ec1f8876078b87c6b846f799636c
DatacageWidget: Use ScreenLock when loading dc data, solves flys/issue1152 .

diff -r a87fe0d2c928 -r 6ec7c8ebb2c9 flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java	Thu Mar 28 09:25:38 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java	Thu Mar 28 09:29:42 2013 +0100
@@ -24,6 +24,7 @@
 import de.intevation.flys.client.client.event.DatacageHandler;
 import de.intevation.flys.client.client.services.MetaDataService;
 import de.intevation.flys.client.client.services.MetaDataServiceAsync;
+import de.intevation.flys.client.client.ui.ScreenLock;
 import de.intevation.flys.client.shared.model.Artifact;
 import de.intevation.flys.client.shared.model.AttrList;
 import de.intevation.flys.client.shared.model.DataCageNode;
@@ -65,6 +66,9 @@
     protected List<DatacageHandler>            handlers;
     protected List<DatacageDoubleClickHandler> doubleHandlers;
 
+    /** Layout to show spinning wheel of joy. */
+    protected VLayout lockScreen;
+
 
     public DatacageWidget() {
         handlers       = new ArrayList<DatacageHandler>();
@@ -168,6 +172,14 @@
         triggerTreeBuilding();
     }
 
+    public void lockUI() {
+        lockScreen = ScreenLock.lockUI(this, lockScreen);
+    }
+
+    /** Enable input, remove grey, remove spinning wheel of joy. */
+    public void unlockUI() {
+        ScreenLock.unlockUI(this, lockScreen);
+    }
 
     /**
      * @param handler Handler to be added (notified on add-action).
@@ -382,6 +394,8 @@
         String artifactId = artifact.getUuid();
         String userId     = (user != null) ? user.identifier() : null;
 
+        lockUI();
+
         metaDataService.getMetaData(
             locale,
             artifactId,
@@ -393,6 +407,7 @@
                 public void onFailure(Throwable caught) {
                     GWT.log("Could not load meta data.");
                     SC.warn(caught.getMessage());
+                    unlockUI();
                 }
 
                 @Override
@@ -416,6 +431,7 @@
                         tree.openAll();
                     }
                     treeGrid.setData(tree);
+                    unlockUI();
                 }
             });
     }


More information about the Dive4elements-commits mailing list