我目前正在寻找 Nattable TextCellEditor 中的内容辅助功能。我找到了通过扩展 Nattable TextCellEditor 来附加 ContentProposalAdapter 和 IContentProposalProvider 的方法。但是,从建议列表中选择的值不会在文本控件中更新。
片段:
@Override
protected Text createEditorControl(final Composite parent, final int Style) {
this.textControl = super.createEditorControl(parent, style);
contentProposalAdapter =
new ContentProposalAdapter(this.textControl, new TextContentAdapter(), contentProposalProvider, keyStroke,
null);
contentProposalAdapter.addContentProposalListener(new IContentProposalListener() {
@Override
public void proposalAccepted(IContentProposal proposal) {
System.out.println(proposal.getContent());
}
});
}