ca4dd444aa61b7c914d49d3c3358c486054aaaa5
[deliverable/tracecompass.git] / org.eclipse.tracecompass.gdbtrace.ui / src / org / eclipse / tracecompass / internal / gdbtrace / ui / views / GdbPerspectiveFactory.java
1 /*******************************************************************************
2 * Copyright (c) 2011, 2014 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 * Patrick Tasse - Updated for TMF 2.0
12 *******************************************************************************/
13
14 package org.eclipse.tracecompass.internal.gdbtrace.ui.views;
15
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;
23
24 /**
25 * GDB Trace perspective factory
26 * @author Francois Chouinard
27 */
28 public class GdbPerspectiveFactory implements IPerspectiveFactory {
29
30 // ------------------------------------------------------------------------
31 // Constants
32 // ------------------------------------------------------------------------
33
34 /** The perspective ID */
35 public static final String ID = GdbTraceUIPlugin.PLUGIN_ID + ".perspective"; //$NON-NLS-1$
36
37 // Folders
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$
43
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$
47
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;
51
52 // ------------------------------------------------------------------------
53 // IPerspectiveFactory
54 // ------------------------------------------------------------------------
55
56 @Override
57 public void createInitialLayout(IPageLayout layout) {
58
59 layout.setEditorAreaVisible(true);
60
61 // Create the project folder
62 IFolderLayout projectFolder = layout.createFolder(ProjectFolder, IPageLayout.LEFT, 0.15f, EditorArea);
63 projectFolder.addView(PROJECT_VIEW_ID);
64
65 // Create the console folder
66 IFolderLayout consoleFolder = layout.createFolder(ConsoleFolder, IPageLayout.BOTTOM, 0.50f, ProjectFolder);
67 consoleFolder.addView(CONSOLE_VIEW_ID);
68
69 // Create the debug folder
70 IFolderLayout debugFolder = layout.createFolder(DebugFolder, IPageLayout.TOP, 0.50f, EditorArea);
71 debugFolder.addView(DEBUG_VIEW_ID);
72
73 // Create the middle right folder
74 IFolderLayout traceControlFolder = layout.createFolder(TraceControlFolder, IPageLayout.RIGHT, 0.50f, DebugFolder);
75 traceControlFolder.addView(TRACE_CONTROL_VIEW_ID);
76
77 layout.addNewWizardShortcut(NewTmfProjectWizard.ID);
78 }
79 }
This page took 0.031883 seconds and 4 git commands to generate.