Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to Refresh a GUI (FormPage)?
How to Refresh a GUI (FormPage)? [message #540543] Wed, 16 June 2010 13:26 Go to next message
Ahuga Ahuga is currently offline Ahuga AhugaFriend
Messages: 14
Registered: June 2010
Junior Member
For the Tabs I use different FormPage's.

On Tab A I have a Table with a TableViewer on Tab B I have some Text Fields.
When the user makes on Tab A a change in the table and want to see the result on the Tab B, how can I get the Tab B to actulize/refresh itself?

I also use a IStructuredContentProvider and a ITableLabelProvider. To set the user changes in the table a use a EditingSupport.

Thanks for your advices.

Martin
Re: How to Refresh a GUI (FormPage)? [message #540736 is a reply to message #540543] Thu, 17 June 2010 08:33 Go to previous messageGo to next message
T. Wilhelm is currently offline T. WilhelmFriend
Messages: 129
Registered: July 2009
Senior Member
Hi Martin,

i think there are a lot of possibilities. I would recommend to use eclipse Databinding. You can easily bind your model to your Tableviewer, and react on changes on the model. For example you can use ComputedValue to calculate a new value in Tab B which depends on values in Tab A.

Here you can find some information about databinding:

http://www.compeople.de/files/ecm_3.09_barth_schenkel_databi nding.pdf
Re: How to Refresh a GUI (FormPage)? [message #540830 is a reply to message #540543] Thu, 17 June 2010 13:03 Go to previous messageGo to next message
Sandeep  is currently offline Sandeep Friend
Messages: 14
Registered: June 2010
Junior Member
The way i do this is something like this :

Create getters (public Text getText()) for your Text Fields and in your Editor file, override the PageChange(int newPageIndex) function
to refresh the Text Fields.

In this way, whenever you will press tab B , you will see their refreshed values.

Cheers,
Sandeep.
Re: How to Refresh a GUI (FormPage)? [message #540899 is a reply to message #540830] Thu, 17 June 2010 15:05 Go to previous messageGo to next message
Ahuga Ahuga is currently offline Ahuga AhugaFriend
Messages: 14
Registered: June 2010
Junior Member
Thanks a lot for your informations.

Sandeep, could you send me example code (how you override the PageChange function)?
Re: How to Refresh a GUI (FormPage)? [message #541029 is a reply to message #540543] Fri, 18 June 2010 07:04 Go to previous message
Sandeep  is currently offline Sandeep Friend
Messages: 14
Registered: June 2010
Junior Member
Here it goes :

protected void pageChange (int newPageIndex) {
super.pageChange(newPageIndex);

switch(newPageIndex){
case 0: ExamplePage page = (ExamplePage) this.getActivePageInstance();
page.getViewer().refresh();
break;
.
.
.
.
}
}
Previous Topic:Two Masters in MasterDetails Page
Next Topic:How to properly "customize" a commonNavigator !!
Goto Forum:
  


Current Time: Fri Apr 26 21:35:13 GMT 2024

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

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

Back to the top