aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/ui/PopupView.java
diff options
context:
space:
mode:
authorRisto Yrjänä <risto.yrjana@itmill.com>2008-08-28 12:19:56 +0000
committerRisto Yrjänä <risto.yrjana@itmill.com>2008-08-28 12:19:56 +0000
commit05fd737e03c63fd9d69a4169c7130f64d8868f9b (patch)
tree7e43098005e7d55aacd022635859e3e8f45726e7 /src/com/itmill/toolkit/ui/PopupView.java
parent7e465de500430c17dd44deaa667c9218e5af77f2 (diff)
downloadvaadin-framework-05fd737e03c63fd9d69a4169c7130f64d8868f9b.tar.gz
vaadin-framework-05fd737e03c63fd9d69a4169c7130f64d8868f9b.zip
Fixed out of sync bug + refactoring
svn changeset:5288/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/ui/PopupView.java')
-rw-r--r--src/com/itmill/toolkit/ui/PopupView.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/com/itmill/toolkit/ui/PopupView.java b/src/com/itmill/toolkit/ui/PopupView.java
index c3ccb8f088..73f1e583ef 100644
--- a/src/com/itmill/toolkit/ui/PopupView.java
+++ b/src/com/itmill/toolkit/ui/PopupView.java
@@ -45,9 +45,9 @@ public class PopupView extends AbstractComponentContainer {
* @param content
* the PopupView.Content that contains the information for this
*/
- public PopupView(final PopupView.Content content) {
+ public PopupView(PopupView.Content content) {
super();
- itsContent = content;
+ this.itsContent = content;
popupVisible = false;
componentList = new ArrayList(1);
}
@@ -61,8 +61,8 @@ public class PopupView extends AbstractComponentContainer {
* PopupView
*
*/
- public void setContent(PopupView.Content newContent) {
- itsContent = newContent;
+ public void setContent(PopupView.Content content) {
+ this.itsContent = content;
requestRepaint();
}
@@ -87,7 +87,7 @@ public class PopupView extends AbstractComponentContainer {
/*
* Methods inherited from AbstractComponentContainer. These are unnecessary
- * (but mandatory). They are not supported in this implementation.
+ * (but mandatory). Most of them are not supported in this implementation.
*/
/**
@@ -200,12 +200,19 @@ public class PopupView extends AbstractComponentContainer {
*/
public void changeVariables(Object source, Map variables) {
if (variables.containsKey("popupVisibility")) {
+
+ // TODO we could use boolean allowPopup here to prevent popups from
+ // showing
+
popupVisible = ((Boolean) variables.get("popupVisibility"))
.booleanValue();
if (popupVisible) {
- componentList.add(itsContent.getPopupComponent());
- } else {
+ Component c = itsContent.getPopupComponent();
+ componentList.add(c);
+ super.addComponent(c);
+ } else if (!componentList.isEmpty()) {
+ super.removeComponent((Component) componentList.get(0));
componentList.clear();
}
requestRepaint();