What are the tradeoffs of the Eclipse Snippets View vs. editor templates? Why were Snippets introduced in the first place?
Eclipse Snippets View与编辑器模板的权衡取舍是什么?为什么首先介绍Snippets?
2 个解决方案
#1
Additionally, the Snippets view was first conceived during the development time frame between Eclipse 1.0 and 2.0, before the content assist templates were anywhere close to being as capable as they now are. That's why it was created, and it simply came into WTP as part of IBM's initial contribution to the project.
此外,Snippets视图最初是在Eclipse 1.0和2.0之间的开发时间框架内构思的,之后内容辅助模板在任何地方都接近于现在的能力。这就是它被创建的原因,它只是作为IBM对该项目的初始贡献的一部分进入WTP。
#2
Snippets appear to be a custom version of templates, with a view in the perspective and GUI dialogs to prompt for variable values in the template.
片段似乎是模板的自定义版本,透视图和GUI对话框中的视图用于提示模板中的变量值。
The only "new" functionality they have is to offer up their functionality through toolbar items in the editors.
他们唯一的“新”功能是通过编辑器中的工具栏项提供其功能。
Snippets view is sort of an extension proposed by WTP (Web Tool Platform) for template, more oriented to (web) code formatting, whereas templates help the user enter reoccurring patterns into a text editor.
片段视图是WTP(Web工具平台)为模板提出的扩展,更加面向(Web)代码格式化,而模板帮助用户将重复出现的模式输入到文本编辑器中。
So at the beginning, Eclipse Templates was a standard eclipse feature which could only be applied for java and javadocs.
因此,最初,Eclipse Templates是一个标准的eclipse功能,只能应用于java和javadocs。
Snippets are basically the same, but for other kind of files and were introduced by WTP to fill the same need, but for their own type of files (xml, jps, html, ...)
(and this is, right there, "why snippets were introduced in the first place")
片段基本相同,但对于其他类型的文件,由WTP引入以满足相同的需求,但对于他们自己的文件类型(xml,jps,html,...)(这就是,就在那里,“为什么片段首先被引入“)
Template does not have their own view, but rather an obscure Preference page (Preferences -> Java -> Editor -> Templates
)
模板没有自己的视图,而是一个模糊的首选项页面(首选项 - > Java - >编辑器 - >模板)
You could at the time however write a small eclipse extension in order to make a Template View.
你可以在当时编写一个小的eclipse扩展来制作模板视图。
This has been resolved since eclipse3.4M6 (Templates have their own view)
这已经解决,因为eclipse3.4M6(模板有自己的视图)
You can also build some custom advanced snippets view
您还可以构建一些自定义高级代码段视图
#1
Additionally, the Snippets view was first conceived during the development time frame between Eclipse 1.0 and 2.0, before the content assist templates were anywhere close to being as capable as they now are. That's why it was created, and it simply came into WTP as part of IBM's initial contribution to the project.
此外,Snippets视图最初是在Eclipse 1.0和2.0之间的开发时间框架内构思的,之后内容辅助模板在任何地方都接近于现在的能力。这就是它被创建的原因,它只是作为IBM对该项目的初始贡献的一部分进入WTP。
#2
Snippets appear to be a custom version of templates, with a view in the perspective and GUI dialogs to prompt for variable values in the template.
片段似乎是模板的自定义版本,透视图和GUI对话框中的视图用于提示模板中的变量值。
The only "new" functionality they have is to offer up their functionality through toolbar items in the editors.
他们唯一的“新”功能是通过编辑器中的工具栏项提供其功能。
Snippets view is sort of an extension proposed by WTP (Web Tool Platform) for template, more oriented to (web) code formatting, whereas templates help the user enter reoccurring patterns into a text editor.
片段视图是WTP(Web工具平台)为模板提出的扩展,更加面向(Web)代码格式化,而模板帮助用户将重复出现的模式输入到文本编辑器中。
So at the beginning, Eclipse Templates was a standard eclipse feature which could only be applied for java and javadocs.
因此,最初,Eclipse Templates是一个标准的eclipse功能,只能应用于java和javadocs。
Snippets are basically the same, but for other kind of files and were introduced by WTP to fill the same need, but for their own type of files (xml, jps, html, ...)
(and this is, right there, "why snippets were introduced in the first place")
片段基本相同,但对于其他类型的文件,由WTP引入以满足相同的需求,但对于他们自己的文件类型(xml,jps,html,...)(这就是,就在那里,“为什么片段首先被引入“)
Template does not have their own view, but rather an obscure Preference page (Preferences -> Java -> Editor -> Templates
)
模板没有自己的视图,而是一个模糊的首选项页面(首选项 - > Java - >编辑器 - >模板)
You could at the time however write a small eclipse extension in order to make a Template View.
你可以在当时编写一个小的eclipse扩展来制作模板视图。
This has been resolved since eclipse3.4M6 (Templates have their own view)
这已经解决,因为eclipse3.4M6(模板有自己的视图)
You can also build some custom advanced snippets view
您还可以构建一些自定义高级代码段视图