1 11 package org.eclipse.ui.internal.ide.application; 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 21 private static String ID_PROJECT_EXPLORER = "org.eclipse.ui.navigator.ProjectExplorer"; 25 public ResourcePerspective() { 26 super(); 27 } 28 29 43 public void createInitialLayout(IPageLayout layout) { 44 defineActions(layout); 45 defineLayout(layout); 46 } 47 48 52 public void defineActions(IPageLayout layout) { 53 layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder"); layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file"); 57 layout.addShowViewShortcut(IPageLayout.ID_RES_NAV); 59 layout.addShowViewShortcut(IPageLayout.ID_BOOKMARKS); 60 layout.addShowViewShortcut(IPageLayout.ID_OUTLINE); 61 layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET); 62 layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW); 63 layout.addShowViewShortcut(IPageLayout.ID_PROGRESS_VIEW); 64 layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST); 65 66 layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET); 67 } 68 69 73 public void defineLayout(IPageLayout layout) { 74 String editorArea = layout.getEditorArea(); 76 77 IFolderLayout topLeft = layout.createFolder( 79 "topLeft", IPageLayout.LEFT, (float) 0.26, editorArea); topLeft.addView(ID_PROJECT_EXPLORER); 81 topLeft.addPlaceholder(IPageLayout.ID_BOOKMARKS); 82 83 topLeft.addPlaceholder("org.eclipse.ui.views.ResourceNavigator"); 86 IFolderLayout bottomLeft = layout.createFolder( 88 "bottomLeft", IPageLayout.BOTTOM, (float) 0.50, "topLeft"); bottomLeft.addView(IPageLayout.ID_OUTLINE); 91 92 IFolderLayout bottomRight = layout.createFolder( 94 "bottomRight", IPageLayout.BOTTOM, (float) 0.66, editorArea); 96 97 bottomRight.addView(IPageLayout.ID_TASK_LIST); 98 99 } 100 } 101 | Popular Tags |