Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to remove TableColumns from Table
How to remove TableColumns from Table [message #462330] Mon, 10 October 2005 16:40 Go to next message
Alan is currently offline AlanFriend
Messages: 44
Registered: July 2009
Member
I want to display results from a SQL select query using the Table widget.
Everytime a SQL select query is executed, the application figures out the
columns and configure the Table object. What I do is before configuring
the table, the application removes all TableColumns, if any, from the
existing Table object

for(;tableViewer.getTable().getColumns().length>0;)
tableViewer.getTable().getColumns()[0].dispose();

I'm not sure if this is the right way to remove columns, though. Then the
application create new TableColumn based on the results.

for(.../** details ignored */){
new TableColumn(tableViewer.getTable(), SWT.CENTER);
column.setText(label);
}

Finally, the application populates the Table.

Everything goes smoothly for the first query. From the second query on,
the table display nothting after all columns are removed. Data will appear
in the Table correctly after I resize the view, for example.

Any hint appreciated.
Re: How to remove TableColumns from Table [message #462348 is a reply to message #462330] Tue, 11 October 2005 07:48 Go to previous message
Yves Harms is currently offline Yves HarmsFriend
Messages: 80
Registered: July 2009
Member
Try this:

> for(.../** details ignored */){ new
> TableColumn(tableViewer.getTable(), SWT.CENTER);
> column.setText(label);
column.pack();

> }

Yves
Previous Topic:Eclipse RCP Developer Wanted
Next Topic:How to make a TableViewer virtual
Goto Forum:
  


Current Time: Thu Apr 25 03:34:02 GMT 2024

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

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

Back to the top