Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Notifying views of editor save
Notifying views of editor save [message #303013] Fri, 05 May 2006 13:28 Go to next message
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 #303038 is a reply to message #303013] Sat, 06 May 2006 14:48 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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


Re: Notifying views of editor save [message #303057 is a reply to message #303038] Mon, 08 May 2006 08:14 Go to previous message
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.
Previous Topic:Adding files to the classpath
Next Topic:Internal Web Browser Failed to load applet
Goto Forum:
  


Current Time: Sun Sep 21 22:23:46 GMT 2014

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

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