Commit | Line | Data |
---|---|---|
12c155f5 | 1 | /******************************************************************************* |
2f2265e2 | 2 | * Copyright (c) 2010, 2011, 2012 Ericsson |
ea279a69 | 3 | * |
12c155f5 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 | |
013a5f1c | 8 | * |
12c155f5 FC |
9 | * Contributors: |
10 | * Francois Chouinard - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
13 | package org.eclipse.linuxtools.tmf.ui.views; | |
14 | ||
ea279a69 | 15 | import org.eclipse.linuxtools.tmf.ui.project.wizards.NewTmfProjectWizard; |
17dec5cc FC |
16 | import org.eclipse.linuxtools.tmf.ui.views.histogram.HistogramView; |
17 | import org.eclipse.linuxtools.tmf.ui.views.statistics.TmfStatisticsView; | |
12c155f5 FC |
18 | import org.eclipse.ui.IFolderLayout; |
19 | import org.eclipse.ui.IPageLayout; | |
20 | import org.eclipse.ui.IPerspectiveFactory; | |
21 | ||
22 | /** | |
2f2265e2 | 23 | * The tracing perspective definition. |
ea279a69 | 24 | * |
2f2265e2 BH |
25 | * @version 1.0 |
26 | * @author Francois Chouinard | |
12c155f5 FC |
27 | */ |
28 | public class TracingPerspectiveFactory implements IPerspectiveFactory { | |
29 | ||
30 | // ------------------------------------------------------------------------ | |
31 | // Constants | |
32 | // ------------------------------------------------------------------------ | |
33 | ||
013a5f1c | 34 | /** The Perspective ID */ |
ea279a69 | 35 | public static final String ID = "org.eclipse.linuxtools.tmf.ui.perspective"; //$NON-NLS-1$ |
12c155f5 FC |
36 | |
37 | // Standard TMF views | |
17dec5cc | 38 | private static final String HISTOGRAM_VIEW_ID = HistogramView.ID; |
12c155f5 FC |
39 | |
40 | // Standard Eclipse views | |
41 | private static final String PROJECT_VIEW_ID = IPageLayout.ID_PROJECT_EXPLORER; | |
17dec5cc | 42 | private static final String STATISTICS_VIEW_ID = TmfStatisticsView.ID; |
12c155f5 | 43 | private static final String PROPERTIES_VIEW_ID = IPageLayout.ID_PROP_SHEET; |
17dec5cc | 44 | private static final String BOOKMARKS_VIEW_ID = IPageLayout.ID_BOOKMARKS; |
12c155f5 | 45 | |
2f2265e2 | 46 | |
12c155f5 FC |
47 | // ------------------------------------------------------------------------ |
48 | // IPerspectiveFactory | |
49 | // ------------------------------------------------------------------------ | |
50 | ||
51 | @Override | |
52 | public void createInitialLayout(IPageLayout layout) { | |
53 | ||
faa38350 PT |
54 | // Editor area |
55 | layout.setEditorAreaVisible(true); | |
12c155f5 | 56 | |
12c155f5 FC |
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); | |
61 | ||
12c155f5 | 62 | // Create the middle right folder |
12c155f5 | 63 | IFolderLayout middleRightFolder = layout.createFolder( |
faa38350 | 64 | "middleRightFolder", IPageLayout.BOTTOM, 0.50f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ |
17dec5cc | 65 | middleRightFolder.addView(STATISTICS_VIEW_ID); |
12c155f5 FC |
66 | |
67 | // Create the bottom right folder | |
68 | IFolderLayout bottomRightFolder = layout.createFolder( | |
ea279a69 | 69 | "bottomRightFolder", IPageLayout.BOTTOM, 0.55f, "middleRightFolder"); //$NON-NLS-1$ //$NON-NLS-2$ |
17dec5cc | 70 | bottomRightFolder.addView(HISTOGRAM_VIEW_ID); |
12c155f5 | 71 | bottomRightFolder.addView(PROPERTIES_VIEW_ID); |
17dec5cc | 72 | bottomRightFolder.addView(BOOKMARKS_VIEW_ID); |
12c155f5 | 73 | |
ea279a69 FC |
74 | // Populate menus, etc |
75 | layout.addPerspectiveShortcut(ID); | |
76 | layout.addNewWizardShortcut(NewTmfProjectWizard.ID); | |
12c155f5 FC |
77 | } |
78 | ||
79 | } |