Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:49 Go to next message
Peter Maas is currently offline Peter MaasFriend
Messages: 47
Registered: July 2009
Member
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 07:47 Go to previous messageGo to next message
Sebastian Fuchs is currently offline Sebastian FuchsFriend
Messages: 97
Registered: July 2009
Member
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 09:12 Go to previous messageGo to next message
Peter Maas is currently offline Peter MaasFriend
Messages: 47
Registered: July 2009
Member
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 09:47 Go to previous messageGo to next message
Sebastian Fuchs is currently offline Sebastian FuchsFriend
Messages: 97
Registered: July 2009
Member
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 17:20 Go to previous message
Peter Maas is currently offline Peter MaasFriend
Messages: 47
Registered: July 2009
Member
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: Fri Sep 13 01:44:41 GMT 2024

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

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

Back to the top