1 package io.github.magwas.inez.ui;
2
3 import org.eclipse.ui.IFolderLayout;
4 import org.eclipse.ui.IPageLayout;
5 import org.eclipse.ui.IPerspectiveFactory;
6 import org.eclipse.ui.IPlaceholderFolderLayout;
7
8 import io.github.magwas.inez.ui.editor.ModelEditorView;
9 import io.github.magwas.inez.ui.tree.TreeModelView;
10
11 public class Perspective implements IPerspectiveFactory {
12
13 public static final String ID = "io.github.magwas.inez.ui.perspective";
14
15 private static final String LEFT_TOP = "Left top";
16
17 private IFolderLayout folderLayoutLeftTop;
18 private IFolderLayout folderLayoutLeftBottom;
19 private IPlaceholderFolderLayout folderLayoutRight;
20 private IFolderLayout folderLayoutBottom;
21
22 @Override
23 public void createInitialLayout(IPageLayout layout) {
24 layout.setEditorAreaVisible(true);
25 layout.setFixed(true);
26
27 folderLayoutLeftTop = layout.createFolder(LEFT_TOP, IPageLayout.LEFT, .23f,
28 IPageLayout.ID_EDITOR_AREA);
29 folderLayoutLeftBottom = layout.createFolder("Left bottom",
30 IPageLayout.BOTTOM, .6f, LEFT_TOP);
31 folderLayoutRight = layout.createPlaceholderFolder("right",
32 IPageLayout.RIGHT, .85f, IPageLayout.ID_EDITOR_AREA);
33 folderLayoutBottom = layout.createFolder("bottom", IPageLayout.BOTTOM, .7f,
34 IPageLayout.ID_EDITOR_AREA);
35
36 folderLayoutLeftTop.addView(TreeModelView.ID);
37
38 folderLayoutBottom.addView(ModelEditorView.ID);
39
40
41
42
43
44
45
46
47 folderLayoutRight.addPlaceholder("org.eclipse.gef.ui.palette_view");
48
49
50 folderLayoutBottom.addPlaceholder("*");
51
52 }
53
54 }