Commit | Line | Data |
---|---|---|
a7780cc8 | 1 | /******************************************************************************* |
11252342 | 2 | * Copyright (c) 2012, 2013 Ericsson |
27f3a03d | 3 | * |
a7780cc8 FC |
4 | * All rights reserved. This program and the accompanying materials are |
5 | * made available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
27f3a03d | 8 | * |
a7780cc8 FC |
9 | * Contributors: |
10 | * Francois Chouinard - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
04835162 | 13 | package org.eclipse.linuxtools.internal.lttng2.kernel.ui.views; |
a7780cc8 | 14 | |
8e8c0226 | 15 | import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView; |
04835162 PT |
16 | import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.controlflow.ControlFlowView; |
17 | import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources.ResourcesView; | |
ecf3bc29 | 18 | import org.eclipse.linuxtools.tmf.ui.project.wizards.NewTmfProjectWizard; |
a7780cc8 | 19 | import org.eclipse.linuxtools.tmf.ui.views.histogram.HistogramView; |
17dec5cc | 20 | import org.eclipse.linuxtools.tmf.ui.views.statistics.TmfStatisticsView; |
a7780cc8 FC |
21 | import org.eclipse.ui.IFolderLayout; |
22 | import org.eclipse.ui.IPageLayout; | |
23 | import org.eclipse.ui.IPerspectiveFactory; | |
24 | ||
25 | /** | |
a7780cc8 FC |
26 | * The default LTTng perspective. |
27 | */ | |
28 | public class PerspectiveFactory implements IPerspectiveFactory { | |
29 | ||
27f3a03d | 30 | /** Perspective ID */ |
664fa59c | 31 | public static final String ID = "org.eclipse.linuxtools.lttng2.kernel.ui.perspective"; //$NON-NLS-1$ |
a7780cc8 FC |
32 | |
33 | // LTTng views | |
a7780cc8 | 34 | private static final String HISTOGRAM_VIEW_ID = HistogramView.ID; |
04835162 PT |
35 | private static final String CONTROL_VIEW_ID = ControlView.ID; |
36 | private static final String CONTROLFLOW_VIEW_ID = ControlFlowView.ID; | |
37 | private static final String RESOURCES_VIEW_ID = ResourcesView.ID; | |
17dec5cc | 38 | private static final String STATISTICS_VIEW_ID = TmfStatisticsView.ID; |
a7780cc8 FC |
39 | |
40 | // Standard Eclipse views | |
41 | private static final String PROJECT_VIEW_ID = IPageLayout.ID_PROJECT_EXPLORER; | |
42 | private static final String PROPERTIES_VIEW_ID = IPageLayout.ID_PROP_SHEET; | |
43 | private static final String BOOKMARKS_VIEW_ID = IPageLayout.ID_BOOKMARKS; | |
44 | ||
a7780cc8 FC |
45 | @Override |
46 | public void createInitialLayout(IPageLayout layout) { | |
47 | ||
faa38350 | 48 | layout.setEditorAreaVisible(true); |
a7780cc8 FC |
49 | |
50 | addFastViews(layout); | |
51 | addViewShortcuts(layout); | |
52 | addPerspectiveShortcuts(layout); | |
53 | ||
54 | // Create the top left folder | |
55 | IFolderLayout topLeftFolder = layout.createFolder( | |
56 | "topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ | |
57 | topLeftFolder.addView(PROJECT_VIEW_ID); | |
17dec5cc FC |
58 | |
59 | // Create the bottom left folder | |
60 | IFolderLayout bottomLeftFolder = layout.createFolder( | |
96f4eb18 | 61 | "bottomLeftFolder", IPageLayout.BOTTOM, 0.70f, "topLeftFolder"); //$NON-NLS-1$ //$NON-NLS-2$ |
17dec5cc | 62 | bottomLeftFolder.addView(CONTROL_VIEW_ID); |
a7780cc8 | 63 | |
04835162 PT |
64 | // Create the top right folder |
65 | IFolderLayout topRightFolder = layout.createFolder( | |
66 | "topRightFolder", IPageLayout.TOP, 0.40f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ | |
67 | topRightFolder.addView(CONTROLFLOW_VIEW_ID); | |
68 | topRightFolder.addView(RESOURCES_VIEW_ID); | |
c5beb08d | 69 | topRightFolder.addView(STATISTICS_VIEW_ID); |
a7780cc8 | 70 | |
a7780cc8 FC |
71 | // Create the bottom right folder |
72 | IFolderLayout bottomRightFolder = layout.createFolder( | |
faa38350 | 73 | "bottomRightFolder", IPageLayout.BOTTOM, 0.50f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ |
a7780cc8 FC |
74 | bottomRightFolder.addView(HISTOGRAM_VIEW_ID); |
75 | bottomRightFolder.addView(PROPERTIES_VIEW_ID); | |
76 | bottomRightFolder.addView(BOOKMARKS_VIEW_ID); | |
ecf3bc29 MAL |
77 | |
78 | layout.addNewWizardShortcut(NewTmfProjectWizard.ID); | |
a7780cc8 FC |
79 | } |
80 | ||
81 | /** | |
82 | * Add fast views to the perspective | |
27f3a03d | 83 | * |
a7780cc8 FC |
84 | * @param layout |
85 | */ | |
86 | private void addFastViews(IPageLayout layout) { | |
a7780cc8 FC |
87 | } |
88 | ||
89 | /** | |
90 | * Add view shortcuts to the perspective | |
27f3a03d | 91 | * |
a7780cc8 FC |
92 | * @param layout |
93 | */ | |
94 | private void addViewShortcuts(IPageLayout layout) { | |
a7780cc8 FC |
95 | } |
96 | ||
97 | /** | |
98 | * Add perspective shortcuts to the perspective | |
27f3a03d | 99 | * |
a7780cc8 FC |
100 | * @param layout |
101 | */ | |
102 | private void addPerspectiveShortcuts(IPageLayout layout) { | |
a7780cc8 FC |
103 | } |
104 | ||
105 | } |