KickJava   Java API By Example, From Geeks To Geeks.

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


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
12 package org.eclipse.jdt.internal.ui;
13
14 import org.eclipse.debug.ui.IDebugUIConstants;
15 import org.eclipse.jdt.ui.JavaUI;
16 import org.eclipse.search.ui.NewSearchUI;
17 import org.eclipse.ui.IFolderLayout;
18 import org.eclipse.ui.IPageLayout;
19 import org.eclipse.ui.IPerspectiveFactory;
20 import org.eclipse.ui.IPlaceholderFolderLayout;
21 import org.eclipse.ui.console.IConsoleConstants;
22 import org.eclipse.ui.progress.IProgressConstants;
23
24 public class JavaHierarchyPerspectiveFactory implements IPerspectiveFactory {
25         
26     /**
27      * Constructs a new Java hierarchy layout engine.
28      */

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