1 /*******************************************************************************
2 * Copyright (c) 2012 Ericsson
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
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.ui
.views
;
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
.ui
.IFolderLayout
;
21 import org
.eclipse
.ui
.IPageLayout
;
22 import org
.eclipse
.ui
.IPerspectiveFactory
;
25 * <b><u>PerspectiveFactory</u></b>
27 * The default LTTng perspective.
29 public class PerspectiveFactory
implements IPerspectiveFactory
{
32 public static final String ID
= "org.eclipse.linuxtools.lttng2.ui.perspective"; //$NON-NLS-1$
35 private static final String EVENTS_VIEW_ID
= TmfEventsView
.ID
;
36 private static final String HISTOGRAM_VIEW_ID
= HistogramView
.ID
;
37 private static final String CONTROL_VIEW_ID
= ControlView
.ID
;
38 private static final String CONTROLFLOW_VIEW_ID
= ControlFlowView
.ID
;
39 private static final String RESOURCES_VIEW_ID
= ResourcesView
.ID
;
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
;
49 * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
52 public void createInitialLayout(IPageLayout layout
) {
54 layout
.setEditorAreaVisible(false);
57 addViewShortcuts(layout
);
58 addPerspectiveShortcuts(layout
);
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
);
66 // Create the top right folder
67 IFolderLayout topRightFolder
= layout
.createFolder(
68 "topRightFolder", IPageLayout
.TOP
, 0.40f
, IPageLayout
.ID_EDITOR_AREA
); //$NON-NLS-1$
69 topRightFolder
.addView(CONTROLFLOW_VIEW_ID
);
70 topRightFolder
.addView(RESOURCES_VIEW_ID
);
72 // Create the middle right folder
73 IFolderLayout middleRightFolder
= layout
.createFolder(
74 "middleRightFolder", IPageLayout
.BOTTOM
, 0.40f
, IPageLayout
.ID_EDITOR_AREA
); //$NON-NLS-1$
75 middleRightFolder
.addView(EVENTS_VIEW_ID
);
77 // Create the bottom right folder
78 IFolderLayout bottomRightFolder
= layout
.createFolder(
79 "bottomRightFolder", IPageLayout
.BOTTOM
, 0.50f
, "middleRightFolder"); //$NON-NLS-1$ //$NON-NLS-2$
80 bottomRightFolder
.addView(HISTOGRAM_VIEW_ID
);
81 bottomRightFolder
.addView(PROPERTIES_VIEW_ID
);
82 bottomRightFolder
.addView(BOOKMARKS_VIEW_ID
);
86 * Add fast views to the perspective
90 private void addFastViews(IPageLayout layout
) {
91 // TODO Auto-generated method stub
95 * Add view shortcuts to the perspective
99 private void addViewShortcuts(IPageLayout layout
) {
100 // TODO Auto-generated method stub
104 * Add perspective shortcuts to the perspective
108 private void addPerspectiveShortcuts(IPageLayout layout
) {
109 // TODO Auto-generated method stub