I have a menu which has a label bound to a command.
Lets say:
plugin.xml
<menu label="Settings">
<command
commandId="prototype.standalone.MainDirectory"
label="Main">
</command>
</menu>
public class MainDirectory extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
// How can I call from here all my business methods from my main View.
// Do I have to use DI? If yes, can you give me an easy example related to this snippet?
return null;
}
}
As asked in the comment. How can I call my methods? Because if I never instantiate an MainDirectory
so I also can not just pass Objects from my createControls
- I think that I have to use Dependency Injection but I don't know how. Can someone give me an example or an other solution
Edit: Or is it maybe possible to add a Listener to the menu Item? Would make all much easier. Didn't found anything