]> source.dussan.org Git - vaadin-framework.git/commitdiff
Changed to comply to Java 1.5 and GWT 1.5, added setAnimation(boolean)
authorRisto Yrjänä <risto.yrjana@itmill.com>
Tue, 16 Sep 2008 14:31:10 +0000 (14:31 +0000)
committerRisto Yrjänä <risto.yrjana@itmill.com>
Tue, 16 Sep 2008 14:31:10 +0000 (14:31 +0000)
svn changeset:5416/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IPopupView.java
src/com/itmill/toolkit/ui/PopupView.java

index 1fb53a68c07720e6a62f7a8feb110e914e2f4547..a4867d44af147629bee4b55e0caf39e86a404a5f 100644 (file)
@@ -99,6 +99,10 @@ public class IPopupView extends HTML implements Paintable {
             setTitle(uidl.getStringAttribute("description"));
         }
 
+        if (uidl.hasAttribute("animation")) {
+            popup.setAnimationEnabled(uidl.getBooleanAttribute("animation"));
+        }
+
         // Render the popup if visible and show it.
         if (hostPopupVisible) {
             UIDL popupUIDL = uidl.getChildUIDL(0);
@@ -167,10 +171,10 @@ public class IPopupView extends HTML implements Paintable {
     }
 
     public static native void nativeBlur(Element e) /*-{ 
-                            if(e.focus) {
-                            e.blur();
-                            }
-                            }-*/;
+                                     if(e.focus) {
+                                     e.blur();
+                                     }
+                                     }-*/;
 
     private class CustomPopup extends IToolkitOverlay implements Container {
 
@@ -179,11 +183,11 @@ public class IPopupView extends HTML implements Paintable {
         private ICaptionWrapper captionWrapper = null;
 
         private boolean hasHadMouseOver = false;
-        private Set activeChildren;
+        private Set<Element> activeChildren;
 
         public CustomPopup() {
             super(true, false, true); // autoHide, not modal, dropshadow
-            activeChildren = new HashSet();
+            activeChildren = new HashSet<Element>();
         }
 
         // For some reason ONMOUSEOUT events are not always recieved, so we have
@@ -222,7 +226,7 @@ public class IPopupView extends HTML implements Paintable {
             }
 
             // Notify children that have used the keyboard
-            for (Iterator iterator = activeChildren.iterator(); iterator
+            for (Iterator<Element> iterator = activeChildren.iterator(); iterator
                     .hasNext();) {
                 nativeBlur((Element) iterator.next());
             }
index 51cbde96e9b88f37878ea2fc28df01760eba8cbd..4e8a18a3b25c316a647db44caffbb60c9a98c6d9 100644 (file)
@@ -18,9 +18,10 @@ import com.itmill.toolkit.terminal.PaintTarget;
  */
 public class PopupView extends AbstractComponentContainer {
 
-    Content content;
-    boolean popupVisible;
-    ArrayList componentList;
+    private Content content;
+    private boolean popupVisible;
+    private ArrayList<Component> componentList;
+    private boolean animationEnabled;
 
     /* Constructors */
 
@@ -58,7 +59,8 @@ public class PopupView extends AbstractComponentContainer {
         super();
         setContent(content);
         popupVisible = false;
-        componentList = new ArrayList(1);
+        animationEnabled = false;
+        componentList = new ArrayList<Component>(1);
     }
 
     /**
@@ -101,6 +103,24 @@ public class PopupView extends AbstractComponentContainer {
         return popupVisible;
     }
 
+    /**
+     * Enable / disable popup viewing animation
+     * 
+     * @param enabled
+     */
+    public void setAnimation(boolean enabled) {
+        animationEnabled = enabled;
+    }
+
+    /**
+     * Query if the viewing animation is enabled.
+     * 
+     * @return true if the animation is enabled
+     */
+    public boolean isAnimationEnabled() {
+        return animationEnabled;
+    }
+
     /*
      * Methods inherited from AbstractComponentContainer. These are unnecessary
      * (but mandatory). Most of them are not supported in this implementation.
@@ -200,7 +220,7 @@ public class PopupView extends AbstractComponentContainer {
         }
         target.addAttribute("html", content.getMinimizedValueAsHTML());
         target.addAttribute("popupVisible", popupVisible);
-
+        target.addAttribute("animation", animationEnabled);
         // Only paint component to client if we know that the popup is showing
         if (popupVisible) {
             Component c = content.getPopupComponent();