avoid "console==null" problems
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / PHPPerspectiveFactory.java
1 package net.sourceforge.phpeclipse;
2
3 import org.eclipse.debug.ui.IDebugUIConstants;
4 import org.eclipse.ui.IFolderLayout;
5 import org.eclipse.ui.IPageLayout;
6 import org.eclipse.ui.IPerspectiveFactory;
7
8 public class PHPPerspectiveFactory implements IPerspectiveFactory {
9
10   public PHPPerspectiveFactory() {
11     super();
12   }
13
14   public void createInitialLayout(IPageLayout layout) {
15     String editorArea = layout.getEditorArea();
16
17     //          IFolderLayout phpResourcesArea = layout.createFolder("phpresourcesarea", IPageLayout.LEFT, (float)0.25, editorArea);
18     //          phpResourcesArea.addView(PHPeclipsePlugin.PHP_RESOURCES_VIEW_ID);
19     IFolderLayout folder = layout.createFolder("left", IPageLayout.LEFT, (float) 0.25, editorArea); //$NON-NLS-1$
20     folder.addView(IPageLayout.ID_RES_NAV);
21     folder.addPlaceholder(IPageLayout.ID_RES_NAV);
22
23     IFolderLayout consoleArea = layout.createFolder("consoleArea", IPageLayout.BOTTOM, (float) 0.75, editorArea);
24
25     consoleArea.addView(IPageLayout.ID_TASK_LIST);
26     consoleArea.addView(IDebugUIConstants.ID_CONSOLE_VIEW);
27     consoleArea.addView(IPageLayout.ID_BOOKMARKS);
28
29     layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.RIGHT, (float) 0.75, editorArea);
30
31     layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
32         layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET);
33         layout.addActionSet(PHPeclipsePlugin.PHP_CODING_ACTION_SET_ID);
34         
35     layout.addShowViewShortcut(IDebugUIConstants.ID_CONSOLE_VIEW);
36
37    // layout.addShowViewShortcut(PHPeclipsePlugin.PHP_RESOURCES_VIEW_ID);
38         
39     // views - standard workbench
40     layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
41     layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
42     layout.addShowViewShortcut(IPageLayout.ID_BOOKMARKS);
43
44     // new actions - PHP project creation wizards
45     layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder"); //$NON-NLS-1$
46     layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file"); //$NON-NLS-1$
47   }
48
49 }