0
A
回答
0
你应该能够做到这一点类似于MultiPageEditorPart
- 它有几个addPage
功能。按原样使用这个编辑器,或者用它来获取灵感。
0
太晚了,但有些人可能从这个代码中受益:
/** The text editor used in the new page. */
private TextEditor editor;
private StyledText text;
/**
* Creates a multi-page editor example.
*/
public MultiPageEditor() {
super();
ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
}
void createDynamicPage() {
try {
editor = new TextEditor();
int index = addPage(editor, getEditorInput());
setPageText(index, "new page"+index);
} catch (PartInitException e) {
ErrorDialog.openError(
getSite().getShell(),
"Error creating nested editor",
null,
e.getStatus());
}
}
void createMainPage() {
Composite composite = new Composite(getContainer(), SWT.NONE);
GridLayout layout = new GridLayout();
composite.setLayout(layout);
layout.numColumns = 2;
Button clickButton = new Button(composite, SWT.NONE);
GridData gd = new GridData(GridData.BEGINNING);
gd.horizontalSpan = 2;
clickButton.setLayoutData(gd);
clickButton.setText("click");
clickButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
createDynamicPage();
}
});
int index = addPage(composite);
setPageText(index, "main page");
}
/**
* Creates the pages of the multi-page editor.
*/
protected void createPages() {
createMainPage();
相关问题
- 1. 动态添加选项卡
- 2. 动态添加选项卡
- 3. 如何在我的自定义wysiwyg编辑器中添加“选项卡”功能?
- 4. 在现有“添加”选项卡之前添加动态引导选项卡
- 5. JqWidget选项卡 - 动态添加ajax内容的选项卡
- 6. 使用GWT中的选项卡动态添加选项卡
- 7. 动态添加选项卡到选项卡控件
- 8. AvalonDock动态添加选项卡
- 9. 从webservice动态添加选项卡
- 10. Sitecore:向内容编辑器添加新选项卡
- 11. 在Android Studio xml编辑器中添加第三个选项卡
- 12. 使用现有面板选项卡动态添加新面板选项卡
- 13. 向md-tabs添加“添加/删除选项卡”功能
- 14. 编辑器选项卡的eclipse设置
- 15. 在动态添加的选项卡中添加表格
- 16. 如何动态添加浏览器选项卡?
- 17. Wix:动态添加功能
- 18. 将选项卡动态添加到navbarPage并选择新选项卡
- 19. Eclipse编辑器选项卡缠绕
- 20. 为所有Eclipse文本编辑器添加功能
- 21. Twitter的引导 - 动态添加/删除选项卡和选项卡内容
- 22. 离子2:添加新的动态选项卡后刷新选项卡视图
- 23. 编辑选项卡HTML/jQuery
- 24. 编辑UiTabBar没有更多选项卡?
- 25. Eclipse中的智能编辑器选项卡标签
- 26. 以编程方式添加选项卡,c#选项卡控件
- 27. jquery-ui选项卡 - 添加选项卡
- 28. 如何编写具有的功能在Word区栏引用选项卡
- 29. 编辑项目的选项卡颜色
- 30. 在不编辑的情况下添加编译器选项Makefile