繁体   English   中英

Eclipse插件绑定CTRL + SPACE不起作用

[英]Eclipse plug-in binding CTRL+SPACE not working

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

内容辅助存在问题。

在我键入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方法(但我不知道在哪里)。

谢谢你的帮助。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM