简体   繁体   English

swt或jface代码创建文本编辑器和画布

[英]swt or jface code to create a text editor and canvas

*i am looking for text editor and canvas part in eclipse rcp application. *我正在eclipse rcp应用程序中寻找文本编辑器和canvas部分。 can any one recommend the code for text editor and canvas using jface or swt * 谁能使用jface或swt为文本编辑器和canvas建议代码*

i know i can use Canvas canvas=new Canvas(parent, style) 我知道我可以使用Canvas canvas=new Canvas(parent, style)

to create canvas but i need full code. 创建画布,但我需要完整的代码。

i have checked with vogella examples http://www.eclipse.org/swt/examples.php and http://www.eclipse.org/swt/snippets.php but i didn't meet the correct specifications. 我已经使用vogella示例http://www.eclipse.org/swt/examples.phphttp://www.eclipse.org/swt/snippets.php进行了检查,但我不符合正确的规范。

SWT Snippets contains demo code for many different use cases. SWT代码段包含许多不同用例的演示代码。

In your case, you should look at " paint a circle in a canvas ". 在您的情况下,您应该查看“ 在画布上绘制圆圈 ”。

The section "StyledText" contains snippets how to work with the SWT component of the same name. “ StyledText”部分包含一些片段,介绍了如何使用相同名称的SWT组件。 The SWT standalone examples have a simple styled text editor example . SWT独立示例具有一个简单样式的文本编辑器示例

The JFace org.eclipse.jface.text.TextViewer class provides a basic text editor. JFace org.eclipse.jface.text.TextViewer类提供了一个基本的文本编辑器。

If you are using full Eclipse then org.eclipse.ui.editors.text.TextEditor provides a more elaborate editor framework. 如果您使用的是完整的Eclipse,则org.eclipse.ui.editors.text.TextEditor提供了更为详尽的编辑器框架。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM