1 /*******************************************************************************
2 * Copyright (c) 2000, 2010 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * IBM Corporation - initial API and implementation
10 * Dakshinamurthy Karra (Jalian Systems) - Templates View - https://bugs.eclipse.org/bugs/show_bug.cgi?id=69581
11 *******************************************************************************/
12 package org.eclipse.jdt.internal.ui;
14 import org.eclipse.ui.IFolderLayout;
15 import org.eclipse.ui.IPageLayout;
16 import org.eclipse.ui.IPerspectiveFactory;
17 import org.eclipse.ui.console.IConsoleConstants;
18 import org.eclipse.ui.progress.IProgressConstants;
20 import org.eclipse.ui.texteditor.templates.TemplatesView;
22 import org.eclipse.debug.ui.IDebugUIConstants;
24 import org.eclipse.search.ui.NewSearchUI;
26 import org.eclipse.jdt.ui.JavaUI;
29 public class JavaPerspectiveFactory implements IPerspectiveFactory {
33 * Constructs a new Default layout engine.
35 public JavaPerspectiveFactory() {
39 public void createInitialLayout(IPageLayout layout) {
40 String editorArea = layout.getEditorArea();
42 IFolderLayout folder= layout.createFolder("left", IPageLayout.LEFT, (float)0.25, editorArea); //$NON-NLS-1$
43 folder.addView(JavaUI.ID_PACKAGES);
44 folder.addPlaceholder(JavaUI.ID_TYPE_HIERARCHY);
45 folder.addPlaceholder(JavaPlugin.ID_RES_NAV);
46 folder.addPlaceholder(IPageLayout.ID_PROJECT_EXPLORER);
48 IFolderLayout outputfolder= layout.createFolder("bottom", IPageLayout.BOTTOM, (float)0.75, editorArea); //$NON-NLS-1$
49 outputfolder.addView(IPageLayout.ID_PROBLEM_VIEW);
50 outputfolder.addView(JavaUI.ID_JAVADOC_VIEW);
51 outputfolder.addView(JavaUI.ID_SOURCE_VIEW);
52 outputfolder.addPlaceholder(NewSearchUI.SEARCH_VIEW_ID);
53 outputfolder.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW);
54 outputfolder.addPlaceholder(IPageLayout.ID_BOOKMARKS);
55 outputfolder.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID);
57 IFolderLayout outlineFolder = layout.createFolder("right", IPageLayout.RIGHT, (float)0.75, editorArea); //$NON-NLS-1$
58 outlineFolder.addView(IPageLayout.ID_OUTLINE);
60 outlineFolder.addPlaceholder(TemplatesView.ID);
62 layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
63 layout.addActionSet(JavaUI.ID_ACTION_SET);
64 layout.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET);
65 layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET);
68 layout.addShowViewShortcut(JavaUI.ID_PACKAGES);
69 layout.addShowViewShortcut(JavaUI.ID_TYPE_HIERARCHY);
70 layout.addShowViewShortcut(JavaUI.ID_SOURCE_VIEW);
71 layout.addShowViewShortcut(JavaUI.ID_JAVADOC_VIEW);
75 layout.addShowViewShortcut(NewSearchUI.SEARCH_VIEW_ID);
78 layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW);
80 // views - standard workbench
81 layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
82 layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
83 layout.addShowViewShortcut(JavaPlugin.ID_RES_NAV);
84 layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
85 layout.addShowViewShortcut(IProgressConstants.PROGRESS_VIEW_ID);
86 layout.addShowViewShortcut(IPageLayout.ID_PROJECT_EXPLORER);
87 layout.addShowViewShortcut(TemplatesView.ID);
88 layout.addShowViewShortcut("org.eclipse.pde.runtime.LogView"); //$NON-NLS-1$
90 // new actions - Java project creation wizard
91 layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.JavaProjectWizard"); //$NON-NLS-1$
92 layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"); //$NON-NLS-1$
93 layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewClassCreationWizard"); //$NON-NLS-1$
94 layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard"); //$NON-NLS-1$
95 layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewEnumCreationWizard"); //$NON-NLS-1$
96 layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard"); //$NON-NLS-1$
97 layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard"); //$NON-NLS-1$
98 layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard"); //$NON-NLS-1$
99 layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewJavaWorkingSetWizard"); //$NON-NLS-1$
100 layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$
101 layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$
102 layout.addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTextFileWizard");//$NON-NLS-1$
104 // 'Window' > 'Open Perspective' contributions
105 layout.addPerspectiveShortcut(JavaUI.ID_BROWSING_PERSPECTIVE);
106 layout.addPerspectiveShortcut(IDebugUIConstants.ID_DEBUG_PERSPECTIVE);