Commit | Line | Data |
---|---|---|
12c155f5 FC |
1 | /******************************************************************************* |
2 | * Copyright (c) 2010, 2011 Ericsson | |
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 | /** | |
23 | * <b><u>TracingPerspectiveFactory</u></b> | |
24 | * <p> | |
25 | * TODO: Implement me. Please. | |
26 | */ | |
27 | public class TracingPerspectiveFactory implements IPerspectiveFactory { | |
28 | ||
29 | // ------------------------------------------------------------------------ | |
30 | // Constants | |
31 | // ------------------------------------------------------------------------ | |
32 | ||
33 | // Perspective ID | |
34 | public static final String ID = "org.eclipse.linuxtools.tmf.ui.perspective.tracing"; //$NON-NLS-1$ | |
35 | ||
36 | // Standard TMF views | |
37 | private static final String EVENTS_VIEW_ID = TmfEventsView.ID; | |
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 FC |
45 | |
46 | // ------------------------------------------------------------------------ | |
47 | // IPerspectiveFactory | |
48 | // ------------------------------------------------------------------------ | |
49 | ||
50 | @Override | |
51 | public void createInitialLayout(IPageLayout layout) { | |
52 | ||
53 | // No editor part | |
54 | layout.setEditorAreaVisible(false); | |
55 | ||
56 | // Goodies | |
57 | addFastViews(layout); | |
58 | addViewShortcuts(layout); | |
59 | addPerspectiveShortcuts(layout); | |
60 | ||
61 | // Create the top left folder | |
62 | IFolderLayout topLeftFolder = layout.createFolder( | |
63 | "topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ | |
64 | topLeftFolder.addView(PROJECT_VIEW_ID); | |
65 | ||
66 | // // Create the bottom left folder | |
67 | // @SuppressWarnings("unused") | |
68 | // IFolderLayout bottomLeftFolder = layout.createFolder( | |
69 | // "bottomLeftFolder", IPageLayout.BOTTOM, 0.50f, "topLeftFolder"); //$NON-NLS-1$//$NON-NLS-2$ | |
70 | ||
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 | } |