1 11 package org.eclipse.pde.internal.ui; 12 13 import org.eclipse.debug.ui.IDebugUIConstants; 14 import org.eclipse.jdt.ui.JavaUI; 15 import org.eclipse.ui.IFolderLayout; 16 import org.eclipse.ui.IPageLayout; 17 import org.eclipse.ui.IPerspectiveFactory; 18 19 public class PDEPerspective implements IPerspectiveFactory { 20 21 private IPageLayout factory; 22 23 public PDEPerspective() { 24 super(); 25 } 26 27 public void createInitialLayout(IPageLayout factory) { 28 this.factory = factory; 29 addViews(); 30 addActionSets(); 31 addNewWizardShortcuts(); 32 addPerspectiveShortcuts(); 33 addViewShortcuts(); 34 } 35 36 private void addPerspectiveShortcuts() { 37 factory.addPerspectiveShortcut("org.eclipse.ui.resourcePerspective"); factory.addPerspectiveShortcut(JavaUI.ID_PERSPECTIVE); 39 factory.addPerspectiveShortcut(IDebugUIConstants.ID_DEBUG_PERSPECTIVE); 40 } 41 42 private void addViews() { 43 IFolderLayout topLeft = 44 factory.createFolder( 45 "topLeft", IPageLayout.LEFT, 47 0.25f, 48 factory.getEditorArea()); 49 topLeft.addPlaceholder(IPageLayout.ID_RES_NAV); 50 topLeft.addView(JavaUI.ID_PACKAGES); 51 topLeft.addPlaceholder(JavaUI.ID_TYPE_HIERARCHY); 52 topLeft.addView(IPDEUIConstants.PLUGINS_VIEW_ID); 53 54 IFolderLayout bottom = 55 factory.createFolder( 56 "bottomRight", IPageLayout.BOTTOM, 58 0.75f, 59 factory.getEditorArea()); 60 bottom.addView("org.eclipse.pde.runtime.LogView"); bottom.addView(IPageLayout.ID_TASK_LIST); 62 bottom.addView(IPageLayout.ID_PROBLEM_VIEW); 63 64 factory.addView( 65 IPageLayout.ID_OUTLINE, 66 IPageLayout.RIGHT, 67 0.75f, 68 factory.getEditorArea()); 69 } 70 71 private void addActionSets() { 72 factory.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET); 73 factory.addActionSet(IDebugUIConstants.DEBUG_ACTION_SET); 74 factory.addActionSet(JavaUI.ID_ACTION_SET); 75 factory.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET); 76 factory.addActionSet("org.eclipse.debug.ui.breakpointActionSet"); } 78 79 private void addNewWizardShortcuts() { 80 factory.addNewWizardShortcut("org.eclipse.pde.ui.NewProductConfigurationWizard"); factory.addNewWizardShortcut("org.eclipse.pde.ui.NewProfileWizard"); factory.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"); factory.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewClassCreationWizard"); factory.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard"); factory.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard"); factory.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder"); factory.addNewWizardShortcut("org.eclipse.ui.wizards.new.file"); } 89 90 private void addViewShortcuts() { 91 factory.addShowViewShortcut(JavaUI.ID_PACKAGES); 92 factory.addShowViewShortcut("org.eclipse.pde.runtime.LogView"); factory.addShowViewShortcut(IPDEUIConstants.PLUGINS_VIEW_ID); 94 factory.addShowViewShortcut(IPageLayout.ID_RES_NAV); 95 factory.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW); 96 factory.addShowViewShortcut(IPageLayout.ID_TASK_LIST); 97 factory.addShowViewShortcut(IPageLayout.ID_OUTLINE); 98 } 99 } 100 | Popular Tags |