annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/Toolbar.java @ 1364:9981ba2ee13a

Display the datacage button in the map toolbar. flys-client/trunk@3063 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 24 Oct 2011 13:35:30 +0000
parents
children f8c03d3af300
rev   line source
1364
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.client.client.ui;
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import com.smartgwt.client.widgets.layout.HLayout;
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4 import com.smartgwt.client.widgets.events.CloseClickHandler;
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5 import com.smartgwt.client.widgets.events.CloseClientEvent;
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 import de.intevation.flys.client.shared.model.Artifact;
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 import de.intevation.flys.client.shared.model.User;
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10 import de.intevation.flys.client.client.event.RedrawRequestHandler;
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 public abstract class Toolbar extends HLayout {
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 protected OutputTab outputTab;
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 public Toolbar(OutputTab outputTab) {
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 super();
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 this.outputTab = outputTab;
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 }
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 public OutputTab getOutputTab() {
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 return outputTab;
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 }
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 public Artifact getArtifact() {
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 return outputTab.getCollectionView().getArtifact();
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 }
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 public User getUser() {
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36 return outputTab.getCollectionView().getUser();
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37 }
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40 protected void openDatacageWindow(RedrawRequestHandler handler) {
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 Artifact artifact = getArtifact();
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 User user = getUser();
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 String outs = getOutputTab().getOutputName();
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 final DatacageWindow dc = new DatacageWindow(
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47 artifact, user, outs, outputTab.getCollectionView());
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 dc.addRedrawRequestHandler(handler);
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 dc.addCloseClickHandler(new CloseClickHandler() {
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 public void onCloseClick(CloseClientEvent event) {
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 dc.destroy();
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 }
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53 });
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 dc.show();
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 }
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56 }
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org