Notifying views of editor save [message #303013] |
Fri, 05 May 2006 13:28 |
Eclipse User |
|
|
|
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
|
|
|
|
Re: Notifying views of editor save [message #303057 is a reply to message #303038] |
Mon, 08 May 2006 08:14 |
Eclipse User |
|
|
|
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.
Thanks.
Adrian.
|
|
|
Powered by
FUDForum. Page generated in 0.03200 seconds