diff options
author | Marc Englund <marc.englund@itmill.com> | 2008-09-25 12:24:48 +0000 |
---|---|---|
committer | Marc Englund <marc.englund@itmill.com> | 2008-09-25 12:24:48 +0000 |
commit | 050c07d1e8df84a13c8549ef1d5192abde269399 (patch) | |
tree | 4d256b663778c15ca31f8f7f38d8801ae165546e /src/com/itmill/toolkit/ui/Table.java | |
parent | 627a866d0a32548d1722c89571fda89ba5633965 (diff) | |
download | vaadin-framework-050c07d1e8df84a13c8549ef1d5192abde269399.tar.gz vaadin-framework-050c07d1e8df84a13c8549ef1d5192abde269399.zip |
setEnabled(false) disables visible sub-components; Fixes #677 (together with [5513])
svn changeset:5514/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/ui/Table.java')
-rw-r--r-- | src/com/itmill/toolkit/ui/Table.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/ui/Table.java b/src/com/itmill/toolkit/ui/Table.java index adb78be2d2..24f0437f3d 100644 --- a/src/com/itmill/toolkit/ui/Table.java +++ b/src/com/itmill/toolkit/ui/Table.java @@ -3007,4 +3007,35 @@ public class Table extends AbstractSelect implements Action.Container, requestRepaint(); } } + + // Identical to AbstractCompoenentContainer.setEnabled(); + public void setEnabled(boolean enabled) { + super.setEnabled(enabled); + if (getParent() != null && !getParent().isEnabled()) { + // some ancestor still disabled, don't update children + return; + } else { + requestRepaintAll(); + } + } + + // Virtually identical to AbstractCompoenentContainer.setEnabled(); + public void requestRepaintAll() { + requestRepaint(); + for (Iterator childIterator = visibleComponents.iterator(); childIterator + .hasNext();) { + Component c = (Component) childIterator.next(); + if (c instanceof Form) { + // Form has children in layout, but is not ComponentContainer + c.requestRepaint(); + ((Form) c).getLayout().requestRepaintAll(); + } else if (c instanceof Table) { + ((Table) c).requestRepaintAll(); + } else if (c instanceof ComponentContainer) { + ((ComponentContainer) c).requestRepaintAll(); + } else { + c.requestRepaint(); + } + } + } } |