簡體   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