67873e7998fdecea868dbec73d591005267f4a18
[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 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.kernel.ui.views.controlflow.ControlFlowView;
16 import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources.ResourcesView;
17 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
18 import org.eclipse.linuxtools.tmf.ui.views.events.TmfEventsView;
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.ui.perspective"; //$NON-NLS-1$
32
33 // LTTng views
34 private static final String EVENTS_VIEW_ID = TmfEventsView.ID;
35 private static final String HISTOGRAM_VIEW_ID = HistogramView.ID;
36 private static final String CONTROL_VIEW_ID = ControlView.ID;
37 private static final String CONTROLFLOW_VIEW_ID = ControlFlowView.ID;
38 private static final String RESOURCES_VIEW_ID = ResourcesView.ID;
39 private static final String STATISTICS_VIEW_ID = TmfStatisticsView.ID;
40
41 // Standard Eclipse views
42 private static final String PROJECT_VIEW_ID = IPageLayout.ID_PROJECT_EXPLORER;
43 private static final String PROPERTIES_VIEW_ID = IPageLayout.ID_PROP_SHEET;
44 private static final String BOOKMARKS_VIEW_ID = IPageLayout.ID_BOOKMARKS;
45
46 /*
47 * (non-Javadoc)
48 *
49 * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
50 */
51 @Override
52 public void createInitialLayout(IPageLayout layout) {
53
54 layout.setEditorAreaVisible(false);
55
56 addFastViews(layout);
57 addViewShortcuts(layout);
58 addPerspectiveShortcuts(layout);
59
60 // Create the top left folder
61 IFolderLayout topLeftFolder = layout.createFolder(
62 "topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
63 topLeftFolder.addView(PROJECT_VIEW_ID);
64
65 // Create the bottom left folder
66 IFolderLayout bottomLeftFolder = layout.createFolder(
67 "bottomLeftFolder", IPageLayout.BOTTOM, 0.70f, "topLeftFolder"); //$NON-NLS-1$ //$NON-NLS-2$
68 bottomLeftFolder.addView(CONTROL_VIEW_ID);
69
70 // Create the top right folder
71 IFolderLayout topRightFolder = layout.createFolder(
72 "topRightFolder", IPageLayout.TOP, 0.40f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
73 topRightFolder.addView(CONTROLFLOW_VIEW_ID);
74 topRightFolder.addView(RESOURCES_VIEW_ID);
75 topRightFolder.addView(STATISTICS_VIEW_ID);
76
77 // Create the middle right folder
78 IFolderLayout middleRightFolder = layout.createFolder(
79 "middleRightFolder", IPageLayout.BOTTOM, 0.40f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
80 middleRightFolder.addView(EVENTS_VIEW_ID);
81
82 // Create the bottom right folder
83 IFolderLayout bottomRightFolder = layout.createFolder(
84 "bottomRightFolder", IPageLayout.BOTTOM, 0.50f, "middleRightFolder"); //$NON-NLS-1$ //$NON-NLS-2$
85 bottomRightFolder.addView(HISTOGRAM_VIEW_ID);
86 bottomRightFolder.addView(PROPERTIES_VIEW_ID);
87 bottomRightFolder.addView(BOOKMARKS_VIEW_ID);
88 }
89
90 /**
91 * Add fast views to the perspective
92 *
93 * @param layout
94 */
95 private void addFastViews(IPageLayout layout) {
96 }
97
98 /**
99 * Add view shortcuts to the perspective
100 *
101 * @param layout
102 */
103 private void addViewShortcuts(IPageLayout layout) {
104 }
105
106 /**
107 * Add perspective shortcuts to the perspective
108 *
109 * @param layout
110 */
111 private void addPerspectiveShortcuts(IPageLayout layout) {
112 }
113
114 }
This page took 0.037665 seconds and 5 git commands to generate.