下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、.如何在自己的透视图(Perspective)里面加入eclipse自带视图,如Project Explorer视图呵呵 不好意思, 这里我先前理解错了,加入eclipse自带视图直接addView("org.eclipse.ui.views.ResourceNavigator");就可以了下面我先前理解错了,不过有些代码对我还有点价值,这里也不删除了大家见谅!由于这个是用于自己记忆的文章,这里写的可能粗略了点,大家见谅,如果看起来不太理解大家可以直接查看jdk 源码中org.eclipse.ui.ide.application的源码,里面代码很少,不难理 解,p
2、oint="org.eclipse.ui.perspectives"这个扩展点便是了。 <extension point="org.eclipse.ui.perspectives"> <perspective
3、; name="%Perspective.resourcePerspective" icon="$nl$/icons/full/eview16/resource_persp.gif" class="ernal.ide.applicatio
4、n.ResourcePerspective" id="org.eclipse.ui.resourcePerspective"> <description> %Perspective.resou
5、rceDescription </description> </perspective> </extension> <extension point="org.eclipse.ui.perspectiveExtensions">
6、60; <perspectiveExtension targetID="org.eclipse.ui.resourcePerspective"> /这里可以查看扩展点API,org.eclipse.ui.perspectiveExtensions扩展点,id 将添加至透视图的“导航”菜单的“显示在.”提示器的视图的唯一标识。
7、160; <showInPart id="org.eclipse.ui.navigator.ProjectExplorer"> </showInPart> </perspectiveExte
8、nsion> </extension> package ernal.ide.application;import org.eclipse.ui.IFolderLayout;import org.eclipse.ui.IPageLayout;import org.eclipse.ui.IPerspectiveFactory;import org.eclipse.ui.navigator.resources.ProjectExplorer;import org.eclipse.ui.wizards.newres
9、ource.BasicNewFileResourceWizard;import org.eclipse.ui.wizards.newresource.BasicNewFolderResourceWizard;/* */public class ResourcePerspective implements IPerspectiveFactory /* * Constructs a new Default layout engine. */
10、160; public ResourcePerspective() super(); /* * Defines the initial layout for a perspective. */ public void createInitialLayout(I
11、PageLayout layout) defineActions(layout); defineLayout(layout); /* * Defines the initial actions for a page. * param layout
12、 The layout we are filling */ public void defineActions(IPageLayout layout) / Add "new wizards". layout.addNewWizardShortcut(BasicNewFolderResourceWizard.WIZARD_ID
13、); layout.addNewWizardShortcut(BasicNewFileResourceWizard.WIZARD_ID); / Add "show views". layout.addShowViewShortcut(ProjectExplorer.VIEW_ID);
14、0; layout.addShowViewShortcut(IPageLayout.ID_BOOKMARKS); layout.addShowViewShortcut(IPageLayout.ID_OUTLINE); layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET);
15、; layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW); layout.addShowViewShortcut(IPageLayout.ID_PROGRESS_VIEW); layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
16、0; layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET); /* * Defines the initial layout for a page. * param layout The layout we are filling */ public void define
17、Layout(IPageLayout layout) / Editors are placed for free. String editorArea = layout.getEditorArea(); / Top left. IFolderLayout top
18、Left = layout.createFolder( "topLeft", IPageLayout.LEFT, (float) 0.26, editorArea);/$NON-NLS-1$ topLeft.addView(ProjectExplorer.VIEW_ID);
19、60; topLeft.addPlaceholder(IPageLayout.ID_BOOKMARKS); / Add a placeholder for the old navigator to maintain compatibility topLeft.addPlaceholder("org.eclipse.ui.views.ResourceNavigator");
20、/$NON-NLS-1$ / Bottom left. IFolderLayout bottomLeft = layout.createFolder( "bottomLeft", IPageLayout.BOTTOM, (float
21、) 0.50,/$NON-NLS-1$ "topLeft");/$NON-NLS-1$ bottomLeft.addView(IPageLayout.ID_OUTLINE); / Bottom right. I
22、FolderLayout bottomRight = layout.createFolder( "bottomRight", IPageLayout.BOTTOM, (float) 0.66,/$NON-NLS-1$ e
23、ditorArea); bottomRight.addView(IPageLayout.ID_TASK_LIST); 自用代码(透视图配置) 博客分类: · eclipse插件EclipseUIpackage com.posture.example.navigator;import org.eclipse.debug.ui.IDebugUIConstants;import org.eclipse.ui.IFolderLayout;import org.eclipse.ui.IPa
24、geLayout;import org.eclipse.ui.IPerspectiveFactory;import org.eclipse.ui.console.IConsoleConstants;import com.posture.example.navigator.wizards.NewRobinProjectWizard;public class Perspective implements IPerspectiveFactory public void createInitialLayout(IPageLayout layout)
25、160;defineActions(layout); defineLayout(layout); / 定义透视图上的默认行为 private void defineActions(IPageLayout layout) layout.addNewWizardShortcut(NewRobinProjectWizard.NEW_ROBIN_PROJECT_ID); / 添加 新建文件夹 layout.addNewWizardShortcut("
26、;org.eclipse.ui.wizards.new.folder");/$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");/$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTe
27、xtFileWizard");/$NON-NLS-1$ / 在当前视图上 window/show view 上的东西 layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW); layo
28、ut.addShowViewShortcut(IPageLayout.ID_OUTLINE); layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST); layout.addShowViewShortcut(IPageLayout.ID_BOOKMARKS); layout.addShowViewShortcut(IPageLayout.ID_
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年智能香氛薰香器项目评估报告
- 2026年无组织排放管控治一体化改造项目公司成立分析报告
- 《GAT 1154.3-2017视频图像分析仪 第3部分 视频图像检索技术要求》专题研究报告深度
- 教师工作量与考核制度
- 教学资源共建共享制度
- 幼儿园活动环境卫生制度
- gps北斗天线导航课程设计
- 市政道路施工质量监督办法制度
- uml课程设计实验报告
- 煤厂财务制度
- GB/T 3906-20203.6 kV~40.5 kV交流金属封闭开关设备和控制设备
- GB/T 33091-2016聚氨酯筛板
- 2023年电大当代中国政治制度机考拼音排版绝对好用按字母排序
- GB 39669-2020牙刷及口腔器具安全通用技术要求
- 精益生产试题与答案
- 医院关于主治医师晋升前到急诊科、重症医学科轮转锻炼工作的管理规定
- L1会计研究方法论简介课件
- 防治水培训课件
- 按摩穴位保健养生课件
- 食材配送投标服务方案
- 大学生心理健康教育全套课件
评论
0/150
提交评论