Add new LTTng commands (create/destroy/start/stop session,
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / views / PerspectiveFactory.java
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
13 package org.eclipse.linuxtools.lttng.ui.views;
14
15 import org.eclipse.linuxtools.lttng.ui.views.control.ControlView;
16 import org.eclipse.linuxtools.lttng.ui.views.controlflow.ControlFlowView;
17 import org.eclipse.linuxtools.lttng.ui.views.histogram.HistogramView;
18 import org.eclipse.linuxtools.lttng.ui.views.resources.ResourcesView;
19 import org.eclipse.linuxtools.lttng.ui.views.statistics.StatisticsView;
20 import org.eclipse.ui.IFolderLayout;
21 import org.eclipse.ui.IPageLayout;
22 import org.eclipse.ui.IPerspectiveFactory;
23
24 /**
25 * <b><u>PerspectiveFactory</u></b>
26 * <p>
27 * TODO: Implement me. Please.
28 */
29 public class PerspectiveFactory implements IPerspectiveFactory {
30
31 // Perspective ID
32 public static final String ID = "org.eclipse.linuxtools.lttng.ui.perspective"; //$NON-NLS-1$
33
34 // LTTng views
35 private static final String CONTROL_FLOW_VIEW_ID = ControlFlowView.ID;
36 private static final String RESOURCES_VIEW_ID = ResourcesView.ID;
37 private static final String STATISTICS_VIEW_ID = StatisticsView.ID;
38 private static final String HISTOGRAM_VIEW_ID = HistogramView.ID;
39 private static final String CONTROL_VIEW_ID = ControlView.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(true);
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 topLeftFolder.addView(CONTROL_VIEW_ID);
65
66 // Create the top right folder
67 IFolderLayout topRightFolder = layout.createFolder(
68 "topRightFolder", IPageLayout.TOP, 0.30f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
69 topRightFolder.addView(CONTROL_FLOW_VIEW_ID);
70 topRightFolder.addView(RESOURCES_VIEW_ID);
71 topRightFolder.addView(STATISTICS_VIEW_ID);
72
73 // Create the bottom right folder
74 IFolderLayout bottomRightFolder = layout.createFolder(
75 "bottomRightFolder", IPageLayout.BOTTOM, 0.50f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
76 bottomRightFolder.addView(HISTOGRAM_VIEW_ID);
77 bottomRightFolder.addView(PROPERTIES_VIEW_ID);
78 bottomRightFolder.addView(BOOKMARKS_VIEW_ID);
79 }
80
81 /**
82 * Add fast views to the perspective
83 *
84 * @param layout
85 */
86 private void addFastViews(IPageLayout layout) {
87 // TODO Auto-generated method stub
88 }
89
90 /**
91 * Add view shortcuts to the perspective
92 *
93 * @param layout
94 */
95 private void addViewShortcuts(IPageLayout layout) {
96 // TODO Auto-generated method stub
97 }
98
99 /**
100 * Add perspective shortcuts to the perspective
101 *
102 * @param layout
103 */
104 private void addPerspectiveShortcuts(IPageLayout layout) {
105 // TODO Auto-generated method stub
106 }
107
108 }
This page took 0.032403 seconds and 5 git commands to generate.