Internalize API for trace control and move control to lttng2
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / internal / lttng / ui / views / PerspectiveFactory.java
CommitLineData
6e512b93
ASL
1/*******************************************************************************
2 * Copyright (c) 2009 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
638eac44 13package org.eclipse.linuxtools.internal.lttng.ui.views;
6e512b93 14
638eac44
FC
15import org.eclipse.linuxtools.internal.lttng.ui.views.controlflow.ControlFlowView;
16import org.eclipse.linuxtools.internal.lttng.ui.views.resources.ResourcesView;
17import org.eclipse.linuxtools.internal.lttng.ui.views.statistics.StatisticsView;
09d11238 18import org.eclipse.linuxtools.tmf.ui.views.events.TmfEventsView;
e0752744 19import org.eclipse.linuxtools.tmf.ui.views.histogram.HistogramView;
6e512b93
ASL
20import org.eclipse.ui.IFolderLayout;
21import org.eclipse.ui.IPageLayout;
22import org.eclipse.ui.IPerspectiveFactory;
23
24/**
25 * <b><u>PerspectiveFactory</u></b>
26 * <p>
e0752744 27 * The default LTTng perspective.
6e512b93
ASL
28 */
29public class PerspectiveFactory implements IPerspectiveFactory {
30
12c155f5 31 // Perspective ID
3b38ea61 32 public static final String ID = "org.eclipse.linuxtools.lttng.ui.perspective"; //$NON-NLS-1$
12c155f5 33
6e512b93 34 // LTTng views
09d11238 35 private static final String EVENTS_VIEW_ID = TmfEventsView.ID;
62d1696a 36 private static final String CONTROL_FLOW_VIEW_ID = ControlFlowView.ID;
12c155f5
FC
37 private static final String RESOURCES_VIEW_ID = ResourcesView.ID;
38 private static final String STATISTICS_VIEW_ID = StatisticsView.ID;
39 private static final String HISTOGRAM_VIEW_ID = HistogramView.ID;
115b4a01 40
6e512b93
ASL
41
42 // Standard Eclipse views
12c155f5
FC
43 private static final String PROJECT_VIEW_ID = IPageLayout.ID_PROJECT_EXPLORER;
44 private static final String PROPERTIES_VIEW_ID = IPageLayout.ID_PROP_SHEET;
828e5592 45 private static final String BOOKMARKS_VIEW_ID = IPageLayout.ID_BOOKMARKS;
6e512b93 46
12c155f5
FC
47 /*
48 * (non-Javadoc)
49 *
50 * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
51 */
52 @Override
53 public void createInitialLayout(IPageLayout layout) {
6e512b93 54
09d11238 55 layout.setEditorAreaVisible(false);
6e512b93
ASL
56
57 addFastViews(layout);
58 addViewShortcuts(layout);
59 addPerspectiveShortcuts(layout);
60
61 // Create the top left folder
12c155f5
FC
62 IFolderLayout topLeftFolder = layout.createFolder(
63 "topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
6e512b93 64 topLeftFolder.addView(PROJECT_VIEW_ID);
6e512b93 65
828e5592 66 // Create the top right folder
12c155f5 67 IFolderLayout topRightFolder = layout.createFolder(
09d11238 68 "topRightFolder", IPageLayout.TOP, 0.40f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
6e512b93
ASL
69 topRightFolder.addView(CONTROL_FLOW_VIEW_ID);
70 topRightFolder.addView(RESOURCES_VIEW_ID);
71 topRightFolder.addView(STATISTICS_VIEW_ID);
72
09d11238
PT
73 // Create the middle right folder
74 IFolderLayout middleRightFolder = layout.createFolder(
81ec645c 75 "middleRightFolder", IPageLayout.BOTTOM, 0.40f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
09d11238
PT
76 middleRightFolder.addView(EVENTS_VIEW_ID);
77
6e512b93 78 // Create the bottom right folder
12c155f5 79 IFolderLayout bottomRightFolder = layout.createFolder(
09d11238 80 "bottomRightFolder", IPageLayout.BOTTOM, 0.50f, "middleRightFolder"); //$NON-NLS-1$ //$NON-NLS-2$
6e512b93 81 bottomRightFolder.addView(HISTOGRAM_VIEW_ID);
12c155f5 82 bottomRightFolder.addView(PROPERTIES_VIEW_ID);
828e5592 83 bottomRightFolder.addView(BOOKMARKS_VIEW_ID);
12c155f5 84 }
6e512b93
ASL
85
86 /**
87 * Add fast views to the perspective
88 *
89 * @param layout
90 */
91 private void addFastViews(IPageLayout layout) {
92 // TODO Auto-generated method stub
93 }
94
95 /**
96 * Add view shortcuts to the perspective
97 *
98 * @param layout
99 */
100 private void addViewShortcuts(IPageLayout layout) {
101 // TODO Auto-generated method stub
102 }
103
104 /**
105 * Add perspective shortcuts to the perspective
106 *
107 * @param layout
108 */
109 private void addPerspectiveShortcuts(IPageLayout layout) {
110 // TODO Auto-generated method stub
111 }
112
113}
This page took 0.035463 seconds and 5 git commands to generate.