【问题标题】:In eclipse, How to combine handler events and action of the actionSet在eclipse中,如何结合actionSet的handler事件和action
【发布时间】:2010-11-24 21:43:54
【问题描述】:

我正在开发一个包含弹出菜单(使用 org.eclipse.ui.handlers 扩展名)主菜单项(使用 org.eclipse.ui.actionSet 扩展名)的插件。 因此我必须同时实现执行方法(Object execute(ExecutionEvent event))和运行方法(void run(IAction action))。 如何组合这些方法并仅实现一种执行方法。 我的插件 xml 是


【问题讨论】:

    标签: eclipse eclipse-plugin


    【解决方案1】:

    这是一种方法:

    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) {
    
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-04-04
      • 1970-01-01
      • 2013-04-14
      • 2021-07-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-26
      相关资源
      最近更新 更多