2010-09-17 Francois Chouinard <fchouinard@gmail.com> Contribution for Bug325662
[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.events.EventsView;
18 import org.eclipse.linuxtools.lttng.ui.views.histogram.HistogramView;
19 import org.eclipse.linuxtools.lttng.ui.views.project.ProjectView;
20 import org.eclipse.linuxtools.lttng.ui.views.resources.ResourcesView;
21 import org.eclipse.linuxtools.lttng.ui.views.statistics.StatisticsView;
22 import org.eclipse.linuxtools.lttng.ui.views.timeframe.TimeFrameView;
23 import org.eclipse.ui.IFolderLayout;
24 import org.eclipse.ui.IPageLayout;
25 import org.eclipse.ui.IPerspectiveFactory;
26
27 /**
28 * <b><u>PerspectiveFactory</u></b>
29 * <p>
30 * TODO: Implement me. Please.
31 */
32 public class PerspectiveFactory implements IPerspectiveFactory {
33
34 // Perspective ID
35 public static final String ID = "org.eclipse.linuxtools.lttng.ui.perspective";
36
37 // LTTng views
38 private static final String PROJECT_VIEW_ID = ProjectView.ID;
39 private static final String CONTROL_VIEW_ID = ControlView.ID;
40 private static final String EVENTS_VIEW_ID = EventsView.ID;
41 private static final String TIME_FRAME_VIEW_ID = TimeFrameView.ID;
42 private static final String CONTROL_FLOW_VIEW_ID = ControlFlowView.ID;
43 private static final String RESOURCES_VIEW_ID = ResourcesView.ID;
44 private static final String STATISTICS_VIEW_ID = StatisticsView.ID;
45 private static final String HISTOGRAM_VIEW_ID = HistogramView.ID;
46
47 // Standard Eclipse views
48 private static final String PROPERTIES_VIEW_ID = IPageLayout.ID_PROP_SHEET;
49 private static final String PROBLEM_VIEW_ID = IPageLayout.ID_PROBLEM_VIEW;
50
51 /* (non-Javadoc)
52 * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
53 */
54 public void createInitialLayout(IPageLayout layout) {
55
56 layout.setEditorAreaVisible(false);
57
58 addFastViews(layout);
59 addViewShortcuts(layout);
60 addPerspectiveShortcuts(layout);
61
62 // Create the top left folder
63 IFolderLayout topLeftFolder = layout.createFolder("topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA);
64 topLeftFolder.addView(PROJECT_VIEW_ID);
65 topLeftFolder.addView(CONTROL_VIEW_ID);
66
67 // Create the bottom left folder
68 IFolderLayout bottomLeftFolder = layout.createFolder("bottomLeftFolder", IPageLayout.BOTTOM, 0.50f, "topLeftFolder");
69 bottomLeftFolder.addView(PROPERTIES_VIEW_ID);
70
71 // Create the middle right folder
72 IFolderLayout topRightFolder = layout.createFolder("topRightFolder", IPageLayout.TOP, 0.50f, IPageLayout.ID_EDITOR_AREA);
73 topRightFolder.addView(CONTROL_FLOW_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("middleRightFolder", IPageLayout.BOTTOM, 0.50f, "topRightFolder");
79 middleRightFolder.addView(EVENTS_VIEW_ID);
80
81 // Create the bottom right folder
82 IFolderLayout bottomRightFolder = layout.createFolder("bottomRightFolder", IPageLayout.BOTTOM, 0.65f, "middleRightFolder");
83 bottomRightFolder.addView(TIME_FRAME_VIEW_ID);
84 bottomRightFolder.addView(HISTOGRAM_VIEW_ID);
85 bottomRightFolder.addView(PROBLEM_VIEW_ID);
86
87 }
88
89 /**
90 * Add fast views to the perspective
91 *
92 * @param layout
93 */
94 private void addFastViews(IPageLayout layout) {
95 // TODO Auto-generated method stub
96 }
97
98 /**
99 * Add view shortcuts to the perspective
100 *
101 * @param layout
102 */
103 private void addViewShortcuts(IPageLayout layout) {
104 // TODO Auto-generated method stub
105 }
106
107 /**
108 * Add perspective shortcuts to the perspective
109 *
110 * @param layout
111 */
112 private void addPerspectiveShortcuts(IPageLayout layout) {
113 // TODO Auto-generated method stub
114 }
115
116 }
This page took 0.032975 seconds and 5 git commands to generate.