Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » eventBroker to a particular perspective
eventBroker to a particular perspective [message #1103013] Fri, 06 September 2013 09:44 Go to next message
romain ognier is currently offline romain ognier
Messages: 18
Registered: September 2013
Junior Member
Hi everyone,

I am doing an RCP application with 2 identical perspectives with 2 views.
I want to send an event from one view to the other.

First view :
eventBroker.send("message", model);


Second view :
@Inject @Optional
void eventReceived(@UIEventTopic("message/*") Model model) {
//CODE
}


My problem is that both perspectives receive the event.
How can i specify to send it to the activate perspective only ?

(both perspectives point to the exact same code)

Thanks for your help !
Romain.
Re: eventBroker to a particular perspective [message #1103244 is a reply to message #1103013] Fri, 06 September 2013 14:28 Go to previous messageGo to next message
Eric Moffatt is currently offline Eric Moffatt
Messages: 118
Registered: July 2009
Senior Member
All events are global in the sense that they're sent to every listener for the topic. Generally what you'd do is to encode the MPart you want to have react to the message in the 'payload' (we use a Map for the UIModel events so looking at UIEventPublisher might give some hints).

Alternatively you could just define different topics for each view (i.e. "messageFromA" and "messageFromB") to derermine who gets what event.
Re: eventBroker to a particular perspective [message #1105996 is a reply to message #1103013] Tue, 10 September 2013 14:41 Go to previous message
romain ognier is currently offline romain ognier
Messages: 18
Registered: September 2013
Junior Member
Thank you !
It helped a lot.
Previous Topic:add element to e4XMI
Next Topic:change handled tool item label
Goto Forum:
  


Current Time: Fri Sep 19 02:06:03 GMT 2014

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

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