1 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 37 public class EditorPerspective 38 implements IPerspectiveFactory 39 { 40 public static final String ID_PERSPECTIVE = EditorPerspective.class.getName(); 41 42 public EditorPerspective() { 43 super(); 44 } 45 46 49 public void createInitialLayout(IPageLayout layout) 50 { 51 layout.setEditorAreaVisible(true); 52 String 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 |