视图和编辑器的区别

 

When they first start to write plug-ins that contribute visual components, people are often confused about whether they should write a view or an editor. Superficially, the two appear to be very similar: Both are parts that make up a workbench page, both can contain arbitrary visual subcomponents, and both have various mechanisms for plugging in actions and menus. Let’s start with some common misconceptions about the differences between views and editors.

  • Editors display the contents of a file, and views contain groups of files or things other than files. Wrong. Both editors and views can have arbitrary contents from a file or multiple files or be from something that is not a file at all.
  • Editors display text and views display tables or trees. Wrong again. There are no constraints about what goes into an editor or a view. For example, the plug-in Manifest Editor is form-based, whereas the Console view shows plain text.

What are the real differences between views and editors? Here are the main ones.

  • There is generally only one instance of a given view per workbench page, but there can be several instances of the same type of editor.
  • Editors can appear in only one region of the page, whereas views can be moved to any part of the page and minimized as fast views.
  • Editors can be in a dirty state, meaning that their contents are unsaved and will be lost if the editor is closed without saving.
  • Views have a local toolbar, whereas editors contribute buttons to the global toolbar.
  • Editors can be associated with a file name or an extension, and this association can be changed by users.

原文来自:

http://wiki.eclipse.org/FAQ_What_is_the_difference_between_a_view_and_an_editor%3F

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值