How to make columns fill the table area. [message #432965] |
Wed, 22 June 2005 08:36 |
Eclipse User |
|
|
|
Originally posted by: lanfro.hotmail.com
Hi!
Is there a way to make the columns with default width (given in
ColumnWeight) in a table fill the entire table area, so that a empty
blank column will not appear to the right?
The reason for asking this question is implementing a column customizer
dialog in our application. Then the user will be able to exclude columns
from the table. After the selection of columns has been done, the table
creates the selected columns. The problem is when only a few columns are
selected, a lagre, blank field appears to the right in the table.
I have tried column.pack() on every column, but the result is very
unpredictable, some columns are very large and others too small.
Regards
Frode Langeland
|
|
|
Re: How to make columns fill the table area. [message #437544 is a reply to message #432965] |
Thu, 29 September 2005 20:50 |
Eclipse User |
|
|
|
Originally posted by: jesimard.hotmail.com
Hi Frode,
I try to do exactly the same thing (a column customizer), have you find a way to get rid of the lagre, blank field that appears to the right in the table?
If so, could you please post your solution, i would greatly appreciate (as other readers of your post).
Best regards,
Jerome Simard
|
|
|
Re: How to make columns fill the table area. [message #437711 is a reply to message #432965] |
Mon, 03 October 2005 14:07 |
Roland Tepp Messages: 336 Registered: July 2009 |
Senior Member |
|
|
Hi,
column.pack tries to size the columns so that the content of those
columns fould be entirely visible.
What You are probably interested in is ColumnLayout for the Table widget.
The basic snippet is:
Table table = new Table(parent, SWT.NONE);
ColumnLayout layout = new ColumnLayout();
new TableColumn(table, SWT.LEFT);
layout.addColumnData(new ColumnWeightData(1, width));
new TableColumn(table, SWT.LEFT);
layout.addColumnData(new ColumnWeightData(1, width));
table.setLayout(layout);
The downside here is that the default implementation of the TableLayout
lais out columns only once, so You'll have to either override the
implementation or do some other magic to apply this layout algorithm to
table columns.
Frode Langeland kirjutas mulle ühel talvisel päeval midagi seesugust:
> Hi!
>
> Is there a way to make the columns with default width (given in
> ColumnWeight) in a table fill the entire table area, so that a empty
> blank column will not appear to the right?
>
> The reason for asking this question is implementing a column customizer
> dialog in our application. Then the user will be able to exclude columns
> from the table. After the selection of columns has been done, the table
> creates the selected columns. The problem is when only a few columns are
> selected, a lagre, blank field appears to the right in the table.
>
> I have tried column.pack() on every column, but the result is very
> unpredictable, some columns are very large and others too small.
>
> Regards
>
> Frode Langeland
--
Roland Tepp
|
|
|
Powered by
FUDForum. Page generated in 0.02862 seconds