changeset 4605:c1c4c95ae9e4

Hide the manage project button if the project list is shown If a user closes the project list the manage projects button should be shown and hidden otherwise.
author Björn Ricks <bjoern.ricks@intevation.de>
date Fri, 30 Nov 2012 10:15:44 +0100
parents 488db475613d
children 6e68e83149f6
files flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java
diffstat 1 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java	Fri Nov 30 10:00:39 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java	Fri Nov 30 10:15:44 2012 +0100
@@ -20,6 +20,8 @@
 import com.smartgwt.client.util.SC;
 import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.Label;
+import com.smartgwt.client.widgets.events.VisibilityChangedEvent;
+import com.smartgwt.client.widgets.events.VisibilityChangedHandler;
 import com.smartgwt.client.widgets.grid.CellFormatter;
 import com.smartgwt.client.widgets.grid.HoverCustomizer;
 import com.smartgwt.client.widgets.grid.ListGrid;
@@ -90,7 +92,8 @@
  */
 public class ProjectList
 extends      VLayout
-implements   CollectionChangeHandler, EditCompleteHandler, FilterHandler
+implements   CollectionChangeHandler, EditCompleteHandler, FilterHandler,
+             VisibilityChangedHandler
 {
     /** Interval to refresh the user's projects.*/
     public static final int UPDATE_INTERVAL = 30000;
@@ -191,6 +194,8 @@
 
         grid.addEditCompleteHandler(this);
 
+        addVisibilityChangedHandler(this);
+
         updateUserCollections();
     }
 
@@ -963,5 +968,16 @@
             }
         );
     }
+
+
+    @Override
+    public void onVisibilityChanged(VisibilityChangedEvent event) {
+        if (event.getIsVisible()) {
+            this.flys.hideHeaderProjectButton();
+        }
+        else {
+            this.flys.shoHeaderProjectButton();
+        }
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org