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
.ui
.views
;
15 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.ControlView
;
16 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.events
.TmfEventsView
;
17 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.histogram
.HistogramView
;
18 import org
.eclipse
.ui
.IFolderLayout
;
19 import org
.eclipse
.ui
.IPageLayout
;
20 import org
.eclipse
.ui
.IPerspectiveFactory
;
23 * <b><u>PerspectiveFactory</u></b>
25 * The default LTTng perspective.
27 public class PerspectiveFactory
implements IPerspectiveFactory
{
30 public static final String ID
= "org.eclipse.linuxtools.lttng2.ui.perspective"; //$NON-NLS-1$
33 private static final String EVENTS_VIEW_ID
= TmfEventsView
.ID
;
34 private static final String HISTOGRAM_VIEW_ID
= HistogramView
.ID
;
35 private static final String CONTROL_VIEW_ID
= ControlView
.ID
;
37 // Standard Eclipse views
38 private static final String PROJECT_VIEW_ID
= IPageLayout
.ID_PROJECT_EXPLORER
;
39 private static final String PROPERTIES_VIEW_ID
= IPageLayout
.ID_PROP_SHEET
;
40 private static final String BOOKMARKS_VIEW_ID
= IPageLayout
.ID_BOOKMARKS
;
45 * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
48 public void createInitialLayout(IPageLayout layout
) {
50 layout
.setEditorAreaVisible(false);
53 addViewShortcuts(layout
);
54 addPerspectiveShortcuts(layout
);
56 // Create the top left folder
57 IFolderLayout topLeftFolder
= layout
.createFolder(
58 "topLeftFolder", IPageLayout
.LEFT
, 0.15f
, IPageLayout
.ID_EDITOR_AREA
); //$NON-NLS-1$
59 topLeftFolder
.addView(PROJECT_VIEW_ID
);
60 topLeftFolder
.addView(CONTROL_VIEW_ID
);
62 // // Create the top right folder
63 // IFolderLayout topRightFolder = layout.createFolder(
64 // "topRightFolder", IPageLayout.TOP, 0.40f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
66 // Create the middle right folder
67 IFolderLayout middleRightFolder
= layout
.createFolder(
68 "middleRightFolder", IPageLayout
.BOTTOM
, 0.40f
, IPageLayout
.ID_EDITOR_AREA
); //$NON-NLS-1$
69 middleRightFolder
.addView(EVENTS_VIEW_ID
);
71 // Create the bottom right folder
72 IFolderLayout bottomRightFolder
= layout
.createFolder(
73 "bottomRightFolder", IPageLayout
.BOTTOM
, 0.50f
, "middleRightFolder"); //$NON-NLS-1$ //$NON-NLS-2$
74 bottomRightFolder
.addView(HISTOGRAM_VIEW_ID
);
75 bottomRightFolder
.addView(PROPERTIES_VIEW_ID
);
76 bottomRightFolder
.addView(BOOKMARKS_VIEW_ID
);
80 * Add fast views to the perspective
84 private void addFastViews(IPageLayout layout
) {
85 // TODO Auto-generated method stub
89 * Add view shortcuts to the perspective
93 private void addViewShortcuts(IPageLayout layout
) {
94 // TODO Auto-generated method stub
98 * Add perspective shortcuts to the perspective
102 private void addPerspectiveShortcuts(IPageLayout layout
) {
103 // TODO Auto-generated method stub