diff options
author | Artur Signell <artur.signell@itmill.com> | 2008-12-11 13:16:47 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2008-12-11 13:16:47 +0000 |
commit | 730a1ae7dff83b12928db09fe7097166a1d58ea5 (patch) | |
tree | 16418ce5bf42a97f5fe565f81334a61d5f7c8ae7 /src/com/itmill/toolkit/ui/AbstractComponent.java | |
parent | f1b14bd8f9c4d81871f85e794bc39319ad69f902 (diff) | |
download | vaadin-framework-730a1ae7dff83b12928db09fe7097166a1d58ea5.tar.gz vaadin-framework-730a1ae7dff83b12928db09fe7097166a1d58ea5.zip |
Fixed layout validation so only the invalid dimension is set to undefined
svn changeset:6173/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/ui/AbstractComponent.java')
-rw-r--r-- | src/com/itmill/toolkit/ui/AbstractComponent.java | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/com/itmill/toolkit/ui/AbstractComponent.java b/src/com/itmill/toolkit/ui/AbstractComponent.java index 48717c4bc2..5a692736e7 100644 --- a/src/com/itmill/toolkit/ui/AbstractComponent.java +++ b/src/com/itmill/toolkit/ui/AbstractComponent.java @@ -609,20 +609,23 @@ public abstract class AbstractComponent implements Component, MethodEventSource // Only paint content of visible components. if (isVisible()) { + boolean validHeight = true; + boolean validWidth = true; - // TODO split this method - if (getApplication() != null - && getApplication().isDebugMode() - && !DebugUtilities.validateComponentRelativeSizes(this, - false)) { + if (getApplication() != null && getApplication().isDebugMode()) { + validHeight = DebugUtilities.checkHeights(this); + validWidth = DebugUtilities.checkWidths(this); + } + if (!validHeight || !validWidth) { addStyleName("invalidlayout"); - } else { - if (getHeight() >= 0) { - target.addAttribute("height", "" + getCSSHeight()); - } - if (getWidth() >= 0) { - target.addAttribute("width", "" + getCSSWidth()); - } + } + + if (validHeight && getHeight() >= 0) { + target.addAttribute("height", "" + getCSSHeight()); + } + + if (validWidth && getWidth() >= 0) { + target.addAttribute("width", "" + getCSSWidth()); } if (styles != null && styles.size() > 0) { target.addAttribute("style", getStyle()); |