Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ScreenLock.java @ 8443:df65f24af5bc
(issue1762) Use getValue to obtain dateRange values
The getToValue was always the initial value regardless
of what has been entered in the form.
According to the documentation both getToValue and getFromValue
should return the "initial value" of the form field. But wether
this means the value before validation corrections or the value
the field is initialized with (which is also not true in both
cases as the field is set only after creation) It returned
the real value for the from date but not for the to date.
With an explicit getValue we workaround this issue.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 22 Oct 2014 17:33:43 +0200 |
parents | ea9eef426962 |
children |
rev | line source |
---|---|
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
9 package org.dive4elements.river.client.client.ui; |
5486
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
10 |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
11 import com.google.gwt.core.client.GWT; |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
12 |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
13 import com.smartgwt.client.types.Alignment; |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
14 import com.smartgwt.client.types.VerticalAlignment; |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
15 import com.smartgwt.client.widgets.Img; |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
16 import com.smartgwt.client.widgets.layout.HLayout; |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
17 import com.smartgwt.client.widgets.layout.Layout; |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
18 import com.smartgwt.client.widgets.layout.VLayout; |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
20 import org.dive4elements.river.client.client.FLYSConstants; |
5486
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
21 |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
22 /** Basic static functionality to show spinning wheel. */ |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
23 public class ScreenLock { |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
24 |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
25 /** The message class that provides i18n strings. */ |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
26 protected static FLYSConstants messages = GWT.create(FLYSConstants.class); |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
27 |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
28 /** Disables input, grey out, show spinning wheel of joy. */ |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
29 public static VLayout lockUI(Layout layout, VLayout lockScreen) { |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
30 if (lockScreen == null) { |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
31 lockScreen = new VLayout(); |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
32 lockScreen.setWidth100(); |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
33 lockScreen.setHeight100(); |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
34 lockScreen.setBackgroundColor("#7f7f7f"); |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
35 lockScreen.setOpacity(50); |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
36 lockScreen.setAlign(VerticalAlignment.CENTER); |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
37 lockScreen.setDefaultLayoutAlign(VerticalAlignment.CENTER); |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
38 |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
39 HLayout inner = new HLayout(); |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
40 inner.setAlign(Alignment.CENTER); |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
41 inner.setDefaultLayoutAlign(Alignment.CENTER); |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
42 inner.setOpacity(100); |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
43 |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
44 Img img = new Img( |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
45 GWT.getHostPageBaseURL() + messages.loadingImg(), |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
46 25, 25); |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
47 |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
48 inner.addMember(img); |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
49 |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
50 lockScreen.addMember(inner); |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
51 } |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
52 |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
53 layout.addChild(lockScreen); |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
54 return lockScreen; |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
55 } |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
56 |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
57 /** Enable input, remove grey, remove spinning wheel of joy. */ |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
58 public static void unlockUI(Layout layout, VLayout lockScreen) { |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
59 layout.removeChild(lockScreen); |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
60 } |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
61 } |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
62 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |
b19f0fd301fc
New ScrenLock class to ease refactoring and reuse of spinning-wheel-show.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
63 |