Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/ScreenLock.java @ 5486:b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 28 Mar 2013 09:24:41 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
5485:3b5e1535a459 | 5486:b19f0fd301fc |
---|---|
1 package de.intevation.flys.client.client.ui; | |
2 | |
3 import com.google.gwt.core.client.GWT; | |
4 | |
5 import com.smartgwt.client.types.Alignment; | |
6 import com.smartgwt.client.types.VerticalAlignment; | |
7 import com.smartgwt.client.widgets.Img; | |
8 import com.smartgwt.client.widgets.layout.HLayout; | |
9 import com.smartgwt.client.widgets.layout.Layout; | |
10 import com.smartgwt.client.widgets.layout.VLayout; | |
11 | |
12 import de.intevation.flys.client.client.FLYSConstants; | |
13 | |
14 /** Basic static functionality to show spinning wheel. */ | |
15 public class ScreenLock { | |
16 | |
17 /** The message class that provides i18n strings. */ | |
18 protected static FLYSConstants messages = GWT.create(FLYSConstants.class); | |
19 | |
20 /** Disables input, grey out, show spinning wheel of joy. */ | |
21 public static VLayout lockUI(Layout layout, VLayout lockScreen) { | |
22 if (lockScreen == null) { | |
23 lockScreen = new VLayout(); | |
24 lockScreen.setWidth100(); | |
25 lockScreen.setHeight100(); | |
26 lockScreen.setBackgroundColor("#7f7f7f"); | |
27 lockScreen.setOpacity(50); | |
28 lockScreen.setAlign(VerticalAlignment.CENTER); | |
29 lockScreen.setDefaultLayoutAlign(VerticalAlignment.CENTER); | |
30 | |
31 HLayout inner = new HLayout(); | |
32 inner.setAlign(Alignment.CENTER); | |
33 inner.setDefaultLayoutAlign(Alignment.CENTER); | |
34 inner.setOpacity(100); | |
35 | |
36 Img img = new Img( | |
37 GWT.getHostPageBaseURL() + messages.loadingImg(), | |
38 25, 25); | |
39 | |
40 inner.addMember(img); | |
41 | |
42 lockScreen.addMember(inner); | |
43 } | |
44 | |
45 layout.addChild(lockScreen); | |
46 return lockScreen; | |
47 } | |
48 | |
49 /** Enable input, remove grey, remove spinning wheel of joy. */ | |
50 public static void unlockUI(Layout layout, VLayout lockScreen) { | |
51 layout.removeChild(lockScreen); | |
52 } | |
53 } | |
54 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | |
55 |