RCP开发中Editor与View的选择
2007-07-16 13:45
176 查看
摘录自《Eclipse Rich Client Platform: Designing, Coding, and Packaging Java™ Applications》
Here, Hyperbola is the sample application used in this book, and it is a chatting application, like qq or MSN.
...views and editors contain the "real content" for your application. But how do you choose which one to use?
The rule of thumb is that editors are meant for the primary focus of attention while views provide supporting information for a given task. So, in Hyperbola, chatting is the primary task and browsing or managing contacts is a supporting function. This indicates that the Hyperbola chat area should be implemented as an editor.
Not all decisions are quite that clear-cut, however. Even the choice made here has been hotly discussed by the Hyperbola development team. It is, of course, technically possible to use a view to represent a unique chat instead of using the chat editor (an excellent exercise for the reader).
Here is a short list of differences between views and editors to help you decide which to use for your application:
Editors are shared between perspectives in the same window. For example, if you close an editor in one perspective, it is closed in all perspectives.
Editors and views cannot be mixed in the same stack. For example, you can't drag and drop views and editors into the same location in the perspective.
Views can be detached from a Workbench window.
Views can be shown without a title.
Editors add contributions to the main toolbar and menu whereas views add contributions to their local toolbar and menu. You can, however, associate action sets to appear when a view is active.
It is possible to ask for the active editor even if the editor does not have focus. This makes it easier to synchronize views with editors, for example, linking outline-style views to the current editor.
Here, Hyperbola is the sample application used in this book, and it is a chatting application, like qq or MSN.
...views and editors contain the "real content" for your application. But how do you choose which one to use?
The rule of thumb is that editors are meant for the primary focus of attention while views provide supporting information for a given task. So, in Hyperbola, chatting is the primary task and browsing or managing contacts is a supporting function. This indicates that the Hyperbola chat area should be implemented as an editor.
Not all decisions are quite that clear-cut, however. Even the choice made here has been hotly discussed by the Hyperbola development team. It is, of course, technically possible to use a view to represent a unique chat instead of using the chat editor (an excellent exercise for the reader).
Here is a short list of differences between views and editors to help you decide which to use for your application:
Editors are shared between perspectives in the same window. For example, if you close an editor in one perspective, it is closed in all perspectives.
Editors and views cannot be mixed in the same stack. For example, you can't drag and drop views and editors into the same location in the perspective.
Views can be detached from a Workbench window.
Views can be shown without a title.
Editors add contributions to the main toolbar and menu whereas views add contributions to their local toolbar and menu. You can, however, associate action sets to appear when a view is active.
It is possible to ask for the active editor even if the editor does not have focus. This makes it easier to synchronize views with editors, for example, linking outline-style views to the current editor.
相关文章推荐
- rcp(插件开发)如何获取视图(view)中当前选择的元素
- RCP开发与应用:Perspective配置多视图(view),屏蔽视图的关闭和移动
- RCP之病人信息系统开发总结(4):MVC模式之View层—透视图
- 【开发技巧】在iOS8下WebView的选择
- [Android开发] 自定义View之GridView单选 金额选择Layout-ChooseMoneyLayout
- iOS开发-数据选择UIPickerView(案例一)
- iOS开发-数据选择UIPickerView
- 【iOS开发】UITableView 默认选择某行的方法
- 如果是作为客户端的HTTP+JSON接口工程,没有JSP等view视图的情况下,使用Jersery框架开发绝对是第一选择。而在基于Spring3 MVC的架构下,对HTTP+JSON的返回类型也有很好
- RCP之病人信息系统开发总结(5):MVC模式之View层—视图
- iOS开发-数据选择UIPickerView(案例二)
- android开发 recycleview的item中加入checkbox实现批量选择条目(复用时防止checkbox勾选状态错乱)
- 【Android开发笔记】viewpager+fragment对adapter的选择
- Android开发——相册拍照_02.将拍照得到或相册中选择的图片显示在ImageView中
- RCP之病人信息系统开发总结(6):MVC模式之View层—编辑器
- Android开发之如何在WebView中点击链接使用自身打开(解决出现的选择使用第三方应用的问题)
- RCP中获得其他view或editor引用的方法
- rcp(插件开发)RCP中控制Editor不重复打开的方法
- 安卓开发 简单实现自定义横向滚动选择View : HorizontalselectedView
- ios开发 自定义日期选择器 PTXDatePickerView