Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Best practices for notifications
Best practices for notifications [message #327633] Sun, 27 April 2008 18:27 Go to next message
Fabio M is currently offline Fabio MFriend
Messages: 25
Registered: July 2009
Junior Member
Dear all,

I was wondering what is the best way to implement this use case, and if
the Eclipse platform already provides an implementation. The use case is
simple: I would like to have some kind of notifications that trigger
platform UI elements refreshing.

For example, imagine a view that contains a list of defined
"connections" to a server. These connection can be in an online/offline
state, each one corresponding to a different rendering: online
connections have bold text, offline connections are grayed for example.

Now when the connection state changes, I would like all the UI elements
that show "connections" to refresh the connection that changed its state
in order to be in synch with the graphical representation.

I did this by implementing a "notification center" for my application,
with (custom) listeners and events. I subscribe the UI elements as
listeners to this center and I handle notifications, for example by
refreshing the item corresponding to the connection when a state change
event is received.

Of course this works, but I was wondering if Eclipse already provides an
infrastructure for handling custom events and notifications. Something
like selection changes but for things that are not selections :) I have
the impression of having re-invented the wheel and maybe I just didn't
notice what is already available at the platform level.

Thanks,
Fabio
Re: Best practices for notifications [message #327658 is a reply to message #327633] Mon, 28 April 2008 11:54 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Fabio,

Probably the closest corresponding thing in the platform is the data
binding frameworks in JFace. Certainly label providers support the
receiving end of the notifications though not the producing end, which
is done by your model itself. EMF-based models produce notifications
when they change, so it provides all the things you've described.


Fabio Mancinelli wrote:
> Dear all,
>
> I was wondering what is the best way to implement this use case, and
> if the Eclipse platform already provides an implementation. The use
> case is simple: I would like to have some kind of notifications that
> trigger platform UI elements refreshing.
>
> For example, imagine a view that contains a list of defined
> "connections" to a server. These connection can be in an
> online/offline state, each one corresponding to a different rendering:
> online connections have bold text, offline connections are grayed for
> example.
>
> Now when the connection state changes, I would like all the UI
> elements that show "connections" to refresh the connection that
> changed its state in order to be in synch with the graphical
> representation.
>
> I did this by implementing a "notification center" for my application,
> with (custom) listeners and events. I subscribe the UI elements as
> listeners to this center and I handle notifications, for example by
> refreshing the item corresponding to the connection when a state
> change event is received.
>
> Of course this works, but I was wondering if Eclipse already provides
> an infrastructure for handling custom events and notifications.
> Something like selection changes but for things that are not
> selections :) I have the impression of having re-invented the wheel
> and maybe I just didn't notice what is already available at the
> platform level.
>
> Thanks,
> Fabio
Previous Topic:EFS question ...
Next Topic:Eclipse 3.4M6'a'?
Goto Forum:
  


Current Time: Thu Aug 15 04:21:08 GMT 2024

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

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

Back to the top