1 /*******************************************************************************
2 * Copyright (c) 2010, 2014 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
.tracecompass
.tmf
.ui
.views
;
15 import org
.eclipse
.tracecompass
.tmf
.ui
.project
.wizards
.NewTmfProjectWizard
;
16 import org
.eclipse
.tracecompass
.tmf
.ui
.views
.histogram
.HistogramView
;
17 import org
.eclipse
.tracecompass
.tmf
.ui
.views
.statistics
.TmfStatisticsView
;
18 import org
.eclipse
.ui
.IFolderLayout
;
19 import org
.eclipse
.ui
.IPageLayout
;
20 import org
.eclipse
.ui
.IPerspectiveFactory
;
23 * The tracing perspective definition.
26 * @author Francois Chouinard
28 public class TracingPerspectiveFactory
implements IPerspectiveFactory
{
30 // ------------------------------------------------------------------------
32 // ------------------------------------------------------------------------
34 /** The Perspective ID */
35 public static final String ID
= "org.eclipse.linuxtools.tmf.ui.perspective"; //$NON-NLS-1$
38 private static final String HISTOGRAM_VIEW_ID
= HistogramView
.ID
;
40 // Standard Eclipse views
41 private static final String PROJECT_VIEW_ID
= IPageLayout
.ID_PROJECT_EXPLORER
;
42 private static final String STATISTICS_VIEW_ID
= TmfStatisticsView
.ID
;
43 private static final String PROPERTIES_VIEW_ID
= IPageLayout
.ID_PROP_SHEET
;
44 private static final String BOOKMARKS_VIEW_ID
= IPageLayout
.ID_BOOKMARKS
;
47 // ------------------------------------------------------------------------
48 // IPerspectiveFactory
49 // ------------------------------------------------------------------------
52 public void createInitialLayout(IPageLayout layout
) {
55 layout
.setEditorAreaVisible(true);
57 // Create the top left folder
58 IFolderLayout topLeftFolder
= layout
.createFolder(
59 "topLeftFolder", IPageLayout
.LEFT
, 0.15f
, IPageLayout
.ID_EDITOR_AREA
); //$NON-NLS-1$
60 topLeftFolder
.addView(PROJECT_VIEW_ID
);
62 // Create the middle right folder
63 IFolderLayout middleRightFolder
= layout
.createFolder(
64 "middleRightFolder", IPageLayout
.BOTTOM
, 0.50f
, IPageLayout
.ID_EDITOR_AREA
); //$NON-NLS-1$
65 middleRightFolder
.addView(STATISTICS_VIEW_ID
);
67 // Create the bottom right folder
68 IFolderLayout bottomRightFolder
= layout
.createFolder(
69 "bottomRightFolder", IPageLayout
.BOTTOM
, 0.55f
, "middleRightFolder"); //$NON-NLS-1$ //$NON-NLS-2$
70 bottomRightFolder
.addView(HISTOGRAM_VIEW_ID
);
71 bottomRightFolder
.addView(PROPERTIES_VIEW_ID
);
72 bottomRightFolder
.addView(BOOKMARKS_VIEW_ID
);
74 // Populate menus, etc
75 layout
.addPerspectiveShortcut(ID
);
76 layout
.addNewWizardShortcut(NewTmfProjectWizard
.ID
);