1 /*******************************************************************************
2 * Copyright (c) 2011, 2014 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 * Patrick Tasse - Updated for TMF 2.0
12 *******************************************************************************/
14 package org
.eclipse
.tracecompass
.internal
.gdbtrace
.ui
.views
;
16 import org
.eclipse
.debug
.ui
.IDebugUIConstants
;
17 import org
.eclipse
.tracecompass
.internal
.gdbtrace
.ui
.GdbTraceUIPlugin
;
18 import org
.eclipse
.tracecompass
.tmf
.ui
.project
.wizards
.NewTmfProjectWizard
;
19 import org
.eclipse
.ui
.IFolderLayout
;
20 import org
.eclipse
.ui
.IPageLayout
;
21 import org
.eclipse
.ui
.IPerspectiveFactory
;
22 import org
.eclipse
.ui
.console
.IConsoleConstants
;
25 * GDB Trace perspective factory
26 * @author Francois Chouinard
28 public class GdbPerspectiveFactory
implements IPerspectiveFactory
{
30 // ------------------------------------------------------------------------
32 // ------------------------------------------------------------------------
34 /** The perspective ID */
35 public static final String ID
= GdbTraceUIPlugin
.PLUGIN_ID
+ ".perspective"; //$NON-NLS-1$
38 private static final String EditorArea
= IPageLayout
.ID_EDITOR_AREA
;
39 private static final String ProjectFolder
= "ProjectFolder"; //$NON-NLS-1$
40 private static final String ConsoleFolder
= "ConsoleFolder"; //$NON-NLS-1$
41 private static final String DebugFolder
= "DebugFolder"; //$NON-NLS-1$
42 private static final String TraceControlFolder
= "TraceControlFolder"; //$NON-NLS-1$
44 // Standard Debug Views
45 private static final String DEBUG_VIEW_ID
= IDebugUIConstants
.ID_DEBUG_VIEW
;
46 private static final String TRACE_CONTROL_VIEW_ID
= "org.eclipse.cdt.dsf.gdb.ui.tracecontrol.view"; //$NON-NLS-1$
48 // Standard Eclipse views
49 private static final String PROJECT_VIEW_ID
= IPageLayout
.ID_PROJECT_EXPLORER
;
50 private static final String CONSOLE_VIEW_ID
= IConsoleConstants
.ID_CONSOLE_VIEW
;
52 // ------------------------------------------------------------------------
53 // IPerspectiveFactory
54 // ------------------------------------------------------------------------
57 public void createInitialLayout(IPageLayout layout
) {
59 layout
.setEditorAreaVisible(true);
61 // Create the project folder
62 IFolderLayout projectFolder
= layout
.createFolder(ProjectFolder
, IPageLayout
.LEFT
, 0.15f
, EditorArea
);
63 projectFolder
.addView(PROJECT_VIEW_ID
);
65 // Create the console folder
66 IFolderLayout consoleFolder
= layout
.createFolder(ConsoleFolder
, IPageLayout
.BOTTOM
, 0.50f
, ProjectFolder
);
67 consoleFolder
.addView(CONSOLE_VIEW_ID
);
69 // Create the debug folder
70 IFolderLayout debugFolder
= layout
.createFolder(DebugFolder
, IPageLayout
.TOP
, 0.50f
, EditorArea
);
71 debugFolder
.addView(DEBUG_VIEW_ID
);
73 // Create the middle right folder
74 IFolderLayout traceControlFolder
= layout
.createFolder(TraceControlFolder
, IPageLayout
.RIGHT
, 0.50f
, DebugFolder
);
75 traceControlFolder
.addView(TRACE_CONTROL_VIEW_ID
);
77 layout
.addNewWizardShortcut(NewTmfProjectWizard
.ID
);