Add a "Clear Tracing Views" command
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / TracingPerspectiveFactory.java
CommitLineData
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
13package org.eclipse.linuxtools.tmf.ui.views;
14
ea279a69 15import org.eclipse.linuxtools.tmf.ui.project.wizards.NewTmfProjectWizard;
12c155f5 16import org.eclipse.linuxtools.tmf.ui.views.events.TmfEventsView;
17dec5cc
FC
17import org.eclipse.linuxtools.tmf.ui.views.histogram.HistogramView;
18import org.eclipse.linuxtools.tmf.ui.views.statistics.TmfStatisticsView;
12c155f5
FC
19import org.eclipse.ui.IFolderLayout;
20import org.eclipse.ui.IPageLayout;
21import org.eclipse.ui.IPerspectiveFactory;
22
23/**
2f2265e2 24 * The tracing perspective definition.
ea279a69 25 *
2f2265e2
BH
26 * @version 1.0
27 * @author Francois Chouinard
12c155f5
FC
28 */
29public class TracingPerspectiveFactory implements IPerspectiveFactory {
30
31 // ------------------------------------------------------------------------
32 // Constants
33 // ------------------------------------------------------------------------
34
013a5f1c 35 /** The Perspective ID */
ea279a69 36 public static final String ID = "org.eclipse.linuxtools.tmf.ui.perspective"; //$NON-NLS-1$
12c155f5
FC
37
38 // Standard TMF views
39 private static final String EVENTS_VIEW_ID = TmfEventsView.ID;
17dec5cc 40 private static final String HISTOGRAM_VIEW_ID = HistogramView.ID;
12c155f5
FC
41
42 // Standard Eclipse views
43 private static final String PROJECT_VIEW_ID = IPageLayout.ID_PROJECT_EXPLORER;
17dec5cc 44 private static final String STATISTICS_VIEW_ID = TmfStatisticsView.ID;
12c155f5 45 private static final String PROPERTIES_VIEW_ID = IPageLayout.ID_PROP_SHEET;
17dec5cc 46 private static final String BOOKMARKS_VIEW_ID = IPageLayout.ID_BOOKMARKS;
12c155f5 47
2f2265e2 48
12c155f5
FC
49 // ------------------------------------------------------------------------
50 // IPerspectiveFactory
51 // ------------------------------------------------------------------------
52
53 @Override
54 public void createInitialLayout(IPageLayout layout) {
55
56 // No editor part
57 layout.setEditorAreaVisible(false);
58
12c155f5
FC
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
12c155f5
FC
64 // Create the top right folder
65 IFolderLayout topRightFolder = layout.createFolder(
ea279a69 66 "topRightFolder", IPageLayout.TOP, 0.50f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
12c155f5
FC
67 topRightFolder.addView(EVENTS_VIEW_ID);
68
69 // Create the middle right folder
12c155f5 70 IFolderLayout middleRightFolder = layout.createFolder(
ea279a69 71 "middleRightFolder", IPageLayout.BOTTOM, 0.50f, "topRightFolder"); //$NON-NLS-1$//$NON-NLS-2$
17dec5cc 72 middleRightFolder.addView(STATISTICS_VIEW_ID);
12c155f5
FC
73
74 // Create the bottom right folder
75 IFolderLayout bottomRightFolder = layout.createFolder(
ea279a69 76 "bottomRightFolder", IPageLayout.BOTTOM, 0.55f, "middleRightFolder"); //$NON-NLS-1$ //$NON-NLS-2$
17dec5cc 77 bottomRightFolder.addView(HISTOGRAM_VIEW_ID);
12c155f5 78 bottomRightFolder.addView(PROPERTIES_VIEW_ID);
17dec5cc 79 bottomRightFolder.addView(BOOKMARKS_VIEW_ID);
12c155f5 80
ea279a69
FC
81 // Populate menus, etc
82 layout.addPerspectiveShortcut(ID);
83 layout.addNewWizardShortcut(NewTmfProjectWizard.ID);
12c155f5
FC
84 }
85
86}
This page took 0.036715 seconds and 5 git commands to generate.