Skip to main content
summaryrefslogtreecommitdiffstats
blob: bd28bc3c8269f83360af1b43ce93169d075cb380 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*******************************************************************************
 * Copyright (c) 2009 Ericsson
 * 
 * All rights reserved. This program and the accompanying materials are
 * made available under the terms of the Eclipse Public License v1.0 which
 * accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *   Francois Chouinard - Initial API and implementation
 *******************************************************************************/

package org.eclipse.linuxtools.lttng.ui.views;

import org.eclipse.linuxtools.lttng.ui.views.control.ControlView;
import org.eclipse.linuxtools.lttng.ui.views.controlflow.ControlFlowView;
import org.eclipse.linuxtools.lttng.ui.views.events.EventsView;
import org.eclipse.linuxtools.lttng.ui.views.histogram.HistogramView;
import org.eclipse.linuxtools.lttng.ui.views.project.ProjectView;
import org.eclipse.linuxtools.lttng.ui.views.resources.ResourcesView;
import org.eclipse.linuxtools.lttng.ui.views.statistics.StatisticsView;
import org.eclipse.linuxtools.lttng.ui.views.timeframe.TimeFrameView;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

/**
 * <b><u>PerspectiveFactory</u></b>
 * <p>
 * TODO: Implement me. Please.
 */
public class PerspectiveFactory implements IPerspectiveFactory {

    // LTTng views
    private static final String PROJECT_VIEW_ID      = ProjectView.ID;
    private static final String CONTROL_VIEW_ID      = ControlView.ID;
    private static final String EVENTS_VIEW_ID       = EventsView.ID;
    private static final String TIME_FRAME_VIEW_ID   = TimeFrameView.ID;
    private static final String CONTROL_FLOW_VIEW_ID = ControlFlowView.ID;
    private static final String RESOURCES_VIEW_ID    = ResourcesView.ID;
    private static final String STATISTICS_VIEW_ID   = StatisticsView.ID;
    private static final String HISTOGRAM_VIEW_ID    = HistogramView.ID;

    // Standard Eclipse views
    private static final String PROPERTIES_VIEW_ID   = IPageLayout.ID_PROP_SHEET;
    private static final String PROBLEM_VIEW_ID      = IPageLayout.ID_PROBLEM_VIEW;

	/* (non-Javadoc)
	 * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
	 */
	public void createInitialLayout(IPageLayout layout) {

        layout.setEditorAreaVisible(false);

        addFastViews(layout);
        addViewShortcuts(layout);
        addPerspectiveShortcuts(layout);

        // Create the top left folder
        IFolderLayout topLeftFolder = layout.createFolder("topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA);
        topLeftFolder.addView(PROJECT_VIEW_ID);
        topLeftFolder.addView(CONTROL_VIEW_ID);

        // Create the bottom left folder
        IFolderLayout bottomLeftFolder = layout.createFolder("bottomLeftFolder", IPageLayout.BOTTOM, 0.50f, "topLeftFolder");
        bottomLeftFolder.addView(PROPERTIES_VIEW_ID);
   
        // Create the middle right folder
        IFolderLayout topRightFolder = layout.createFolder("topRightFolder", IPageLayout.TOP, 0.50f, IPageLayout.ID_EDITOR_AREA);
        topRightFolder.addView(CONTROL_FLOW_VIEW_ID);
        topRightFolder.addView(RESOURCES_VIEW_ID);
        topRightFolder.addView(STATISTICS_VIEW_ID);

        // Create the middle right folder
        IFolderLayout middleRightFolder = layout.createFolder("middleRightFolder", IPageLayout.BOTTOM, 0.50f, "topRightFolder");
        middleRightFolder.addView(EVENTS_VIEW_ID);

        // Create the bottom right folder
        IFolderLayout bottomRightFolder = layout.createFolder("bottomRightFolder", IPageLayout.BOTTOM, 0.65f, "middleRightFolder");
        bottomRightFolder.addView(TIME_FRAME_VIEW_ID);
        bottomRightFolder.addView(HISTOGRAM_VIEW_ID);
        bottomRightFolder.addView(PROBLEM_VIEW_ID);

	}

    /**
     * Add fast views to the perspective
     * 
     * @param layout
     */
    private void addFastViews(IPageLayout layout) {
        // TODO Auto-generated method stub
    }

    /**
     * Add view shortcuts to the perspective
     * 
     * @param layout
     */
    private void addViewShortcuts(IPageLayout layout) {
        // TODO Auto-generated method stub
    }

    /**
     * Add perspective shortcuts to the perspective
     * 
     * @param layout
     */
    private void addPerspectiveShortcuts(IPageLayout layout) {
        // TODO Auto-generated method stub
    }

}

Back to the top