Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsNotifying views of editor save
https://www.eclipse.org/forums/index.php/mv/msg/98950/303013/#msg_303013
Originally posted by: apill.dolby.co.uk
Hi,
I would like to know how editors in eclipse notify the package explorer
of changes. for example, if I write a new method in a class the method
signature appears immediately in the package explorer.
I am developing a similar scenario where, when i save my form editor
content i want my tree view to be updated with the new information.
Is this done by?:
1. The editor being a registered ISelectionProvider and firing a
selection event when the save is complete.
2. The editor providing an implementation of getAdapter() that returns
an appropriate class containing required information of the editors input.
3. The tree view registering as a selection listener and upon a
selection event calling getAdapter() on the selection provider.
If this is the pattern used by eclipse for this scenario that is fine.
If not, please can someone explain how it works, or point me in the
right direction.
Thank you very much.
Adrian]]>2006-05-05T13:28:24-00:00Re: Notifying views of editor save
https://www.eclipse.org/forums/index.php/mv/msg/98950/303038/#msg_303038
> Hi,
>
> I would like to know how editors in eclipse notify the package explorer
> of changes. for example, if I write a new method in a class the method
> signature appears immediately in the package explorer.
>
Many plugins register IResourceChangeListeners ... when a file is saved,
they are notified about the resource delta.
The java case is a little different, since there's a java reconciler
running in the background. When you've added a method, I would imagine
when the reconciler runs it's incremental compile (and it's decided you
don't need the little red squigglies :-) that it fires an event that the
package explorer listens to.
I'm not sure though, I've never looked at this code.
Later,
PW]]>Paul Webster2006-05-06T14:48:35-00:00Re: Notifying views of editor save
https://www.eclipse.org/forums/index.php/mv/msg/98950/303057/#msg_303057
Originally posted by: apill.dolby.co.uk
Paul Webster wrote:
> Adrian wrote:
>
>> Hi,
>>
>> I would like to know how editors in eclipse notify the package
>> explorer of changes. for example, if I write a new method in a class
>> the method signature appears immediately in the package explorer.
>>
>
> Many plugins register IResourceChangeListeners ... when a file is saved,
> they are notified about the resource delta.
>
> The java case is a little different, since there's a java reconciler
> running in the background. When you've added a method, I would imagine
> when the reconciler runs it's incremental compile (and it's decided you
> don't need the little red squigglies :-) that it fires an event that the
> package explorer listens to.
>
> I'm not sure though, I've never looked at this code.
>
> Later,
> PW
Thanks.
I will look into your suggestion. The resources I am changing are
actually not files. We are developing an RCP app that talks to an EJB
layer, the resources being changed are the entity objects we are
updating to the Database via EJB3.
I have had a very quick glance at the IResourceChangeListeners and it
looks like it is more specific to the workspace. However, I need to read
up some more to be sure.