您应该能够通过TextCellEditor(Composite parent, int style)
在自己的扩展中扩展构造函数来实现它TextCellEditor
。
createCellEditorOn(Composite composite)
然后,在你的扩展类中调用时DirectEditManager
,让它返回new YOURTextCellEditor(composite, SWT.SINGLE)
。
详细地说:
你自己TextCellEditor
的构造函数实现
public YOURTextCellEditor(Composite parent, int style) {
super(parent, style);
}
createCellEditorOn(Composite composite)
在 DirectEditManager 的实现中
@Override
protected CellEditor createCellEditorOn(Composite composite) {
return new YOURTextCellEditor(composite, SWT.SINGLE);
}
YOURTextCellEditor
也许检查您是否返回withSWT.MULTI
或类似的新实例SWT.MULTI|SWT.WRAP
,这使您的文本单元格编辑器的 SWT 控件成为多行文本小部件(参见SWT 小部件概述)。