简体   繁体   English

在 SWT 对话框中嵌入 org.eclipse.wst.sse.ui.StructuredTextEditor

[英]embed org.eclipse.wst.sse.ui.StructuredTextEditor in SWT Dialog

Is there any way to add StructuredTextEditor in SWT dialog?有什么方法可以在 SWT 对话框中添加 StructuredTextEditor 吗? if not, is there any method that could be used to view and edit xml files from within a dialog (WizardPage)如果没有,是否有任何方法可用于从对话框(WizardPage)中查看和编辑 xml 文件

Thanks!谢谢!

The next step above StyledText would be to use JFace Text and SourceViewer. StyledText 的下一步是使用 JFace Text 和 SourceViewer。 The viewer hooks up your text presentation to the StyleText widget, and is the viewer that the java editor uses.查看器将您的文本演示文稿连接到 StyleText 小部件,并且是 java 编辑器使用的查看器。 The viewer and the widget can then be used in a wizard or dialog.然后可以在向导或对话框中使用查看器和小部件。

For more information see http://wiki.eclipse.org/Platform_Text有关更多信息,请参阅http://wiki.eclipse.org/Platform_Text

Editors are displayed only in the editor area, so no, you can't get a StructuredTextEditor in a wizard page.编辑器仅显示在编辑器区域中,因此不,您无法在向导页面中获取 StructuredTextEditor。 What you need to do is use an SWT widget that will let you display and edit text.您需要做的是使用一个 SWT 小部件,它可以让您显示和编辑文本。 Since you want to be able to edit XML files, my guess is that StyledText would be of use to you.由于您希望能够编辑 XML 文件,我猜StyledText对您有用。 But you'll need to take care of a lot of things which are usually already taken care of (ie your editor's 'dirty' state etc.).但是您需要处理很多通常已经处理好的事情(即您的编辑器的“脏”state 等)。 I haven't tried doing what you want to do, so I can't offer a much better advice then this, but if I had to do it, taking a look at StyledText is where I would start.我没有尝试做你想做的事,所以我不能提供比这更好的建议,但如果我必须这样做,看看 StyledText 是我开始的地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Eclipse无法解析插件org.eclipse.wst.server.ui - Eclipse unable to resolve plugin org.eclipse.wst.server.ui 如何扩展org.eclipse.wst.jsdt.internal.ui.javaeditor并使用cutom javaScript标签创建我们自己的Java脚本编辑器 - how to extends org.eclipse.wst.jsdt.internal.ui.javaeditor and create our own Java Script Editor with cutom javaScript tags 什么是org.eclipse.wst.common.component以及如何将它用于ant - what is org.eclipse.wst.common.component and how to use it for ant NoClassDefFoundError org / eclipse / swt / SWTError - NoClassDefFoundError org/eclipse/swt/SWTError eclipse SWT中的org.eclipse.swt.widgets.Text验证装饰器 - org.eclipse.swt.widgets.Text validation decorator in eclipse SWT 由于org.eclipse.e4.ui.workbench.swt中违反了使用约束,因此无法解决捆绑软件 - Bundle was not resolved because of a uses contraint violation in org.eclipse.e4.ui.workbench.swt Eclipse M2E更改org.eclipse.wst.common.component - Eclipse M2E changing org.eclipse.wst.common.component 使用Eclipse IDE编辑.settings / org.eclipse.wst.common.component - Edit .settings/org.eclipse.wst.common.component using Eclipse IDE ClassNotFoundException:org.eclipse.swt.widgets.Display - ClassNotFoundException: org.eclipse.swt.widgets.Display 访问工作空间\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps\\中的文件 - Access files inside workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM