Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » No events received in 4.2.2
No events received in 4.2.2 [message #1017022] Fri, 08 March 2013 16:48 Go to next message
Norman Wenzel is currently offline Norman WenzelFriend
Messages: 3
Registered: March 2013
Junior Member
Hi,
since the update from 4.2.1 to 4.2.2 the Event Broker does not work anymore.

So when I send an event, it is not received with code like:

@Inject
@Optional
void myTopicHandler(final @UIEventTopic(EventTopic.MY_TOPIC) Project project) {
	//handle event
}


Is this a bug or does the implementation changed in any (undocumented...) way? This is an absolut showstopper for our project.

Thanks
Norman
Re: No events received in 4.2.2 [message #1017189 is a reply to message #1017022] Sun, 10 March 2013 21:10 Go to previous messageGo to next message
Eclipse UserFriend
Norman, please file a bug with a small example that reproduces the problem and we'll give it a look. Thanks!

Brian.
Re: No events received in 4.2.2 [message #1017290 is a reply to message #1017189] Mon, 11 March 2013 13:46 Go to previous messageGo to next message
Norman Wenzel is currently offline Norman WenzelFriend
Messages: 3
Registered: March 2013
Junior Member
Hi Brian, thanks for your reply.

The problem is: I can't create a simple example!

I've tried to create a dummy project (the E4 example project created by the wizard), added the EventBroker code in the AboutHandler (just to keep it simple, of course this makes no sense Wink ) - and everything works fine!
Then I moved exactly this code into the AboutHandler of our E4 application - and it DID NOT WORK!

So this seems to be no general problem, it has to be a configuration issue. Is there something in 4.2.2 that is (additionally) required to enable the event service?

I debugged the code and found out that everything is okay until UIEventObjectSupplier is reached. Here the injected UISynchronize object is null and so the requestor is not executed. Do you have any idea what could cause this behavior?

[Updated on: Mon, 11 March 2013 13:47]

Report message to a moderator

Re: No events received in 4.2.2 [message #1017299 is a reply to message #1017290] Mon, 11 March 2013 14:32 Go to previous messageGo to next message
Eclipse UserFriend
The UISynchronizsr is set by E4Application on the application/workbench context. How have you obtained the context that you're injecting your dialog with? You can't just use a context created by EclipseContextFactory. Trace the context hierarchy upwards and trace its parent pointer to figure out where it's rooted from.

Brian.
Re: No events received in 4.2.2 [message #1017319 is a reply to message #1017299] Mon, 11 March 2013 15:13 Go to previous message
Norman Wenzel is currently offline Norman WenzelFriend
Messages: 3
Registered: March 2013
Junior Member
I do not inject a dialog. For the sample code I do it just as simple as possible:

public class AboutHandler {
	
  public static final String TOPIC = "about";

  @Execute
  public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell,     
       IEventBroker eventBroker) {
    MessageDialog dialog = new MessageDialog(shell, "title", null,
      "Message", MessageDialog.INFORMATION, new String[] { "OK" }, 0);
    eventBroker.post(TOPIC, dialog);
  }

  @Inject
  @Optional
  void projectParsedHandler(final @UIEventTopic(TOPIC) MessageDialog dialog) {
    dialog.open();
  }
}


The member variable uiSync of the event broker is initialized (from the E4Application, just as you said). But in UIEventObjectSupplier (called by the EventManager) it is not.
Previous Topic:RCP -> Plugin -> Plugin fails
Next Topic:Injection and SWT
Goto Forum:
  


Current Time: Tue Apr 23 08:38:36 GMT 2024

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

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

Back to the top