Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to make columns fill the table area.
How to make columns fill the table area. [message #432965] Wed, 22 June 2005 08:36 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Roland Tepp is currently offline Roland TeppFriend
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
Previous Topic:InputDialog Problem.!!!
Next Topic:Loading IAdaptable with DynamicProxy
Goto Forum:
  


Current Time: Fri Dec 06 17:16:58 GMT 2024

Powered by FUDForum. Page generated in 0.02862 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top