1 /*******************************************************************************
2 * Copyright (c) 2012, 2013 Ericsson
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
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.ui
.views
;
15 import org
.eclipse
.linuxtools
.internal
.lttng2
.control
.ui
.views
.ControlView
;
16 import org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.ui
.views
.controlflow
.ControlFlowView
;
17 import org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.ui
.views
.resources
.ResourcesView
;
18 import org
.eclipse
.tracecompass
.tmf
.ui
.project
.wizards
.NewTmfProjectWizard
;
19 import org
.eclipse
.tracecompass
.tmf
.ui
.views
.histogram
.HistogramView
;
20 import org
.eclipse
.tracecompass
.tmf
.ui
.views
.statistics
.TmfStatisticsView
;
21 import org
.eclipse
.ui
.IFolderLayout
;
22 import org
.eclipse
.ui
.IPageLayout
;
23 import org
.eclipse
.ui
.IPerspectiveFactory
;
26 * The default LTTng perspective.
28 public class PerspectiveFactory
implements IPerspectiveFactory
{
31 public static final String ID
= "org.eclipse.linuxtools.lttng2.kernel.ui.perspective"; //$NON-NLS-1$
34 private static final String HISTOGRAM_VIEW_ID
= HistogramView
.ID
;
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
;
38 private static final String STATISTICS_VIEW_ID
= TmfStatisticsView
.ID
;
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
;
46 public void createInitialLayout(IPageLayout layout
) {
48 layout
.setEditorAreaVisible(true);
51 addViewShortcuts(layout
);
52 addPerspectiveShortcuts(layout
);
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
);
59 // Create the bottom left folder
60 IFolderLayout bottomLeftFolder
= layout
.createFolder(
61 "bottomLeftFolder", IPageLayout
.BOTTOM
, 0.70f
, "topLeftFolder"); //$NON-NLS-1$ //$NON-NLS-2$
62 bottomLeftFolder
.addView(CONTROL_VIEW_ID
);
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
);
69 topRightFolder
.addView(STATISTICS_VIEW_ID
);
71 // Create the bottom right folder
72 IFolderLayout bottomRightFolder
= layout
.createFolder(
73 "bottomRightFolder", IPageLayout
.BOTTOM
, 0.50f
, IPageLayout
.ID_EDITOR_AREA
); //$NON-NLS-1$
74 bottomRightFolder
.addView(HISTOGRAM_VIEW_ID
);
75 bottomRightFolder
.addView(PROPERTIES_VIEW_ID
);
76 bottomRightFolder
.addView(BOOKMARKS_VIEW_ID
);
78 layout
.addNewWizardShortcut(NewTmfProjectWizard
.ID
);
82 * Add fast views to the perspective
86 private void addFastViews(IPageLayout layout
) {
90 * Add view shortcuts to the perspective
94 private void addViewShortcuts(IPageLayout layout
) {
98 * Add perspective shortcuts to the perspective
102 private void addPerspectiveShortcuts(IPageLayout layout
) {