KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > editor2d > perspective > EditorPerspective


1 /**
2  * <p> Project: com.nightlabs.editor2d </p>
3  * <p> Copyright: Copyright (c) 2004 </p>
4  * <p> Company: NightLabs GmbH (Germany) </p>
5  * <p> Creation Date: 16.11.2004 </p>
6  * <p> Author: Daniel Mazurek </p>
7 **/

8 package com.nightlabs.editor2d.perspective;
9
10 import org.eclipse.gef.ui.views.palette.PaletteView;
11 import org.eclipse.ui.IFolderLayout;
12 import org.eclipse.ui.IPageLayout;
13 import org.eclipse.ui.IPerspectiveFactory;
14
15 import com.nightlabs.editor2d.views.LayerView;
16
17 public class EditorPerspective
18 implements IPerspectiveFactory
19 {
20   public static final String JavaDoc ID_PERSPECTIVE = EditorPerspective.class.getName();
21   
22   /* (non-Javadoc)
23    * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
24    */

25   public void createInitialLayout(IPageLayout layout)
26   {
27 // layout.setEditorAreaVisible(true);
28
// String editorArea = layout.getEditorArea();
29
// layout.addView(IPageLayout.ID_EDITOR_AREA, IPageLayout.TOP, IPageLayout.RATIO_MAX, IPageLayout.ID_EDITOR_AREA);
30
// layout.addView(IPageLayout.ID_RES_NAV, IPageLayout.LEFT, 0.25f, IPageLayout.ID_EDITOR_AREA);
31
// layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.LEFT, 0.25f, IPageLayout.ID_EDITOR_AREA);
32
// layout.addView(IPageLayout.ID_PROP_SHEET, IPageLayout.BOTTOM, 0.25f, IPageLayout.ID_EDITOR_AREA);
33
// layout.addView(LayerView.ID_VIEW, IPageLayout.RIGHT, 0.25f, IPageLayout.ID_EDITOR_AREA);
34
// layout.addView(PaletteView.ID, IPageLayout.RIGHT, 0.25f, IPageLayout.ID_EDITOR_AREA);
35
// layout.addPerspectiveShortcut(ID_PERSPECTIVE);
36

37     layout.setEditorAreaVisible(true);
38     String JavaDoc editorArea = layout.getEditorArea();
39     layout.addView(IPageLayout.ID_EDITOR_AREA, IPageLayout.TOP, IPageLayout.RATIO_MAX, editorArea);
40     
41     IFolderLayout topLeft = layout.createFolder("topLeft", IPageLayout.LEFT, 0.15f, editorArea);
42     topLeft.addView(IPageLayout.ID_RES_NAV);
43     IFolderLayout bottomLeft = layout.createFolder("bottomLeft", IPageLayout.BOTTOM, 0.5f, "topLeft");
44     bottomLeft.addView(IPageLayout.ID_OUTLINE);
45 // bottomLeft.addView(IPageLayout.ID_PROP_SHEET);
46
IFolderLayout bottom = layout.createFolder("bottom", IPageLayout.BOTTOM, 0.75f, editorArea);
47     bottom.addView(IPageLayout.ID_PROP_SHEET);
48     IFolderLayout topRight = layout.createFolder("topRight", IPageLayout.RIGHT, 0.75f, editorArea);
49     topRight.addView(PaletteView.ID);
50     IFolderLayout bottomRight = layout.createFolder("bottomRight", IPageLayout.BOTTOM, 0.5f, "topRight");
51     bottomRight.addView(LayerView.ID_VIEW);
52     bottomRight.addView("org.eclipse.gef.ui.stackview.CommandStackInspector");
53            
54     layout.addPerspectiveShortcut(ID_PERSPECTIVE);
55   }
56 }
57
Popular Tags