Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Handler executes on rcp launch
Handler executes on rcp launch [message #924843] Thu, 27 September 2012 07:05 Go to next message
Christian Eugster is currently offline Christian Eugster
Messages: 134
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
Hi,

1. I am building a small rcp application based on pure e4 to learn the new paradigms. I have build an application with Application.e4xmi in one bundle and a fragment.e4xmi in another. The Application.e4xmi has a perspectivestack and the fragment.e4xmi hooks with a perspective into this stack. In the fragment I have a part with a pojo view und added to the part in the menus section some popupmenus. The menuitems are connected with pojo handlers. When I start the app before the main window shows up, every popup menu handler is executed. Do I missing something?

2. In my fragment.e4xmi under the part I do not find a toolbar section (a view toolbar). How do I add a toolbar to a part in *.e4.xmi?

Thank you

Christian
Re: Handler executes on rcp launch [message #924897 is a reply to message #924843] Thu, 27 September 2012 08:10 Go to previous messageGo to next message
Christian Eugster is currently offline Christian Eugster
Messages: 134
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
Ad 2: is resolved: Just check the checkbox "toolbar" in part section.
Re: Handler executes on rcp launch [message #924907 is a reply to message #924897] Thu, 27 September 2012 08:23 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph Keimel
Messages: 367
Registered: December 2010
Location: Germany
Senior Member
Hi Christian,

I have a setup that is very similar to yours without the problems you mentioned. When you debug your code (put a break-point in @Execute of a Handler) and go back until you find ContextInjectionFactory.invoke(contrib.getObject(), Execute.class, lclContext) where does this get called?

Greetings
Christoph
Re: Handler executes on rcp launch [message #924911 is a reply to message #924843] Thu, 27 September 2012 08:24 Go to previous messageGo to next message
Christian Eugster is currently offline Christian Eugster
Messages: 134
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
Ad 1: When I select an entry in the table of the view, any registered handler executes too. What am I doing wrong?
Re: Handler executes on rcp launch [message #924919 is a reply to message #924907] Thu, 27 September 2012 08:32 Go to previous messageGo to next message
Christian Eugster is currently offline Christian Eugster
Messages: 134
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
Hi Christoph,

There is no ContextInjectionFactory.invoke, there is a Method.invoke and aContextInjectionFactory.make. I attach a screenshot of the debug output.

Thank you!
Re: Handler executes on rcp launch [message #924928 is a reply to message #924919] Thu, 27 September 2012 08:36 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5403
Registered: July 2009
Senior Member
Can you show us your Handler? In handlers you don't use @Inject, I guess
your handler is written wrong and looks like this:

@Execute
@Inject
void handle() {
}

which is wrong and should look like this:

@Execute
void handle() {
}

Tom

Am 27.09.12 10:32, schrieb Christian Eugster:
> Hi Christoph,
>
> There is no ContextInjectionFactory.invoke, there is a Method.invoke and aContextInjectionFactory.make. I attach a screenshot of the debug output.
>
> Thank you!
>
Re: Handler executes on rcp launch [message #924935 is a reply to message #924928] Thu, 27 September 2012 08:45 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot Cela
Messages: 597
Registered: December 2010
Senior Member

The call comes from the processHierarchy call which doesn't run the @Execute. I plan to remove the processHierarchy once and for all in https://bugs.eclipse.org/bugs/show_bug.cgi?id=376254
Re: Handler executes on rcp launch [message #924936 is a reply to message #924928] Thu, 27 September 2012 08:48 Go to previous messageGo to next message
Christian Eugster is currently offline Christian Eugster
Messages: 134
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
You are right, Tom, that was the problem. I removed the @Inject annotation and everything works ok! Thank you!
Re: Handler executes on rcp launch [message #924964 is a reply to message #924935] Thu, 27 September 2012 09:10 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5403
Registered: July 2009
Senior Member
This would not have solved the problem because at a given point we need
to create an instance of the handler and then we would have called the
method annotated with @Inject ;-)

Tom

Am 27.09.12 10:45, schrieb Sopot Cela:
> The call comes from the processHierarchy call which doesn't run the
> @Execute. I plan to remove the processHierarchy once and for all in
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=376254
Re: Handler executes on rcp launch [message #924969 is a reply to message #924964] Thu, 27 September 2012 09:20 Go to previous message
Sopot Cela is currently offline Sopot Cela
Messages: 597
Registered: December 2010
Senior Member

I never said the bug solves the problem, I just referenced the bug so that in the future it won't be needed to be called as (as stated in the bug) people are using it already in their POJOs.

And IIRC the processHirerarchy itself (and so will my addon) called the @Inject as part of the call to the ICF.create so Kudos for spotting that Smile
Previous Topic:Removing Some menu items programatically
Next Topic:How to access to menu item?
Goto Forum:
  


Current Time: Wed Oct 22 03:14:42 GMT 2014

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

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