Commit | Line | Data |
---|---|---|
12c155f5 | 1 | /******************************************************************************* |
2f2265e2 | 2 | * Copyright (c) 2010, 2011, 2012 Ericsson |
12c155f5 FC |
3 | * |
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 | ||
15 | import org.eclipse.linuxtools.tmf.ui.views.events.TmfEventsView; | |
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 BH |
23 | * The tracing perspective definition. |
24 | * | |
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 */ |
12c155f5 FC |
35 | public static final String ID = "org.eclipse.linuxtools.tmf.ui.perspective.tracing"; //$NON-NLS-1$ |
36 | ||
37 | // Standard TMF views | |
38 | private static final String EVENTS_VIEW_ID = TmfEventsView.ID; | |
17dec5cc | 39 | private static final String HISTOGRAM_VIEW_ID = HistogramView.ID; |
12c155f5 FC |
40 | |
41 | // Standard Eclipse views | |
42 | private static final String PROJECT_VIEW_ID = IPageLayout.ID_PROJECT_EXPLORER; | |
17dec5cc | 43 | private static final String STATISTICS_VIEW_ID = TmfStatisticsView.ID; |
12c155f5 | 44 | private static final String PROPERTIES_VIEW_ID = IPageLayout.ID_PROP_SHEET; |
17dec5cc | 45 | private static final String BOOKMARKS_VIEW_ID = IPageLayout.ID_BOOKMARKS; |
12c155f5 | 46 | |
2f2265e2 | 47 | |
12c155f5 FC |
48 | // ------------------------------------------------------------------------ |
49 | // IPerspectiveFactory | |
50 | // ------------------------------------------------------------------------ | |
51 | ||
52 | @Override | |
53 | public void createInitialLayout(IPageLayout layout) { | |
54 | ||
55 | // No editor part | |
56 | layout.setEditorAreaVisible(false); | |
57 | ||
58 | // Goodies | |
59 | addFastViews(layout); | |
60 | addViewShortcuts(layout); | |
61 | addPerspectiveShortcuts(layout); | |
62 | ||
63 | // Create the top left folder | |
64 | IFolderLayout topLeftFolder = layout.createFolder( | |
65 | "topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ | |
66 | topLeftFolder.addView(PROJECT_VIEW_ID); | |
67 | ||
12c155f5 FC |
68 | // Create the top right folder |
69 | IFolderLayout topRightFolder = layout.createFolder( | |
17dec5cc | 70 | "topRightFolder", IPageLayout.TOP, 0.40f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ |
12c155f5 FC |
71 | topRightFolder.addView(EVENTS_VIEW_ID); |
72 | ||
73 | // Create the middle right folder | |
12c155f5 | 74 | IFolderLayout middleRightFolder = layout.createFolder( |
17dec5cc FC |
75 | "middleRightFolder", IPageLayout.BOTTOM, 0.40f, "topRightFolder"); //$NON-NLS-1$//$NON-NLS-2$ |
76 | middleRightFolder.addView(STATISTICS_VIEW_ID); | |
12c155f5 FC |
77 | |
78 | // Create the bottom right folder | |
79 | IFolderLayout bottomRightFolder = layout.createFolder( | |
17dec5cc FC |
80 | "bottomRightFolder", IPageLayout.BOTTOM, 0.50f, "middleRightFolder"); //$NON-NLS-1$ //$NON-NLS-2$ |
81 | bottomRightFolder.addView(HISTOGRAM_VIEW_ID); | |
12c155f5 | 82 | bottomRightFolder.addView(PROPERTIES_VIEW_ID); |
17dec5cc | 83 | bottomRightFolder.addView(BOOKMARKS_VIEW_ID); |
12c155f5 FC |
84 | } |
85 | ||
86 | // ------------------------------------------------------------------------ | |
87 | // Helper functions | |
88 | // ------------------------------------------------------------------------ | |
89 | ||
90 | private void addFastViews(IPageLayout layout) { | |
91 | } | |
92 | ||
93 | private void addViewShortcuts(IPageLayout layout) { | |
94 | } | |
95 | ||
96 | private void addPerspectiveShortcuts(IPageLayout layout) { | |
97 | } | |
98 | ||
99 | } |