我创建了一个包含两页的多页编辑器(MultiPageEditorPart
):
org.eclipse.ui.editors.text.TextEditor
的类。问题是在第2页的拆分视图的左侧添加了文本编辑器,我试图将其添加到Composite
中,如下所示:
Composite leftSide = new Composite(parent, SWT.NONE);
leftSide.setLayout(new FillLayout(SWT.HORIZONTAL));
MyTextEditor sourceView = new MyTextEditor (leftSide); // This class extends TextEditor
,然后将2页添加到多页编辑器中:
int index = addPage(sourceView); // This page contains only the Text Editor
setPageText(index, "Source View");
int index = addPage(splitView); // This page needs to contain the Text Editor and other composite
setPageText(index, "Split View");
第一页(源代码视图)可以很好地加载文本编辑器,语法高亮显示和所有其他功能都可以正常工作,但是拆分视图的左侧(应该加载相同的文本编辑器)看起来像空白,是否可以将文本编辑器嵌入到复合物中?还是有其他方法可以实现?