[Dive4elements-commits] [PATCH 07 of 11] Hide the manage project button if the project list is shown

Wald Commits scm-commit at wald.intevation.org
Fri Nov 30 12:02:12 CET 2012


# HG changeset patch
# User Björn Ricks <bjoern.ricks at intevation.de>
# Date 1354266944 -3600
# Node ID c1c4c95ae9e4a4ec350f05d979f76705a210f2eb
# Parent  488db475613d1f04b86c540ff75a0249e0f99c5d
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.

diff -r 488db475613d -r c1c4c95ae9e4 flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java
--- 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 :


More information about the Dive4elements-commits mailing list