KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nightlabs > editor2d > EditorPerspective


1 /* *****************************************************************************
2  * NightLabs Editor2D - Graphical editor framework *
3  * Copyright (C) 2004-2005 NightLabs - http://NightLabs.org *
4  * *
5  * This library is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Lesser General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2.1 of the License, or (at your option) any later version. *
9  * *
10  * This library is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13  * Lesser General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU Lesser General Public *
16  * License along with this library; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin St, Fifth Floor, *
19  * Boston, MA 02110-1301 USA *
20  * *
21  * Or get it online : *
22  * http://www.gnu.org/copyleft/lesser.html *
23  * *
24  * *
25  ******************************************************************************/

26 package org.nightlabs.editor2d;
27
28 import org.eclipse.ui.IFolderLayout;
29 import org.eclipse.ui.IPageLayout;
30 import org.eclipse.ui.IPerspectiveFactory;
31 import org.nightlabs.editor2d.views.LayerView;
32 import org.nightlabs.editor2d.views.QuickOptionsView;
33
34 /**
35  * <p> Author: Daniel.Mazurek[AT]NightLabs[DOT]de </p>
36  */

37 public class EditorPerspective
38 implements IPerspectiveFactory
39 {
40     public static final String JavaDoc ID_PERSPECTIVE = EditorPerspective.class.getName();
41     
42     public EditorPerspective() {
43         super();
44     }
45
46     /**
47      * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
48      */

49     public void createInitialLayout(IPageLayout layout)
50     {
51     layout.setEditorAreaVisible(true);
52     String JavaDoc editorArea = layout.getEditorArea();
53     layout.addView(IPageLayout.ID_EDITOR_AREA, IPageLayout.TOP, IPageLayout.RATIO_MAX, editorArea);
54     
55     IFolderLayout rightTop = layout.createFolder("rightTop", IPageLayout.RIGHT, 0.75f, editorArea);
56     rightTop.addView(IPageLayout.ID_PROP_SHEET);
57     IFolderLayout rightMiddle = layout.createFolder("rightMiddle", IPageLayout.BOTTOM, 0.33f, "rightTop");
58     rightMiddle.addView(IPageLayout.ID_OUTLINE);
59     IFolderLayout rightBottom = layout.createFolder("rightBottom", IPageLayout.BOTTOM, 0.5f, "rightMiddle");
60     rightBottom.addView(LayerView.ID_VIEW);
61     rightBottom.addView(QuickOptionsView.ID);
62                
63     layout.addPerspectiveShortcut(ID_PERSPECTIVE);
64     layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET);
65     layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
66     layout.addShowViewShortcut(LayerView.ID_VIEW);
67     layout.addShowViewShortcut(QuickOptionsView.ID);
68     }
69
70 }
71
Popular Tags