diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-11-28 16:08:37 +0000 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2012-11-28 16:08:37 +0000 |
commit | 8693cae9f026a2fb1d69cb525511773042a72162 (patch) | |
tree | 7263ec15e4edc380d7959affd3ede6d29993b848 /server/src/com/vaadin | |
parent | 63c5fe19901d62f6d79434cdee2aa3da13db535b (diff) | |
parent | 7b0485a5838a070b971d91f8321d6bf6778c3f86 (diff) | |
download | vaadin-framework-8693cae9f026a2fb1d69cb525511773042a72162.tar.gz vaadin-framework-8693cae9f026a2fb1d69cb525511773042a72162.zip |
Merge "Moved setVisible dirty logic to AbstractComponent where it belongs (#10414)"
Diffstat (limited to 'server/src/com/vaadin')
-rw-r--r-- | server/src/com/vaadin/ui/AbstractComponent.java | 9 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/AbstractComponentContainer.java | 13 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/AbstractSingleComponentContainer.java | 13 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/Form.java | 13 |
4 files changed, 8 insertions, 40 deletions
diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index 876a6c482d..63cf19283f 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -401,7 +401,14 @@ public abstract class AbstractComponent extends AbstractClientConnector } this.visible = visible; - markAsDirty(); + if (visible) { + /* + * If the visibility state is toggled from invisible to visible it + * affects all children (the whole hierarchy) in addition to this + * component. + */ + markAsDirtyRecursive(); + } if (getParent() != null) { // Must always repaint the parent (at least the hierarchy) when // visibility of a child component changes. diff --git a/server/src/com/vaadin/ui/AbstractComponentContainer.java b/server/src/com/vaadin/ui/AbstractComponentContainer.java index 427bb3491c..4dd8a8d24a 100644 --- a/server/src/com/vaadin/ui/AbstractComponentContainer.java +++ b/server/src/com/vaadin/ui/AbstractComponentContainer.java @@ -232,19 +232,6 @@ public abstract class AbstractComponentContainer extends AbstractComponent } @Override - public void setVisible(boolean visible) { - if (isVisible() == visible) { - return; - } - - super.setVisible(visible); - // If the visibility state is toggled it might affect all children - // as well, e.g. make container visible should make children visible if - // they were only hidden because the container was hidden. - markAsDirtyRecursive(); - } - - @Override public void setWidth(float width, Unit unit) { /* * child tree repaints may be needed, due to our fall back support for diff --git a/server/src/com/vaadin/ui/AbstractSingleComponentContainer.java b/server/src/com/vaadin/ui/AbstractSingleComponentContainer.java index 7297318e95..5ff56d46dc 100644 --- a/server/src/com/vaadin/ui/AbstractSingleComponentContainer.java +++ b/server/src/com/vaadin/ui/AbstractSingleComponentContainer.java @@ -103,19 +103,6 @@ public abstract class AbstractSingleComponentContainer extends } @Override - public void setVisible(boolean visible) { - if (isVisible() == visible) { - return; - } - - super.setVisible(visible); - // If the visibility state is toggled it might affect all children - // aswell, e.g. make container visible should make children visible if - // they were only hidden because the container was hidden. - markAsDirtyRecursive(); - } - - @Override public Component getContent() { return content; } diff --git a/server/src/com/vaadin/ui/Form.java b/server/src/com/vaadin/ui/Form.java index 68ebb079f9..862d98bb3c 100644 --- a/server/src/com/vaadin/ui/Form.java +++ b/server/src/com/vaadin/ui/Form.java @@ -1374,17 +1374,4 @@ public class Form extends AbstractField<Object> implements Item.Editor, return count; } - @Override - public void setVisible(boolean visible) { - if (isVisible() == visible) { - return; - } - - super.setVisible(visible); - // If the visibility state is toggled it might affect all children - // aswell, e.g. make container visible should make children visible if - // they were only hidden because the container was hidden. - markAsDirtyRecursive(); - } - } |