KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > terracotta > dso > TerracottaPerspective


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package org.terracotta.dso;
5
6 import org.eclipse.debug.ui.IDebugUIConstants;
7 import org.eclipse.jdt.ui.JavaUI;
8 import org.eclipse.search.ui.NewSearchUI;
9 import org.eclipse.ui.IFolderLayout;
10 import org.eclipse.ui.IPageLayout;
11 import org.eclipse.ui.IPerspectiveFactory;
12 import org.eclipse.ui.console.IConsoleConstants;
13 import org.eclipse.ui.progress.IProgressConstants;
14 import org.terracotta.dso.views.BootJarView;
15 import org.terracotta.dso.views.ConfigViewPart;
16
17 public class TerracottaPerspective implements IPerspectiveFactory {
18   public void createInitialLayout(IPageLayout layout) {
19     String JavaDoc editorArea = layout.getEditorArea();
20     
21     IFolderLayout folder= layout.createFolder("left", IPageLayout.LEFT, (float)0.25, editorArea); //$NON-NLS-1$
22
folder.addView(JavaUI.ID_PACKAGES);
23     folder.addView(JavaUI.ID_TYPE_HIERARCHY);
24     folder.addPlaceholder(IPageLayout.ID_RES_NAV);
25     
26     IFolderLayout tcFolder = layout.createFolder("bottomLeft", IPageLayout.BOTTOM, (float)0.50, "left");
27     tcFolder.addView(ConfigViewPart.ID_CONFIG_VIEW_PART);
28     tcFolder.addView(BootJarView.ID_BOOTJAR_VIEW_PART);
29     
30     IFolderLayout outputfolder= layout.createFolder("bottom", IPageLayout.BOTTOM, (float)0.75, editorArea); //$NON-NLS-1$
31
outputfolder.addView(IPageLayout.ID_PROBLEM_VIEW);
32     outputfolder.addView(JavaUI.ID_JAVADOC_VIEW);
33     outputfolder.addView(JavaUI.ID_SOURCE_VIEW);
34     outputfolder.addPlaceholder(NewSearchUI.SEARCH_VIEW_ID);
35     outputfolder.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW);
36     outputfolder.addPlaceholder(IPageLayout.ID_BOOKMARKS);
37     outputfolder.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID);
38     
39     layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.RIGHT, (float)0.75, editorArea);
40     
41     layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
42     layout.addActionSet(JavaUI.ID_ACTION_SET);
43     layout.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET);
44     layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET);
45     
46     // views - java
47
layout.addShowViewShortcut(JavaUI.ID_PACKAGES);
48     layout.addShowViewShortcut(JavaUI.ID_TYPE_HIERARCHY);
49     layout.addShowViewShortcut(JavaUI.ID_SOURCE_VIEW);
50     layout.addShowViewShortcut(JavaUI.ID_JAVADOC_VIEW);
51
52     // views - search
53
layout.addShowViewShortcut(NewSearchUI.SEARCH_VIEW_ID);
54     
55     // views - debugging
56
layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW);
57
58     // views - standard workbench
59
layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
60     layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
61     layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
62     layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
63     layout.addShowViewShortcut(IProgressConstants.PROGRESS_VIEW_ID);
64         
65     // new actions - Java project creation wizard
66
layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"); //$NON-NLS-1$
67
layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewClassCreationWizard"); //$NON-NLS-1$
68
layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard"); //$NON-NLS-1$
69
layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewEnumCreationWizard"); //$NON-NLS-1$
70
layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard"); //$NON-NLS-1$
71
layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard"); //$NON-NLS-1$
72
layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard"); //$NON-NLS-1$
73
layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$
74
layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$
75
layout.addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTextFileWizard");//$NON-NLS-1$
76
}
77 }
78
Popular Tags