blob: 4541ac1bf661c0edde45fa0e82afd0c0b98d1e72 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html lang="en">
<HEAD>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<TITLE>
TableWrapLayout
</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>
TableWrapLayout</H1>
<p align="left">TableWrapLayout is a grid-based layout very similar to SWT's versatile
GridLayout. It differs from GridLayout in that it uses a layout algorithm that
works more like HTML tables. It tries to respect the provided client area width
and grows vertically to compensate. </p>
<p align="left">There are many similarities between GridLayout and
TableWrapLayout. Both organize children in grids. Both have layout data that
instructs the layout how to treat each control. Both can accept hints on which
control should grab excess space, etc.</p>
<p align="left">However, they fundamentally differ in the approach to the
layout. <code>TableWrapLayout</code> starts with columns. It computes minimal,
preferred and maximum widths of each column and uses this information to assign
excess space. It also tries to be fair when dividing space across columns so
that there is no excess wrapping of some controls.</p>
<p align="left">It is possible to mix <code>GridLayout</code> and <code>
TableWrapLayout</code> but the branch where <code>GridLayout</code> is used is
the one where wrapping stops. This is quite acceptable if you don't want it to
wrap (if the composite contains controls that cannot wrap anyway, like text,
buttons, trees etc.). However, you should have an unbroken path of TableWrapLayouts
from the form body to each text control that needs to wrap.</p>
</BODY>
</HTML>