RCP EditorPart 调用doSave的方法
来源:互联网 发布:国际电视直播软件 编辑:程序博客网 时间:2024/05/29 16:46
调用EditorPart的doSaveAs比较容易,调用doSave方法稍微复杂一些,因为需要传入IProgressMonitor参数,如下声明
@Overridepublic void doSave(IProgressMonitor monitor) {// Do the Save operation}@Overridepublic void doSaveAs() {// Do the Save As operation}
可以通过获取IWorkbenchPage,利用IWorkbenchPage作为管理工具进行EditorPart中doSave的调用。
IWorkbenchPage.closeEditor声明如下。
/** * Closes the given editor. The editor must belong to this workbench page. * <p> * If the editor has unsaved content and <code>save</code> is * <code>true</code>, the user will be given the opportunity to save it. * </p> * * @param editor * the editor to close * @param save * <code>true</code> to save the editor contents if required * (recommended), and <code>false</code> to discard any unsaved * changes * @return <code>true</code> if the editor was successfully closed, and * <code>false</code> if the editor is still open */public boolean closeEditor(IEditorPart editor, boolean save);调用代码如下,关闭时是否保存根据实际需要设置save值即可
IWorkbenchPage page = Activator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();page.closeEditor(page.getActiveEditor(), true);
0 0
- RCP EditorPart 调用doSave的方法
- RCP的EditorPart保存后焦点控制
- 一个实现了ViewPart和EditorPart的简单RCP例子
- RCP中的ApplicationActionBarAdvisor类是怎样调用fillCoolBar方法的!
- Eclipse RCP 插件开发中经常调用的几个方法
- Eclipse RCP 插件开发中经常调用的几个方法
- ViewPart和EditorPart之间的通讯
- (转)Eclipse RCP 插件开发中经常调用的几个方法
- Eclipse RCP 插件开发中经常调用的几个方法(转载)
- Editorpart添加 打开、关闭、激活、最前端显示的监听
- RCP中获得shell的方法
- RCP中showView方法的说明
- Eclipse RCP关闭按钮的屏蔽方法
- Eclipse RCP 文件路径相关的方法
- RCP中showView方法的说明
- RCP中调用EJB
- rcp(插件开发)RCP中控制Editor不重复打开的方法
- RCP菜单栏,工具栏实现的两种方法及RCP记事本例子
- 对求欧拉回路算法的一些理解
- iPhone6等高端机斗得热闹,低端机也没闲着
- How to do logging in C# with log4net
- xlrd部分类方法说明
- 前端书籍推荐
- RCP EditorPart 调用doSave的方法
- [技术分享]java并行调度框架封装及示例
- win2003server 最基本的安全设置
- 在Flex中判断是否在组件之外单击的技巧
- Enable Accelerated Compositing on the WebKit Android NDK port && Texture Mapper
- 在 Mac 中安装 MySQLdb (Python mysql )
- URL encoding
- org.apache.catalina.connector.Request.parseParameters(Request.java:2446) NullPointerException异常处理
- python获取微信公共平台消息列表和用户头像