DirectMenuItem and their IDs in a handler class [message #1187900] |
Fri, 15 November 2013 05:38  |
Eclipse User |
|
|
|
Hello,
I want to implement one class, which will be used by several DirectMenuItem elements in "Class URI" property. Then I want to get source DirectMenuItem's ID in the class method
@Execute
public void execute()
and do different actions depending on the ID.
If look at dependency injection features, I want something like this:
@Execute
public void execute(MDirectMenuItem a_item)
where a_item will be injected as source menu item that triggered that method.
How can I do this?
Thanks.
|
|
|
|
Re: DirectMenuItem and their IDs in a handler class [message #1188126 is a reply to message #1188075] |
Fri, 15 November 2013 08:09   |
Eclipse User |
|
|
|
Hi Ozgur,
oh, I've been confused experimenting with Handlers and various menu item implementations and have not noticed the right solution for DirectMenuItem which I provide in first message as an assumption. Thanks for pointing it out and sorry me wasted your time, my assumption really works as I want.
BTW, consider the same situation. How can I figure out things that I am able to use through dependency injection in specific method of handler class? Is there some reference documentation or ability to figure it out at runtime (while debugging)?
For another example, consider model object "Handler" with Class URI linking to particular class. The class has following code:
@Execute
public void execute(MHandler a_hndlr) {
System.out.println(a_hndlr.getElementId());
}
And this doesn't work: when clicking on corresponding HandledMenuItem - nothing happens (no exceptions, no output at all). I think that MHandler injection is not available, so "execute" method is not executed. So the problem: how can I figure out what is available to me, and what is not?
PS. thank you again! DirectMenuItem snippet worked flawlessly.
[Updated on: Fri, 15 November 2013 08:13] by Moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04118 seconds