diff flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.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 064fb5d181ea
children 748e7c828d03
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java	Mon Oct 24 10:53:39 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java	Mon Oct 24 13:35:30 2011 +0000
@@ -6,26 +6,20 @@
 import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.ImgButton;
 import com.smartgwt.client.widgets.Label;
-import com.smartgwt.client.widgets.layout.HLayout;
 import com.smartgwt.client.widgets.events.ClickEvent;
 import com.smartgwt.client.widgets.events.ClickHandler;
-import com.smartgwt.client.widgets.events.CloseClickHandler;
-import com.smartgwt.client.widgets.events.CloseClientEvent;
-
-import de.intevation.flys.client.shared.model.Artifact;
-import de.intevation.flys.client.shared.model.User;
 
 import de.intevation.flys.client.client.FLYSConstants;
 import de.intevation.flys.client.client.FLYSImages;
 import de.intevation.flys.client.client.ui.CollectionView;
-import de.intevation.flys.client.client.ui.DatacageWindow;
 import de.intevation.flys.client.client.ui.ImgLink;
+import de.intevation.flys.client.client.ui.Toolbar;
 
 
 /**
  * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
  */
-public class ChartToolbar extends HLayout {
+public class ChartToolbar extends Toolbar {
 
     protected static FLYSConstants MSG = GWT.create(FLYSConstants.class);
 
@@ -35,8 +29,6 @@
     public static final int PANEL_HEIGHT = 30;
 
 
-    protected CollectionView view;
-
     protected ChartOutputTab chartTab;
 
 
@@ -63,11 +55,9 @@
 
 
     public ChartToolbar(CollectionView view, ChartOutputTab chartTab) {
-        super();
+        super(chartTab);
 
-        this.view       = view;
         this.chartTab   = chartTab;
-
         datacage        = new Button(MSG.databasket());
         position        = new MousePositionPanel(chartTab);
         zoombox         = new ZoomboxControl(chartTab, MSG.zoom_in());
@@ -79,7 +69,7 @@
         datacage.addClickHandler(new ClickHandler() {
             public void onClick(ClickEvent event) {
                 GWT.log("Clicked 'datacage' button.");
-                openDatacageWindow();
+                openDatacageWindow((ChartOutputTab) getOutputTab());
             }
         });
 
@@ -166,15 +156,6 @@
     }
 
 
-    public Artifact getArtifact() {
-        return view.getArtifact();
-    }
-
-    public User getUser() {
-        return view.getUser();
-    }
-
-
     public ChartOutputTab getChartOutputTab() {
         return chartTab;
     }
@@ -204,23 +185,5 @@
         addMember(spacer);
         addMember(position);
     }
-
-
-    protected void openDatacageWindow() {
-        Artifact artifact = getArtifact();
-        User     user     = getUser();
-
-        String outs = chartTab.getOutputName();
-
-        final DatacageWindow dc = new DatacageWindow(
-            artifact, user, outs, view);
-        dc.addRedrawRequestHandler(chartTab);
-        dc.addCloseClickHandler(new CloseClickHandler() {
-            public void onCloseClick(CloseClientEvent event) {
-                dc.destroy();
-            }
-        });
-        dc.show();
-    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org