Skip to main content



      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 12:40 Go to next message
Eclipse UserFriend
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 03:48 Go to previous message
Eclipse UserFriend
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: Sun Jul 27 12:57:52 EDT 2025

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

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

Back to the top