1
package org.python.pydev.ui.perspective;
3
import org.eclipse.debug.ui.IDebugUIConstants;
4
import org.eclipse.search.ui.NewSearchUI;
5
import org.eclipse.ui.IFolderLayout;
6
import org.eclipse.ui.IPageLayout;
7
import org.eclipse.ui.IPerspectiveFactory;
8
import org.eclipse.ui.console.IConsoleConstants;
9
import org.eclipse.ui.progress.IProgressConstants;
10
import org.python.pydev.ui.wizards.files.PythonModuleWizard;
11
import org.python.pydev.ui.wizards.files.PythonPackageWizard;
12
import org.python.pydev.ui.wizards.files.PythonSourceFolderWizard;
13
import org.python.pydev.ui.wizards.project.PythonProjectWizard;
16
* Python perspective constructor
18
* @author Mikko Ohtamaa
20
public class PythonPerspectiveFactory implements IPerspectiveFactory {
22
public static final String PERSPECTIVE_ID = "org.python.pydev.ui.PythonPerspective";
25
* Creates Python perspective layout
27
* Copied from org.eclipse.jdt.internal.ui.JavaPerspectiveFactory
29
public void createInitialLayout(IPageLayout layout) {
31
defineActions(layout);
40
public void defineLayout(IPageLayout layout) {
41
String editorArea = layout.getEditorArea();
42
IFolderLayout topLeft = layout.createFolder("topLeft", IPageLayout.LEFT, (float)0.26, editorArea); //$NON-NLS-1$
43
topLeft.addView(IPageLayout.ID_RES_NAV);
47
IFolderLayout outputfolder= layout.createFolder("bottom", IPageLayout.BOTTOM, (float)0.75, editorArea); //$NON-NLS-1$
48
outputfolder.addView(IPageLayout.ID_PROBLEM_VIEW);
49
outputfolder.addPlaceholder(NewSearchUI.SEARCH_VIEW_ID);
50
outputfolder.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW);
51
outputfolder.addPlaceholder(IPageLayout.ID_BOOKMARKS);
52
outputfolder.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID);
54
layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.RIGHT, (float)0.75, editorArea);
60
public void defineActions(IPageLayout layout) {
61
layout.addNewWizardShortcut(PythonProjectWizard.WIZARD_ID); //$NON-NLS-1$
62
layout.addNewWizardShortcut(PythonSourceFolderWizard.WIZARD_ID); //$NON-NLS-1$
63
layout.addNewWizardShortcut(PythonPackageWizard.WIZARD_ID); //$NON-NLS-1$
64
layout.addNewWizardShortcut(PythonModuleWizard.WIZARD_ID); //$NON-NLS-1$
65
layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$
66
layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$
67
layout.addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTextFileWizard");//$NON-NLS-1$
69
layout.addShowViewShortcut(NewSearchUI.SEARCH_VIEW_ID);
70
layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW);
71
layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
72
layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
73
layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
74
layout.addShowViewShortcut("org.eclipse.pde.runtime.LogView");
75
layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
76
layout.addShowViewShortcut("org.python.pydev.views.PyRefactorView");
77
layout.addShowViewShortcut("org.python.pydev.views.PyCodeCoverageView");
79
layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
80
layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET);
82
layout.addShowInPart(IPageLayout.ID_RES_NAV);