



免費(fèi)預(yù)覽已結(jié)束,剩余1頁可下載查看
下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
如何在自己的透視圖(Perspective)里面加入eclipse自帶視圖,如Project Explorer視圖呵呵不好意思, 這里我先前理解錯(cuò)了,加入eclipse自帶視圖直接addView(org.eclipse.ui.views.ResourceNavigator);就可以了下面我先前理解錯(cuò)了,不過有些代碼對(duì)我還有點(diǎn)價(jià)值,這里也不刪除了大家見諒!由于這個(gè)是用于自己記憶的文章,這里寫的可能粗略了點(diǎn),大家見諒,如果看起來不太理解大家可以直接查看jdk 源碼中org.eclipse.ui.ide.application的源碼,里面代碼很少,不難理 解,point=org.eclipse.ui.perspectives這個(gè)擴(kuò)展點(diǎn)便是了。 %Perspective.resourceDescription /這里可以查看擴(kuò)展點(diǎn)API,org.eclipse.ui.perspectiveExtensions擴(kuò)展點(diǎn),id 將添加至透視圖的“導(dǎo)航”菜單的“顯示在.”提示器的視圖的唯一標(biāo)識(shí)。 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.newresource.BasicNewFileResourceWizard;import org.eclipse.ui.wizards.newresource.BasicNewFolderResourceWizard;/*/public class ResourcePerspective implements IPerspectiveFactory /* * Constructs a new Default layout engine. */ public ResourcePerspective() super(); /* * Defines the initial layout for a perspective. */ public void createInitialLayout(IPageLayout layout) defineActions(layout); defineLayout(layout); /* * Defines the initial actions for a page. * param layout The layout we are filling */ public void defineActions(IPageLayout layout) / Add new wizards. layout.addNewWizardShortcut(BasicNewFolderResourceWizard.WIZARD_ID); layout.addNewWizardShortcut(BasicNewFileResourceWizard.WIZARD_ID); / Add show views. layout.addShowViewShortcut(ProjectExplorer.VIEW_ID); layout.addShowViewShortcut(IPageLayout.ID_BOOKMARKS); layout.addShowViewShortcut(IPageLayout.ID_OUTLINE); layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET); layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW); layout.addShowViewShortcut(IPageLayout.ID_PROGRESS_VIEW); layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST); layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET); /* * Defines the initial layout for a page. * param layout The layout we are filling */ public void defineLayout(IPageLayout layout) / Editors are placed for free. String editorArea = layout.getEditorArea(); / Top left. IFolderLayout topLeft = layout.createFolder( topLeft, IPageLayout.LEFT, (float) 0.26, editorArea);/$NON-NLS-1$ topLeft.addView(ProjectExplorer.VIEW_ID); topLeft.addPlaceholder(IPageLayout.ID_BOOKMARKS); / Add a placeholder for the old navigator to maintain compatibility topLeft.addPlaceholder(org.eclipse.ui.views.ResourceNavigator); /$NON-NLS-1$ / Bottom left. IFolderLayout bottomLeft = layout.createFolder( bottomLeft, IPageLayout.BOTTOM, (float) 0.50,/$NON-NLS-1$ topLeft);/$NON-NLS-1$ bottomLeft.addView(IPageLayout.ID_OUTLINE); / Bottom right.IFolderLayout bottomRight = layout.createFolder( bottomRight, IPageLayout.BOTTOM, (float) 0.66,/$NON-NLS-1$ editorArea);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.IPageLayout;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) defineActions(layout);defineLayout(layout);/ 定義透視圖上的默認(rèn)行為private void defineActions(IPageLayout layout) layout.addNewWizardShortcut(NewRobinProjectWizard.NEW_ROBIN_PROJECT_ID);/ 添加 新建文件夾layout.addNewWizardShortcut(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.UntitledTextFileWizard);/$NON-NLS-1$ / 在當(dāng)前視圖上 window/show view 上的東西 layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW); layout.addShowViewShortcut(IPageLayout.ID_OUTLINE); layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST); layout.addShowViewShortcut(IPageLayout.ID_BOOKMARKS); layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW); layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET); layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET);private void defineLayout(IPageLayout layout) IFolderLayout topLeft = layout.createFolder(topLeft, IPageLayout.LEFT, 0.25f, IPageLayout.ID_EDITOR_AREA);topLeft.addView(IPageLayout.ID_PROJECT_EXPLORER);IFolderLayout bottomLeft = layout.createFold
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 利用信息技術(shù)助力提高初中生科學(xué)素養(yǎng)的研究
- 抒情表達(dá)自我作文7篇范文
- ××超市捐贈(zèng)管理制度
- 詩詞鑒賞中的意象解讀:大一語文教案
- 雨中的溫情寫事作文(11篇)
- 讀小王子后的感悟心得作文7篇范文
- 2025年無損檢測(cè)員(中級(jí))無損檢測(cè)在建筑行業(yè)的應(yīng)用試卷
- 童話故事白雪公主的感悟(10篇)
- 2025年制動(dòng)氣室項(xiàng)目立項(xiàng)申請(qǐng)報(bào)告
- 藝術(shù)設(shè)計(jì)領(lǐng)域特別聲明及證明(5篇)
- 銀行人力資源發(fā)展計(jì)劃
- 噴涂作業(yè)安全專項(xiàng)培訓(xùn)
- 危險(xiǎn)性較大分部分項(xiàng)工程及建筑施工現(xiàn)場(chǎng)易發(fā)生重大事故的部位環(huán)節(jié)的預(yù)防監(jiān)控措施和應(yīng)應(yīng)急處理預(yù)案
- 養(yǎng)老護(hù)理員四級(jí)試題含答案
- 全國寄生蟲病防治技能知識(shí)競(jìng)賽參考試題(附答案)
- 高速公路改擴(kuò)建工程監(jiān)理投標(biāo)方案(技術(shù)方案)
- 高分子鏈結(jié)構(gòu)試題及答案
- (高清版)DB11∕T1191.3-2024實(shí)驗(yàn)室危險(xiǎn)化學(xué)品安全管理要求 第3部分:科研單位
- T-CESA 1281-2023 制造業(yè)企業(yè)質(zhì)量管理能力評(píng)估規(guī)范
- 貴州財(cái)經(jīng)大學(xué)《自然地理學(xué)理論與方法》2023-2024學(xué)年第二學(xué)期期末試卷
- DBJ33∕T 1104-2022 建設(shè)工程監(jiān)理工作標(biāo)準(zhǔn)
評(píng)論
0/150
提交評(píng)論