[Dive4elements-commits] [PATCH 1 of 3] New ScrenLock class to ease refactoring and reuse of spinning-wheel-show

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


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1364459081 -3600
# Node ID b19f0fd301fcb5b45a2a782c0d30faed1dfa6c82
# Parent  3b5e1535a459e909e1263d69dcb8d7a70be34dfe
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.

diff -r 3b5e1535a459 -r b19f0fd301fc flys-client/src/main/java/de/intevation/flys/client/client/ui/ScreenLock.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ScreenLock.java	Thu Mar 28 09:24:41 2013 +0100
@@ -0,0 +1,55 @@
+package de.intevation.flys.client.client.ui;
+
+import com.google.gwt.core.client.GWT;
+
+import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.types.VerticalAlignment;
+import com.smartgwt.client.widgets.Img;
+import com.smartgwt.client.widgets.layout.HLayout;
+import com.smartgwt.client.widgets.layout.Layout;
+import com.smartgwt.client.widgets.layout.VLayout;
+
+import de.intevation.flys.client.client.FLYSConstants;
+
+/** Basic static functionality to show spinning wheel. */
+public class ScreenLock {
+
+    /** The message class that provides i18n strings. */
+    protected static FLYSConstants messages = GWT.create(FLYSConstants.class);
+
+    /** Disables input, grey out, show spinning wheel of joy. */
+    public static VLayout lockUI(Layout layout, VLayout lockScreen) {
+        if (lockScreen == null) {
+            lockScreen = new VLayout();
+            lockScreen.setWidth100();
+            lockScreen.setHeight100();
+            lockScreen.setBackgroundColor("#7f7f7f");
+            lockScreen.setOpacity(50);
+            lockScreen.setAlign(VerticalAlignment.CENTER);
+            lockScreen.setDefaultLayoutAlign(VerticalAlignment.CENTER);
+
+            HLayout inner = new HLayout();
+            inner.setAlign(Alignment.CENTER);
+            inner.setDefaultLayoutAlign(Alignment.CENTER);
+            inner.setOpacity(100);
+
+            Img img = new Img(
+                GWT.getHostPageBaseURL() + messages.loadingImg(),
+                25, 25);
+
+            inner.addMember(img);
+
+            lockScreen.addMember(inner);
+        }
+
+        layout.addChild(lockScreen);
+        return lockScreen;
+    }
+
+    /** Enable input, remove grey, remove spinning wheel of joy. */
+    public static void unlockUI(Layout layout, VLayout lockScreen) {
+        layout.removeChild(lockScreen);
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
+


More information about the Dive4elements-commits mailing list