diff options
Diffstat (limited to 'server/src/com/vaadin/ui/Table.java')
-rw-r--r-- | server/src/com/vaadin/ui/Table.java | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java index 69874d9947..3edfe7845f 100644 --- a/server/src/com/vaadin/ui/Table.java +++ b/server/src/com/vaadin/ui/Table.java @@ -100,7 +100,7 @@ import com.vaadin.util.ReflectTools; @SuppressWarnings({ "deprecation" }) public class Table extends AbstractSelect implements Action.Container, Container.Ordered, Container.Sortable, ItemClickNotifier, DragSource, - DropTarget, HasComponents { + DropTarget, HasComponents, HasChildMeasurementHint { private transient Logger logger = null; @@ -357,6 +357,11 @@ public class Table extends AbstractSelect implements Action.Container, private static final Object ROW_HEADER_FAKE_PROPERTY_ID = new UniqueSerializable() { }; + /** + * How layout manager should behave when measuring Table's child components + */ + private ChildMeasurementHint childMeasurementHint = ChildMeasurementHint.MEASURE_ALWAYS; + /* Private table extensions to Select */ /** @@ -3542,6 +3547,7 @@ public class Table extends AbstractSelect implements Action.Container, paintTabIndex(target); paintDragMode(target); paintSelectMode(target); + paintTableChildLayoutMeasureMode(target); if (cacheRate != CACHE_RATE_DEFAULT) { target.addAttribute("cr", cacheRate); @@ -3882,6 +3888,11 @@ public class Table extends AbstractSelect implements Action.Container, } } + private void paintTableChildLayoutMeasureMode(PaintTarget target) + throws PaintException { + target.addAttribute("measurehint", getChildMeasurementHint().ordinal()); + } + /** * Checks whether row headers are visible. * @@ -6467,4 +6478,18 @@ public class Table extends AbstractSelect implements Action.Container, } return logger; } + + @Override + public void setChildMeasurementHint(ChildMeasurementHint hint) { + if (hint == null) { + childMeasurementHint = ChildMeasurementHint.MEASURE_ALWAYS; + } else { + childMeasurementHint = hint; + } + } + + @Override + public ChildMeasurementHint getChildMeasurementHint() { + return childMeasurementHint; + } } |