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