01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.ui;
11:
12: import org.eclipse.debug.ui.IDebugUIConstants;
13: import org.eclipse.jdt.ui.JavaUI;
14: import org.eclipse.ui.IFolderLayout;
15: import org.eclipse.ui.IPageLayout;
16: import org.eclipse.ui.IPerspectiveFactory;
17:
18: public class PDEPerspective implements IPerspectiveFactory {
19:
20: private IPageLayout factory;
21:
22: public PDEPerspective() {
23: super ();
24: }
25:
26: public void createInitialLayout(IPageLayout factory) {
27: this .factory = factory;
28: addViews();
29: addActionSets();
30: addNewWizardShortcuts();
31: addPerspectiveShortcuts();
32: addViewShortcuts();
33: }
34:
35: private void addPerspectiveShortcuts() {
36: factory
37: .addPerspectiveShortcut("org.eclipse.ui.resourcePerspective"); //$NON-NLS-1$
38: factory.addPerspectiveShortcut(JavaUI.ID_PERSPECTIVE);
39: factory
40: .addPerspectiveShortcut(IDebugUIConstants.ID_DEBUG_PERSPECTIVE);
41: }
42:
43: private void addViews() {
44: IFolderLayout topLeft = factory.createFolder("topLeft", //$NON-NLS-1$
45: IPageLayout.LEFT, 0.25f, factory.getEditorArea());
46: topLeft.addPlaceholder(IPageLayout.ID_RES_NAV);
47: topLeft.addView(JavaUI.ID_PACKAGES);
48: topLeft.addPlaceholder(JavaUI.ID_TYPE_HIERARCHY);
49: topLeft.addView(IPDEUIConstants.PLUGINS_VIEW_ID);
50:
51: IFolderLayout bottom = factory.createFolder("bottomRight", //$NON-NLS-1$
52: IPageLayout.BOTTOM, 0.75f, factory.getEditorArea());
53: bottom.addView("org.eclipse.pde.runtime.LogView"); //$NON-NLS-1$
54: bottom.addView(IPageLayout.ID_TASK_LIST);
55: bottom.addView(IPageLayout.ID_PROBLEM_VIEW);
56:
57: factory.addView(IPageLayout.ID_OUTLINE, IPageLayout.RIGHT,
58: 0.75f, factory.getEditorArea());
59: }
60:
61: private void addActionSets() {
62: factory.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
63: factory.addActionSet(IDebugUIConstants.DEBUG_ACTION_SET);
64: factory.addActionSet(JavaUI.ID_ACTION_SET);
65: factory.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET);
66: factory
67: .addActionSet("org.eclipse.debug.ui.breakpointActionSet"); //$NON-NLS-1$
68: }
69:
70: private void addNewWizardShortcuts() {
71: factory
72: .addNewWizardShortcut("org.eclipse.pde.ui.NewProductConfigurationWizard"); //$NON-NLS-1$
73: factory
74: .addNewWizardShortcut("org.eclipse.pde.ui.NewProfileWizard"); //$NON-NLS-1$
75: factory
76: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"); //$NON-NLS-1$
77: factory
78: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewClassCreationWizard"); //$NON-NLS-1$
79: factory
80: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard"); //$NON-NLS-1$
81: factory
82: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard"); //$NON-NLS-1$
83: factory
84: .addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$
85: factory.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$
86: }
87:
88: private void addViewShortcuts() {
89: factory.addShowViewShortcut(JavaUI.ID_PACKAGES);
90: factory.addShowViewShortcut("org.eclipse.pde.runtime.LogView"); //$NON-NLS-1$
91: factory.addShowViewShortcut(IPDEUIConstants.PLUGINS_VIEW_ID);
92: factory.addShowViewShortcut(IPageLayout.ID_RES_NAV);
93: factory.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
94: factory.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
95: factory.addShowViewShortcut(IPageLayout.ID_OUTLINE);
96: }
97: }
|