01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package org.terracotta.dso;
05:
06: import org.eclipse.debug.ui.IDebugUIConstants;
07: import org.eclipse.jdt.ui.JavaUI;
08: import org.eclipse.search.ui.NewSearchUI;
09: 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 editorArea = layout.getEditorArea();
20:
21: IFolderLayout folder = layout.createFolder(
22: "left", IPageLayout.LEFT, (float) 0.25, editorArea); //$NON-NLS-1$
23: folder.addView(JavaUI.ID_PACKAGES);
24: folder.addView(JavaUI.ID_TYPE_HIERARCHY);
25: folder.addPlaceholder(IPageLayout.ID_RES_NAV);
26:
27: IFolderLayout tcFolder = layout.createFolder("bottomLeft",
28: IPageLayout.BOTTOM, (float) 0.50, "left");
29: tcFolder.addView(ConfigViewPart.ID_CONFIG_VIEW_PART);
30: tcFolder.addView(BootJarView.ID_BOOTJAR_VIEW_PART);
31:
32: IFolderLayout outputfolder = layout.createFolder(
33: "bottom", IPageLayout.BOTTOM, (float) 0.75, editorArea); //$NON-NLS-1$
34: outputfolder.addView(IPageLayout.ID_PROBLEM_VIEW);
35: outputfolder.addView(JavaUI.ID_JAVADOC_VIEW);
36: outputfolder.addView(JavaUI.ID_SOURCE_VIEW);
37: outputfolder.addPlaceholder(NewSearchUI.SEARCH_VIEW_ID);
38: outputfolder.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW);
39: outputfolder.addPlaceholder(IPageLayout.ID_BOOKMARKS);
40: outputfolder
41: .addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID);
42:
43: layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.RIGHT,
44: (float) 0.75, editorArea);
45:
46: layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
47: layout.addActionSet(JavaUI.ID_ACTION_SET);
48: layout.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET);
49: layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET);
50:
51: // views - java
52: layout.addShowViewShortcut(JavaUI.ID_PACKAGES);
53: layout.addShowViewShortcut(JavaUI.ID_TYPE_HIERARCHY);
54: layout.addShowViewShortcut(JavaUI.ID_SOURCE_VIEW);
55: layout.addShowViewShortcut(JavaUI.ID_JAVADOC_VIEW);
56:
57: // views - search
58: layout.addShowViewShortcut(NewSearchUI.SEARCH_VIEW_ID);
59:
60: // views - debugging
61: layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW);
62:
63: // views - standard workbench
64: layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
65: layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
66: layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
67: layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
68: layout.addShowViewShortcut(IProgressConstants.PROGRESS_VIEW_ID);
69:
70: // new actions - Java project creation wizard
71: layout
72: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"); //$NON-NLS-1$
73: layout
74: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewClassCreationWizard"); //$NON-NLS-1$
75: layout
76: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard"); //$NON-NLS-1$
77: layout
78: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewEnumCreationWizard"); //$NON-NLS-1$
79: layout
80: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard"); //$NON-NLS-1$
81: layout
82: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard"); //$NON-NLS-1$
83: layout
84: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard"); //$NON-NLS-1$
85: layout
86: .addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$
87: layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$
88: layout
89: .addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTextFileWizard");//$NON-NLS-1$
90: }
91: }
|