1 /*******************************************************************************
2 * Copyright (c) 2010, 2011, 2012 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
.tmf
.ui
.views
;
15 import org
.eclipse
.linuxtools
.tmf
.ui
.project
.wizards
.NewTmfProjectWizard
;
16 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.events
.TmfEventsView
;
17 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.histogram
.HistogramView
;
18 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.statistics
.TmfStatisticsView
;
19 import org
.eclipse
.ui
.IFolderLayout
;
20 import org
.eclipse
.ui
.IPageLayout
;
21 import org
.eclipse
.ui
.IPerspectiveFactory
;
24 * The tracing perspective definition.
27 * @author Francois Chouinard
29 public class TracingPerspectiveFactory
implements IPerspectiveFactory
{
31 // ------------------------------------------------------------------------
33 // ------------------------------------------------------------------------
35 /** The Perspective ID */
36 public static final String ID
= "org.eclipse.linuxtools.tmf.ui.perspective"; //$NON-NLS-1$
39 private static final String EVENTS_VIEW_ID
= TmfEventsView
.ID
;
40 private static final String HISTOGRAM_VIEW_ID
= HistogramView
.ID
;
42 // Standard Eclipse views
43 private static final String PROJECT_VIEW_ID
= IPageLayout
.ID_PROJECT_EXPLORER
;
44 private static final String STATISTICS_VIEW_ID
= TmfStatisticsView
.ID
;
45 private static final String PROPERTIES_VIEW_ID
= IPageLayout
.ID_PROP_SHEET
;
46 private static final String BOOKMARKS_VIEW_ID
= IPageLayout
.ID_BOOKMARKS
;
49 // ------------------------------------------------------------------------
50 // IPerspectiveFactory
51 // ------------------------------------------------------------------------
54 public void createInitialLayout(IPageLayout layout
) {
57 layout
.setEditorAreaVisible(false);
59 // Create the top left folder
60 IFolderLayout topLeftFolder
= layout
.createFolder(
61 "topLeftFolder", IPageLayout
.LEFT
, 0.15f
, IPageLayout
.ID_EDITOR_AREA
); //$NON-NLS-1$
62 topLeftFolder
.addView(PROJECT_VIEW_ID
);
64 // Create the top right folder
65 IFolderLayout topRightFolder
= layout
.createFolder(
66 "topRightFolder", IPageLayout
.TOP
, 0.50f
, IPageLayout
.ID_EDITOR_AREA
); //$NON-NLS-1$
67 topRightFolder
.addView(EVENTS_VIEW_ID
);
69 // Create the middle right folder
70 IFolderLayout middleRightFolder
= layout
.createFolder(
71 "middleRightFolder", IPageLayout
.BOTTOM
, 0.50f
, "topRightFolder"); //$NON-NLS-1$//$NON-NLS-2$
72 middleRightFolder
.addView(STATISTICS_VIEW_ID
);
74 // Create the bottom right folder
75 IFolderLayout bottomRightFolder
= layout
.createFolder(
76 "bottomRightFolder", IPageLayout
.BOTTOM
, 0.55f
, "middleRightFolder"); //$NON-NLS-1$ //$NON-NLS-2$
77 bottomRightFolder
.addView(HISTOGRAM_VIEW_ID
);
78 bottomRightFolder
.addView(PROPERTIES_VIEW_ID
);
79 bottomRightFolder
.addView(BOOKMARKS_VIEW_ID
);
81 // Populate menus, etc
82 layout
.addPerspectiveShortcut(ID
);
83 layout
.addNewWizardShortcut(NewTmfProjectWizard
.ID
);