1 11 package org.eclipse.ui.internal.ide; 12 13 import org.eclipse.ui.IFolderLayout; 14 import org.eclipse.ui.IPageLayout; 15 import org.eclipse.ui.IPerspectiveFactory; 16 17 19 public class ResourcePerspective implements IPerspectiveFactory { 20 23 public ResourcePerspective() { 24 super(); 25 } 26 27 41 public void createInitialLayout(IPageLayout layout) { 42 defineActions(layout); 43 defineLayout(layout); 44 } 45 46 50 public void defineActions(IPageLayout layout) { 51 layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder"); layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file"); 55 layout.addShowViewShortcut(IPageLayout.ID_RES_NAV); 57 layout.addShowViewShortcut(IPageLayout.ID_BOOKMARKS); 58 layout.addShowViewShortcut(IPageLayout.ID_OUTLINE); 59 layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET); 60 layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW); 61 layout.addShowViewShortcut(IPageLayout.ID_PROGRESS_VIEW); 62 layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST); 63 64 layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET); 65 } 66 67 71 public void defineLayout(IPageLayout layout) { 72 String editorArea = layout.getEditorArea(); 74 75 IFolderLayout topLeft = layout.createFolder( 77 "topLeft", IPageLayout.LEFT, (float) 0.26, editorArea); topLeft.addView(IPageLayout.ID_RES_NAV); 79 topLeft.addPlaceholder(IPageLayout.ID_BOOKMARKS); 80 81 IFolderLayout bottomLeft = layout.createFolder( 83 "bottomLeft", IPageLayout.BOTTOM, (float) 0.50, "topLeft"); bottomLeft.addView(IPageLayout.ID_OUTLINE); 86 87 IFolderLayout bottomRight = layout.createFolder( 89 "bottomRight", IPageLayout.BOTTOM, (float) 0.66, editorArea); 91 92 bottomRight.addView(IPageLayout.ID_TASK_LIST); 93 94 } 95 } 96 | Popular Tags |