Add a "Clear Tracing Views" command
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / TracingPerspectiveFactory.java
1 /*******************************************************************************
2 * Copyright (c) 2010, 2011, 2012 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.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;
22
23 /**
24 * The tracing perspective definition.
25 *
26 * @version 1.0
27 * @author Francois Chouinard
28 */
29 public class TracingPerspectiveFactory implements IPerspectiveFactory {
30
31 // ------------------------------------------------------------------------
32 // Constants
33 // ------------------------------------------------------------------------
34
35 /** The Perspective ID */
36 public static final String ID = "org.eclipse.linuxtools.tmf.ui.perspective"; //$NON-NLS-1$
37
38 // Standard TMF views
39 private static final String EVENTS_VIEW_ID = TmfEventsView.ID;
40 private static final String HISTOGRAM_VIEW_ID = HistogramView.ID;
41
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;
47
48
49 // ------------------------------------------------------------------------
50 // IPerspectiveFactory
51 // ------------------------------------------------------------------------
52
53 @Override
54 public void createInitialLayout(IPageLayout layout) {
55
56 // No editor part
57 layout.setEditorAreaVisible(false);
58
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);
63
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);
68
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);
73
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);
80
81 // Populate menus, etc
82 layout.addPerspectiveShortcut(ID);
83 layout.addNewWizardShortcut(NewTmfProjectWizard.ID);
84 }
85
86 }
This page took 0.035335 seconds and 5 git commands to generate.