]> git.uio.no Git - ifi-stolz-refaktor.git/blame - case-study/jdt-before/ui/org/eclipse/jdt/internal/ui/JavaPerspectiveFactory.java
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-before / ui / org / eclipse / jdt / internal / ui / JavaPerspectiveFactory.java
CommitLineData
1b2798f6
EK
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
7 *
8 * Contributors:
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 *******************************************************************************/
12package org.eclipse.jdt.internal.ui;
13
14import org.eclipse.ui.IFolderLayout;
15import org.eclipse.ui.IPageLayout;
16import org.eclipse.ui.IPerspectiveFactory;
17import org.eclipse.ui.console.IConsoleConstants;
18import org.eclipse.ui.progress.IProgressConstants;
19
20import org.eclipse.ui.texteditor.templates.TemplatesView;
21
22import org.eclipse.debug.ui.IDebugUIConstants;
23
24import org.eclipse.search.ui.NewSearchUI;
25
26import org.eclipse.jdt.ui.JavaUI;
27
28
29public class JavaPerspectiveFactory implements IPerspectiveFactory {
30
31
32 /**
33 * Constructs a new Default layout engine.
34 */
35 public JavaPerspectiveFactory() {
36 super();
37 }
38
39 public void createInitialLayout(IPageLayout layout) {
40 String editorArea = layout.getEditorArea();
41
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);
47
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);
56
57 IFolderLayout outlineFolder = layout.createFolder("right", IPageLayout.RIGHT, (float)0.75, editorArea); //$NON-NLS-1$
58 outlineFolder.addView(IPageLayout.ID_OUTLINE);
59
60 outlineFolder.addPlaceholder(TemplatesView.ID);
61
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);
66
67 // views - java
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);
72
73
74 // views - search
75 layout.addShowViewShortcut(NewSearchUI.SEARCH_VIEW_ID);
76
77 // views - debugging
78 layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW);
79
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$
89
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$
103
104 // 'Window' > 'Open Perspective' contributions
105 layout.addPerspectiveShortcut(JavaUI.ID_BROWSING_PERSPECTIVE);
106 layout.addPerspectiveShortcut(IDebugUIConstants.ID_DEBUG_PERSPECTIVE);
107
108 }
109}