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