13bc181afbfbfbf39492853432de7289587dbf23
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.kernel.ui / src / org / eclipse / linuxtools / internal / lttng2 / kernel / ui / views / PerspectiveFactory.java
1 /*******************************************************************************
2 * Copyright (c) 2012, 2013 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.internal.lttng2.kernel.ui.views;
14
15 import org.eclipse.linuxtools.internal.lttng2.control.ui.views.ControlView;
16 import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.controlflow.ControlFlowView;
17 import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources.ResourcesView;
18 import org.eclipse.linuxtools.tmf.ui.project.wizards.NewTmfProjectWizard;
19 import org.eclipse.linuxtools.tmf.ui.views.histogram.HistogramView;
20 import org.eclipse.linuxtools.tmf.ui.views.statistics.TmfStatisticsView;
21 import org.eclipse.ui.IFolderLayout;
22 import org.eclipse.ui.IPageLayout;
23 import org.eclipse.ui.IPerspectiveFactory;
24
25 /**
26 * The default LTTng perspective.
27 */
28 public class PerspectiveFactory implements IPerspectiveFactory {
29
30 /** Perspective ID */
31 public static final String ID = "org.eclipse.linuxtools.lttng2.kernel.ui.perspective"; //$NON-NLS-1$
32
33 // LTTng views
34 private static final String HISTOGRAM_VIEW_ID = HistogramView.ID;
35 private static final String CONTROL_VIEW_ID = ControlView.ID;
36 private static final String CONTROLFLOW_VIEW_ID = ControlFlowView.ID;
37 private static final String RESOURCES_VIEW_ID = ResourcesView.ID;
38 private static final String STATISTICS_VIEW_ID = TmfStatisticsView.ID;
39
40 // Standard Eclipse views
41 private static final String PROJECT_VIEW_ID = IPageLayout.ID_PROJECT_EXPLORER;
42 private static final String PROPERTIES_VIEW_ID = IPageLayout.ID_PROP_SHEET;
43 private static final String BOOKMARKS_VIEW_ID = IPageLayout.ID_BOOKMARKS;
44
45 @Override
46 public void createInitialLayout(IPageLayout layout) {
47
48 layout.setEditorAreaVisible(true);
49
50 addFastViews(layout);
51 addViewShortcuts(layout);
52 addPerspectiveShortcuts(layout);
53
54 // Create the top left folder
55 IFolderLayout topLeftFolder = layout.createFolder(
56 "topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
57 topLeftFolder.addView(PROJECT_VIEW_ID);
58
59 // Create the bottom left folder
60 IFolderLayout bottomLeftFolder = layout.createFolder(
61 "bottomLeftFolder", IPageLayout.BOTTOM, 0.70f, "topLeftFolder"); //$NON-NLS-1$ //$NON-NLS-2$
62 bottomLeftFolder.addView(CONTROL_VIEW_ID);
63
64 // Create the top right folder
65 IFolderLayout topRightFolder = layout.createFolder(
66 "topRightFolder", IPageLayout.TOP, 0.40f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
67 topRightFolder.addView(CONTROLFLOW_VIEW_ID);
68 topRightFolder.addView(RESOURCES_VIEW_ID);
69 topRightFolder.addView(STATISTICS_VIEW_ID);
70
71 // Create the bottom right folder
72 IFolderLayout bottomRightFolder = layout.createFolder(
73 "bottomRightFolder", IPageLayout.BOTTOM, 0.50f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
74 bottomRightFolder.addView(HISTOGRAM_VIEW_ID);
75 bottomRightFolder.addView(PROPERTIES_VIEW_ID);
76 bottomRightFolder.addView(BOOKMARKS_VIEW_ID);
77
78 layout.addNewWizardShortcut(NewTmfProjectWizard.ID);
79 }
80
81 /**
82 * Add fast views to the perspective
83 *
84 * @param layout
85 */
86 private void addFastViews(IPageLayout layout) {
87 }
88
89 /**
90 * Add view shortcuts to the perspective
91 *
92 * @param layout
93 */
94 private void addViewShortcuts(IPageLayout layout) {
95 }
96
97 /**
98 * Add perspective shortcuts to the perspective
99 *
100 * @param layout
101 */
102 private void addPerspectiveShortcuts(IPageLayout layout) {
103 }
104
105 }
This page took 0.060681 seconds and 4 git commands to generate.