【问题标题】:Eclipse plug-in binding CTRL+SPACE not workingEclipse 插件绑定 CTRL+SPACE 不起作用
【发布时间】:2010-06-08 12:20:37
【问题描述】:

我必须将 Eclipse 插件(编辑器)从 Eclipse 3.4.0 更新到 3.5.1 (Galileo)。

内容辅助有问题。

在我输入 CTRL+SPACE 的地方,什么也没有发生。但是当我将 CTRL+SPACE 的绑定更改为 Eclipse 中的另一个绑定(Preferences->Keys)时,它可以工作(CTRL+SPACE 适用于我的编辑器)。

这里是监听器:

public class CompletionVerifyKeyListener implements VerifyKeyListener{

    private ISourceViewer sourceViewer = null ;
    private ITextListener textListener = null ;
    private QuickAssistAssistant qaa = null ;


    public CompletionVerifyKeyListener(ISourceViewer sourceViewer, ITextListener textListener, QuickAssistAssistant qaa) {
        this.sourceViewer = sourceViewer ;
        this.textListener = textListener ;
        this.qaa = qaa ;
    }

    @Override
    public void verifyKey(VerifyEvent arg0) {

        System.out.println("Code: " + arg0.keyCode);
        System.out.println("StateMask: " + arg0.stateMask);

        if (arg0.keyCode == 32 && (arg0.stateMask != 0)){
            this.sourceViewer.addTextListener(this.textListener) ;
            AutoCompletion ac = new AutoCompletion(this.sourceViewer, this.qaa) ;
            ac.showIfAvailable() ;
        }
    }

}

在 Eclipse 中绑定 CTRL+SPACE 时,StateMask 保持为 0,但当我更改它时,StateMask 为 262144 (SWT.CTRL)。

我读过这个:http://wiki.eclipse.org/FAQ_How_do_I_add_Content_Assist_to_my_editor%3F,但我并不完全理解。也许我必须添加 createActions 方法(但我不知道在哪里)。

感谢您的帮助。

【问题讨论】:

    标签: java editor eclipse-plugin


    【解决方案1】:

    可能 Ctrl+Space 与另一个命令冲突。您是否在错误日志视图中看到有关冲突的任何内容?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-12-29
      • 2013-06-25
      • 2018-09-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多