Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » how to replace a TableViewer in a wizard page
how to replace a TableViewer in a wizard page [message #500594] Thu, 26 November 2009 22:26 Go to next message
Eclipse User
Originally posted by: yoduderoo.netscape.net

Hi,
I have a wizard page containing a table viewer which displays tabular
data depending on how the user entered a given field. The user can
clear the field, enter something else and a new table is displayed. The
headings and number of columns is different depending on that input.

I am having a hard time figuring out how to do this. I create a
composite to contain the TableViewer. Should I dispose that and somehow
clear it before redrawing? Do I recreate a new tableviewer each time and
then call the composite's layout() method?

I keep trying various approaches but am getting nowhere.

thanks, y
Re: how to replace a TableViewer in a wizard page [message #500611 is a reply to message #500594] Fri, 27 November 2009 06:52 Go to previous message
Daniel Krügler is currently offline Daniel Krügler
Messages: 853
Registered: July 2009
Senior Member
Yodude wrote:
> Hi,
> I have a wizard page containing a table viewer which displays tabular
> data depending on how the user entered a given field. The user can
> clear the field, enter something else and a new table is displayed. The
> headings and number of columns is different depending on that input.
>
> I am having a hard time figuring out how to do this. I create a
> composite to contain the TableViewer. Should I dispose that and somehow
> clear it before redrawing? Do I recreate a new tableviewer each time and
> then call the composite's layout() method?

[This question does not belong into this group, because jface is
no part of SWT]

Usually it is not necessary to dispose the table widget. Instead one of
the more extreme solutions is to dispose all table columns and to
recreate them. You probably need to perform a new call of layout()
after that. I also suggest to wrap the complete "reconfiguration"
inside a block of

table.setRedraw(false);
try {
... // restructure table viewer
} finally {
table.setRedraw(true);
}

to reduce visual flickering during that process.

I would only suggest to dispose the complete page control, if the
complete *page content* would undergo drastic structural changes.

HTH & Greetings from Bremen,

Daniel Krügler
Previous Topic:HP-UX problem : unsatisfied link error
Next Topic:Multi-column tree with tree not in 1st column?
Goto Forum:
  


Current Time: Tue Oct 21 00:37:05 GMT 2014

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

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