~vil/pydev/upstream

« back to all changes in this revision

Viewing changes to org.python.pydev/src/org/python/pydev/ui/perspective/PythonPerspectiveFactory.java

  • Committer: Vladimír Lapáček
  • Date: 2006-08-30 18:38:44 UTC
  • Revision ID: vladimir.lapacek@gmail.com-20060830183844-f4d82c1239a7770a
Initial import of upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.python.pydev.ui.perspective;
 
2
 
 
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;
 
14
 
 
15
/**
 
16
 * Python perspective constructor
 
17
 * 
 
18
 * @author Mikko Ohtamaa
 
19
 */
 
20
public class PythonPerspectiveFactory implements IPerspectiveFactory {
 
21
        
 
22
        public static final String PERSPECTIVE_ID = "org.python.pydev.ui.PythonPerspective";
 
23
 
 
24
        /**
 
25
         * Creates Python perspective layout
 
26
         * 
 
27
         * Copied from org.eclipse.jdt.internal.ui.JavaPerspectiveFactory
 
28
         */
 
29
        public void createInitialLayout(IPageLayout layout) {
 
30
                defineLayout(layout);
 
31
                defineActions(layout);
 
32
        }
 
33
    
 
34
 
 
35
 
 
36
    /**
 
37
     * @param layout
 
38
     * @param editorArea
 
39
     */
 
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);
 
44
                
 
45
        
 
46
        
 
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);
 
53
                
 
54
                layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.RIGHT, (float)0.75, editorArea);
 
55
    }
 
56
 
 
57
    /**
 
58
     * @param layout
 
59
     */
 
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$
 
68
 
 
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");
 
78
        
 
79
        layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
 
80
        layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET);
 
81
                                
 
82
        layout.addShowInPart(IPageLayout.ID_RES_NAV);
 
83
    }
 
84
 
 
85
}