【问题标题】:Unable to type once the Content Assist shell is popped up弹出内容辅助外壳后无法键入
【发布时间】:2020-09-24 21:20:09
【问题描述】:

我已使用以下代码将内容辅助附加到文本框。内容辅助工作正常。 但是,一旦我按下“Ctrl+空格”,所有的提议都会显示在一个新创建的 shell 中。 然后,我尝试输入更多字符,但是我无法输入,因为新的 shell 具有焦点,而不是文本框。

有没有办法minic,JDT编辑器是怎么做的?即使按下 Ctrl+space 并显示内容建议,我们也可以在编辑器中输入内容,并根据新字符缩小建议范围。

private void attachContentAssist(final Text propertyText) {
   ContentProposalAdapter contentProposalAdapter = new ContentProposalAdapter(propertyText, new TextContentAdapter(),
        this.proposalProvider, KeyStroke.getInstance("Ctrl+Space"), null);
   contentProposalAdapter.setLabelProvider(new ContentProposalLabelProvider());
   contentProposalAdapter.setPropagateKeys(false);
   contentProposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
}

【问题讨论】:

    标签: eclipse eclipse-plugin


    【解决方案1】:

    行:

    contentProposalAdapter.setPropagateKeys(false);
    

    在弹出窗口打开时正在停止接收的键被转发到文本控件,这就是停止打字工作的原因。

    指定true 或删除该行,因为true 是默认值。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-17
      • 1970-01-01
      • 2013-07-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多