Add LTTng2 Kernel Analysis plug-ins
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.kernel.ui / src / org / eclipse / linuxtools / lttng2 / kernel / 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.lttng2.kernel.kernel.ui.views;
14
15 import org.eclipse.linuxtools.tmf.ui.views.events.TmfEventsView;
16 import org.eclipse.linuxtools.tmf.ui.views.histogram.HistogramView;
17 import org.eclipse.ui.IFolderLayout;
18 import org.eclipse.ui.IPageLayout;
19 import org.eclipse.ui.IPerspectiveFactory;
20
21 /**
22 * <b><u>PerspectiveFactory</u></b>
23 * <p>
24 * The default LTTng perspective.
25 */
26 public class PerspectiveFactory implements IPerspectiveFactory {
27
28 // Perspective ID
29 public static final String ID = "org.eclipse.linuxtools.lttng2.ui.perspective"; //$NON-NLS-1$
30
31 // LTTng views
32 private static final String EVENTS_VIEW_ID = TmfEventsView.ID;
33 private static final String HISTOGRAM_VIEW_ID = HistogramView.ID;
34
35 // Standard Eclipse views
36 private static final String PROJECT_VIEW_ID = IPageLayout.ID_PROJECT_EXPLORER;
37 private static final String PROPERTIES_VIEW_ID = IPageLayout.ID_PROP_SHEET;
38 private static final String BOOKMARKS_VIEW_ID = IPageLayout.ID_BOOKMARKS;
39
40 /*
41 * (non-Javadoc)
42 *
43 * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
44 */
45 @Override
46 public void createInitialLayout(IPageLayout layout) {
47
48 layout.setEditorAreaVisible(false);
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 top right folder
60 // IFolderLayout topRightFolder = layout.createFolder(
61 // "topRightFolder", IPageLayout.TOP, 0.40f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
62
63 // Create the middle right folder
64 IFolderLayout middleRightFolder = layout.createFolder(
65 "middleRightFolder", IPageLayout.BOTTOM, 0.40f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
66 middleRightFolder.addView(EVENTS_VIEW_ID);
67
68 // Create the bottom right folder
69 IFolderLayout bottomRightFolder = layout.createFolder(
70 "bottomRightFolder", IPageLayout.BOTTOM, 0.50f, "middleRightFolder"); //$NON-NLS-1$ //$NON-NLS-2$
71 bottomRightFolder.addView(HISTOGRAM_VIEW_ID);
72 bottomRightFolder.addView(PROPERTIES_VIEW_ID);
73 bottomRightFolder.addView(BOOKMARKS_VIEW_ID);
74 }
75
76 /**
77 * Add fast views to the perspective
78 *
79 * @param layout
80 */
81 private void addFastViews(IPageLayout layout) {
82 // TODO Auto-generated method stub
83 }
84
85 /**
86 * Add view shortcuts to the perspective
87 *
88 * @param layout
89 */
90 private void addViewShortcuts(IPageLayout layout) {
91 // TODO Auto-generated method stub
92 }
93
94 /**
95 * Add perspective shortcuts to the perspective
96 *
97 * @param layout
98 */
99 private void addPerspectiveShortcuts(IPageLayout layout) {
100 // TODO Auto-generated method stub
101 }
102
103 }
This page took 0.032416 seconds and 5 git commands to generate.