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);
}
public static native void nativeBlur(Element e) /*-{
- if(e.focus) {
- e.blur();
- }
- }-*/;
+ if(e.focus) {
+ e.blur();
+ }
+ }-*/;
private class CustomPopup extends IToolkitOverlay implements Container {
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
}
// 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());
}
*/
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 */
super();
setContent(content);
popupVisible = false;
- componentList = new ArrayList(1);
+ animationEnabled = false;
+ componentList = new ArrayList<Component>(1);
}
/**
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.
}
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();