aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/ui/PopupView.java
diff options
context:
space:
mode:
authorRisto Yrjänä <risto.yrjana@itmill.com>2008-11-12 12:30:56 +0000
committerRisto Yrjänä <risto.yrjana@itmill.com>2008-11-12 12:30:56 +0000
commitc884c18f33ae2a2779fd91a3eba75c3d435d7928 (patch)
treec3144fa082d6a98023415f03bf0ecbeb25ab5c5d /src/com/itmill/toolkit/ui/PopupView.java
parent4715a1d53f04d1fa9c34fa682157bdd3ac6ab369 (diff)
downloadvaadin-framework-c884c18f33ae2a2779fd91a3eba75c3d435d7928.tar.gz
vaadin-framework-c884c18f33ae2a2779fd91a3eba75c3d435d7928.zip
Added a switch for hiding the popup on mouse out
svn changeset:5878/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/ui/PopupView.java')
-rw-r--r--src/com/itmill/toolkit/ui/PopupView.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/ui/PopupView.java b/src/com/itmill/toolkit/ui/PopupView.java
index 0eb4049c86..99c29902d4 100644
--- a/src/com/itmill/toolkit/ui/PopupView.java
+++ b/src/com/itmill/toolkit/ui/PopupView.java
@@ -20,6 +20,7 @@ public class PopupView extends AbstractComponentContainer {
private Content content;
private boolean popupVisible;
+ private boolean hideOnMouseOut;
private final ArrayList<Component> componentList;
/* Constructors */
@@ -57,6 +58,7 @@ public class PopupView extends AbstractComponentContainer {
public PopupView(PopupView.Content content) {
super();
popupVisible = false;
+ hideOnMouseOut = true;
componentList = new ArrayList<Component>(1);
setContent(content);
}
@@ -101,6 +103,28 @@ public class PopupView extends AbstractComponentContainer {
return popupVisible;
}
+ /**
+ * Check if this popup will be hidden when the user takes the mouse cursor
+ * out of the popup area.
+ *
+ * @return true if the popup is hidden on mouse out, false otherwise
+ */
+ public boolean isHideOnMouseOut() {
+ return hideOnMouseOut;
+ }
+
+ /**
+ * Should the popup automaticly hide when the user takes the mouse cursor
+ * out of the popup area? If this is false, the user must click outside the
+ * popup to close it. The default is true.
+ *
+ * @param hideOnMouseOut
+ *
+ */
+ public void setHideOnMouseOut(boolean hideOnMouseOut) {
+ this.hideOnMouseOut = hideOnMouseOut;
+ }
+
/*
* Methods inherited from AbstractComponentContainer. These are unnecessary
* (but mandatory). Most of them are not supported in this implementation.
@@ -199,6 +223,7 @@ public class PopupView extends AbstractComponentContainer {
"Recieved null when trying to paint minimized value.");
}
target.addAttribute("html", content.getMinimizedValueAsHTML());
+ target.addAttribute("hideOnMouseOut", hideOnMouseOut);
// Only paint component to client if we know that the popup is showing
if (popupVisible) {