[英]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.