Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/LoadingPanel.java @ 865:43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
flys-client/trunk@2672 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 08 Sep 2011 07:44:05 +0000 |
parents | c9549074ecd1 |
children | d5fb88ba99d2 |
rev | line source |
---|---|
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.client.ui; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import com.google.gwt.core.client.GWT; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 import com.google.gwt.user.client.Timer; |
865
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
5 import com.google.gwt.user.client.rpc.AsyncCallback; |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 import com.smartgwt.client.types.Alignment; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import com.smartgwt.client.types.Positioning; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 import com.smartgwt.client.widgets.Canvas; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import com.smartgwt.client.widgets.Label; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import com.smartgwt.client.widgets.layout.HLayout; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 |
865
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
13 import de.intevation.flys.client.client.Config; |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
14 import de.intevation.flys.client.client.services.DescribeArtifactService; |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
15 import de.intevation.flys.client.client.services.DescribeArtifactServiceAsync; |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.flys.client.shared.model.Artifact; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 public class LoadingPanel extends Canvas { |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 |
865
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
21 public static final int UPDATE_INTERVAL = 1000 * 10; |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
22 |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
23 public static final DescribeArtifactServiceAsync describe = |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
24 GWT.create(DescribeArtifactService.class); |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
25 |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 protected CollectionView parent; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 protected Artifact artifact; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 protected HLayout dialog; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 protected Label msg; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 protected int i; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 public LoadingPanel(CollectionView parent, Artifact artifact) { |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 super(); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 this.parent = parent; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 this.artifact = artifact; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 this.msg = new Label(); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 this.dialog = createDialog(); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 this.i = 0; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 initLayout(); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 startTimer(); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 } |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 private void initLayout() { |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 setWidth("100%"); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 setHeight("98%"); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 setBackgroundColor("#22AAFF"); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 setOpacity(50); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 setPosition(Positioning.RELATIVE); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 parent.addChild(this); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 parent.addChild(dialog); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 dialog.moveTo(0, 20); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 moveTo(0, 7); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 } |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 |
865
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
65 public void setArtifact(Artifact artifact) { |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
66 this.artifact = artifact; |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
67 } |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
68 |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
69 |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 protected HLayout createDialog() { |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 msg.setStyleName("loading-message"); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 msg.setWidth(200); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 msg.setHeight(100); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 dialog = new HLayout(); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 dialog.setDefaultLayoutAlign(Alignment.CENTER); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 dialog.setAlign(Alignment.CENTER); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 dialog.setWidth100(); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 dialog.setHeight100(); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 dialog.setBorder("1px solid green"); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 dialog.addMember(msg); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 return dialog; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 } |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 private void startTimer() { |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 Timer t = new Timer() { |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 @Override |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 public void run() { |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 update(); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 } |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 }; |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 t.schedule(UPDATE_INTERVAL); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 } |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 |
865
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
99 protected void update() { |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 msg.setContents("This is update -> " + String.valueOf(i++)); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 |
865
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
102 final Config config = Config.getInstance(); |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
103 final String url = config.getServerUrl(); |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
104 final String locale = config.getLocale(); |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 |
865
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
106 describe.describe(url, locale, artifact, new AsyncCallback<Artifact>() { |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
107 public void onFailure(Throwable t) { |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
108 GWT.log("Error while DESCRIBE artifact: " + t.getMessage()); |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
109 // SC.warn()... |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
110 startTimer(); |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
111 } |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 |
865
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
113 public void onSuccess(Artifact artifact) { |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
114 GWT.log("Successfully DESCRIBE artifact."); |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
115 |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
116 setArtifact(artifact); |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
117 |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
118 if (artifact.isInBackground()) { |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
119 startTimer(); |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
120 } |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
121 else { |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
122 finish(); |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
123 } |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
124 } |
43f520f923a8
Remove the loading panel when its Artifact's background process is finished.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
862
diff
changeset
|
125 }); |
862
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
126 } |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 private void finish() { |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 parent.removeChild(this); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 parent.removeChild(dialog); |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 } |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 } |
c9549074ecd1
Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |