Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Listen to data changes with CommonNavigator
Listen to data changes with CommonNavigator [message #462866] Thu, 01 February 2007 10:49 Go to next message
Eclipse UserFriend
How can I let a CommonNavigator listen to data changes without extending it?
Currently I extend CommonNavigator and implement a listener interface. Are
there other ways? Thanks for your help.

--
Gruesse/Regards,

Peter Maas, Aachen
E-mail "cC5tYWFzQG1hZ21hc29mdC5kZQ==\n".decode("base64")
Re: Listen to data changes with CommonNavigator [message #462890 is a reply to message #462866] Fri, 02 February 2007 02:47 Go to previous messageGo to next message
Eclipse UserFriend
listen for data changes in your content provider

Peter Maas schrieb:
> How can I let a CommonNavigator listen to data changes without extending
> it?
> Currently I extend CommonNavigator and implement a listener interface. Are
> there other ways? Thanks for your help.
>
Re: Listen to data changes with CommonNavigator [message #462912 is a reply to message #462890] Fri, 02 February 2007 04:12 Go to previous messageGo to next message
Eclipse UserFriend
Sebastian Fuchs schrieb:
> listen for data changes in your content provider

Sebastian,

thanks for your advice but I think this doesn't work because
the content provider cannot inform the viewer about changes.
The viewer calls ContentProvider#inputChanged() so the viewer
has to be informed that a new tree model is available.

--
Gruesse/Regards,

Peter Maas, Aachen
E-mail "cC5tYWFzQG1hZ21hc29mdC5kZQ==\n".decode("base64")
Re: Listen to data changes with CommonNavigator [message #462914 is a reply to message #462912] Fri, 02 February 2007 04:47 Go to previous messageGo to next message
Eclipse UserFriend
Peter Maas schrieb:

> thanks for your advice but I think this doesn't work because
> the content provider cannot inform the viewer about changes.
> The viewer calls ContentProvider#inputChanged() so the viewer
> has to be informed that a new tree model is available.

yes it can.

in your ContentProvider:

public void inputChanged(Viewer viewer, Object oldInput, Object newInput)

you get your viewer delivered. you could cast it to StructuredViewer and
store it.

call
viewer.refresh() on structural changes or
viewer.update() on label changes

sebastian
Re: Listen to data changes with CommonNavigator [message #463092 is a reply to message #462914] Tue, 06 February 2007 12:20 Go to previous message
Eclipse UserFriend
Sebastian Fuchs schrieb:
> you get your viewer delivered. you could cast it to StructuredViewer and
> store it.
>
> call
> viewer.refresh() on structural changes or
> viewer.update() on label changes

Thanks, Sebastian, I think you are right. In my case, however, the model
changes completely (e.g. from null to a non-null model) so that I have to
call viewer.setInput() in the listener method of the contentprovider.

--
Gruesse/Regards,

Peter Maas, Aachen
E-mail "cC5tYWFzQG1hZ21hc29mdC5kZQ==\n".decode("base64")
Previous Topic:Row numbering in TableViewer
Next Topic:Cannot export RCP application
Goto Forum:
  


Current Time: Tue Jul 01 14:09:18 EDT 2025

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

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

Back to the top