开发者

In eclipse, How to combine handler events and action of the actionSet

I am developing a plugin which contains popup menu (using the org.eclipse.ui.handlers extension) main menu item (using the org.eclipse.ui.actionSet extension). Therefore I had to implement both the execution method (Object execute(ExecutionEvent event)) and run method (void run(IAction action)). How do I combine those methods and implement only one execute method. My plugin xml is

开发者_开发问答


Here's one way:

public Object execute(ExecutionEvent event) {
    String parameter = event.getParameter("parameter-key");
    combine(parameter);
    return null;
}

public void run(IAction action) {
    combine("");
}

protected void combine(String parameter) {

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜