Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to write a custom notifier / listener
How to write a custom notifier / listener [message #264528] Thu, 29 July 2004 16:40 Go to next message
Eclipse UserFriend
Originally posted by: gary_.pureedge.com

Is there a way to write a custom notifier in Eclipse?

I want to be able to notify particular listeners when an event occurs
including those in other Plugins that I might write in the future.

I probably need to write both a notifier and a listener and the interface
for them but how would I implement this?

Thanks
Re: How to write a custom notifier / listener [message #264833 is a reply to message #264528] Fri, 30 July 2004 22:48 Go to previous message
Eclipse UserFriend
Originally posted by: chris.eclipsefaq.org

Gary wrote:

> Is there a way to write a custom notifier in Eclipse?

> I want to be able to notify particular listeners when an event occurs
> including those in other Plugins that I might write in the future.

> I probably need to write both a notifier and a listener and the interface
> for them but how would I implement this?

You just described the essence of Eclipse.

Declare an extension point with a Java interface as an element.
Name your listener interface something with "Listener" in it
and create executable extensions during creation of you plugin
(or when the platform changes if you are a dynamic plugin).

All this is described at http://eclipsefaq.org (see FAQ 85 and 86 in
Chapter 4 that describes the PDE).

For dynamic listeners, you have to set up a registration service.
In your notifier you keep an arraylist and you add listeners.
Don't forget to allow listeners to unregister.

If you want to get some inspiration: Ctrl-Shift-T + *Listener*

Chris
Previous Topic:VariableDeclaratorId expected..?
Next Topic:How to open internal browser?
Goto Forum:
  


Current Time: Fri Jun 06 01:35:52 EDT 2025

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

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

Back to the top