1 /*******************************************************************************
2 * Copyright (c) 2009 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
.lttng
.ui
.views
;
15 import org
.eclipse
.linuxtools
.internal
.lttng
.ui
.views
.control
.ControlView
;
16 import org
.eclipse
.linuxtools
.internal
.lttng
.ui
.views
.controlflow
.ControlFlowView
;
17 import org
.eclipse
.linuxtools
.internal
.lttng
.ui
.views
.resources
.ResourcesView
;
18 import org
.eclipse
.linuxtools
.internal
.lttng
.ui
.views
.statistics
.StatisticsView
;
19 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.events
.TmfEventsView
;
20 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.histogram
.HistogramView
;
21 import org
.eclipse
.ui
.IFolderLayout
;
22 import org
.eclipse
.ui
.IPageLayout
;
23 import org
.eclipse
.ui
.IPerspectiveFactory
;
26 * <b><u>PerspectiveFactory</u></b>
28 * The default LTTng perspective.
30 public class PerspectiveFactory
implements IPerspectiveFactory
{
33 public static final String ID
= "org.eclipse.linuxtools.lttng.ui.perspective"; //$NON-NLS-1$
36 private static final String EVENTS_VIEW_ID
= TmfEventsView
.ID
;
37 private static final String CONTROL_FLOW_VIEW_ID
= ControlFlowView
.ID
;
38 private static final String RESOURCES_VIEW_ID
= ResourcesView
.ID
;
39 private static final String STATISTICS_VIEW_ID
= StatisticsView
.ID
;
40 private static final String HISTOGRAM_VIEW_ID
= HistogramView
.ID
;
41 private static final String CONTROL_VIEW_ID
= ControlView
.ID
;
43 // Standard Eclipse views
44 private static final String PROJECT_VIEW_ID
= IPageLayout
.ID_PROJECT_EXPLORER
;
45 private static final String PROPERTIES_VIEW_ID
= IPageLayout
.ID_PROP_SHEET
;
46 private static final String BOOKMARKS_VIEW_ID
= IPageLayout
.ID_BOOKMARKS
;
51 * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
54 public void createInitialLayout(IPageLayout layout
) {
56 layout
.setEditorAreaVisible(false);
59 addViewShortcuts(layout
);
60 addPerspectiveShortcuts(layout
);
62 // Create the top left folder
63 IFolderLayout topLeftFolder
= layout
.createFolder(
64 "topLeftFolder", IPageLayout
.LEFT
, 0.15f
, IPageLayout
.ID_EDITOR_AREA
); //$NON-NLS-1$
65 topLeftFolder
.addView(PROJECT_VIEW_ID
);
66 topLeftFolder
.addView(CONTROL_VIEW_ID
);
68 // Create the top right folder
69 IFolderLayout topRightFolder
= layout
.createFolder(
70 "topRightFolder", IPageLayout
.TOP
, 0.40f
, IPageLayout
.ID_EDITOR_AREA
); //$NON-NLS-1$
71 topRightFolder
.addView(CONTROL_FLOW_VIEW_ID
);
72 topRightFolder
.addView(RESOURCES_VIEW_ID
);
73 topRightFolder
.addView(STATISTICS_VIEW_ID
);
75 // Create the middle right folder
76 IFolderLayout middleRightFolder
= layout
.createFolder(
77 "middleRightFolder", IPageLayout
.BOTTOM
, 0.40f
, IPageLayout
.ID_EDITOR_AREA
); //$NON-NLS-1$
78 middleRightFolder
.addView(EVENTS_VIEW_ID
);
80 // Create the bottom right folder
81 IFolderLayout bottomRightFolder
= layout
.createFolder(
82 "bottomRightFolder", IPageLayout
.BOTTOM
, 0.50f
, "middleRightFolder"); //$NON-NLS-1$ //$NON-NLS-2$
83 bottomRightFolder
.addView(HISTOGRAM_VIEW_ID
);
84 bottomRightFolder
.addView(PROPERTIES_VIEW_ID
);
85 bottomRightFolder
.addView(BOOKMARKS_VIEW_ID
);
89 * Add fast views to the perspective
93 private void addFastViews(IPageLayout layout
) {
94 // TODO Auto-generated method stub
98 * Add view shortcuts to the perspective
102 private void addViewShortcuts(IPageLayout layout
) {
103 // TODO Auto-generated method stub
107 * Add perspective shortcuts to the perspective
111 private void addPerspectiveShortcuts(IPageLayout layout
) {
112 // TODO Auto-generated method stub