KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > JavaPerspectiveFactory


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 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  *******************************************************************************/

11 package org.eclipse.jdt.internal.ui;
12
13 import org.eclipse.debug.ui.IDebugUIConstants;
14 import org.eclipse.jdt.ui.JavaUI;
15 import org.eclipse.search.ui.NewSearchUI;
16 import org.eclipse.ui.IFolderLayout;
17 import org.eclipse.ui.IPageLayout;
18 import org.eclipse.ui.IPerspectiveFactory;
19 import org.eclipse.ui.console.IConsoleConstants;
20 import org.eclipse.ui.progress.IProgressConstants;
21
22 public class JavaPerspectiveFactory implements IPerspectiveFactory {
23     
24     /**
25      * Constructs a new Default layout engine.
26      */

27     public JavaPerspectiveFactory() {
28         super();
29     }
30
31     public void createInitialLayout(IPageLayout layout) {
32         String JavaDoc editorArea = layout.getEditorArea();
33         
34         IFolderLayout folder= layout.createFolder("left", IPageLayout.LEFT, (float)0.25, editorArea); //$NON-NLS-1$
35
folder.addView(JavaUI.ID_PACKAGES);
36         folder.addView(JavaUI.ID_TYPE_HIERARCHY);
37         folder.addPlaceholder(IPageLayout.ID_RES_NAV);
38         
39         IFolderLayout outputfolder= layout.createFolder("bottom", IPageLayout.BOTTOM, (float)0.75, editorArea); //$NON-NLS-1$
40
outputfolder.addView(IPageLayout.ID_PROBLEM_VIEW);
41         outputfolder.addView(JavaUI.ID_JAVADOC_VIEW);
42         outputfolder.addView(JavaUI.ID_SOURCE_VIEW);
43         outputfolder.addPlaceholder(NewSearchUI.SEARCH_VIEW_ID);
44         outputfolder.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW);
45         outputfolder.addPlaceholder(IPageLayout.ID_BOOKMARKS);
46         outputfolder.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID);
47         
48         layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.RIGHT, (float)0.75, editorArea);
49         
50         layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
51         layout.addActionSet(JavaUI.ID_ACTION_SET);
52         layout.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET);
53         layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET);
54         
55         // views - java
56
layout.addShowViewShortcut(JavaUI.ID_PACKAGES);
57         layout.addShowViewShortcut(JavaUI.ID_TYPE_HIERARCHY);
58         layout.addShowViewShortcut(JavaUI.ID_SOURCE_VIEW);
59         layout.addShowViewShortcut(JavaUI.ID_JAVADOC_VIEW);
60
61         // views - search
62
layout.addShowViewShortcut(NewSearchUI.SEARCH_VIEW_ID);
63         
64         // views - debugging
65
layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW);
66
67         // views - standard workbench
68
layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
69         layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
70         layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
71         layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
72         layout.addShowViewShortcut(IProgressConstants.PROGRESS_VIEW_ID);
73                 
74         // new actions - Java project creation wizard
75
layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.JavaProjectWizard"); //$NON-NLS-1$
76
layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"); //$NON-NLS-1$
77
layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewClassCreationWizard"); //$NON-NLS-1$
78
layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard"); //$NON-NLS-1$
79
layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewEnumCreationWizard"); //$NON-NLS-1$
80
layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard"); //$NON-NLS-1$
81
layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard"); //$NON-NLS-1$
82
layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard"); //$NON-NLS-1$
83
layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$
84
layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$
85
layout.addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTextFileWizard");//$NON-NLS-1$
86
}
87 }
88
Popular Tags