Commit | Line | Data |
---|---|---|
6e512b93 ASL |
1 | /******************************************************************************* |
2 | * Copyright (c) 2009 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 | *******************************************************************************/ | |
12 | ||
13 | package org.eclipse.linuxtools.lttng.ui.views; | |
14 | ||
62d1696a FC |
15 | import org.eclipse.linuxtools.lttng.ui.views.control.ControlView; |
16 | import org.eclipse.linuxtools.lttng.ui.views.controlflow.ControlFlowView; | |
17 | import org.eclipse.linuxtools.lttng.ui.views.events.EventsView; | |
18 | import org.eclipse.linuxtools.lttng.ui.views.histogram.HistogramView; | |
19 | import org.eclipse.linuxtools.lttng.ui.views.project.ProjectView; | |
20 | import org.eclipse.linuxtools.lttng.ui.views.resources.ResourcesView; | |
21 | import org.eclipse.linuxtools.lttng.ui.views.statistics.StatisticsView; | |
22 | import org.eclipse.linuxtools.lttng.ui.views.timeframe.TimeFrameView; | |
6e512b93 ASL |
23 | import org.eclipse.ui.IFolderLayout; |
24 | import org.eclipse.ui.IPageLayout; | |
25 | import org.eclipse.ui.IPerspectiveFactory; | |
26 | ||
27 | /** | |
28 | * <b><u>PerspectiveFactory</u></b> | |
29 | * <p> | |
30 | * TODO: Implement me. Please. | |
31 | */ | |
32 | public class PerspectiveFactory implements IPerspectiveFactory { | |
33 | ||
f9673903 | 34 | // Perspective ID |
3b38ea61 | 35 | public static final String ID = "org.eclipse.linuxtools.lttng.ui.perspective"; //$NON-NLS-1$ |
f9673903 | 36 | |
6e512b93 | 37 | // LTTng views |
62d1696a FC |
38 | private static final String PROJECT_VIEW_ID = ProjectView.ID; |
39 | private static final String CONTROL_VIEW_ID = ControlView.ID; | |
40 | private static final String EVENTS_VIEW_ID = EventsView.ID; | |
41 | private static final String TIME_FRAME_VIEW_ID = TimeFrameView.ID; | |
42 | private static final String CONTROL_FLOW_VIEW_ID = ControlFlowView.ID; | |
43 | private static final String RESOURCES_VIEW_ID = ResourcesView.ID; | |
44 | private static final String STATISTICS_VIEW_ID = StatisticsView.ID; | |
45 | private static final String HISTOGRAM_VIEW_ID = HistogramView.ID; | |
6e512b93 ASL |
46 | |
47 | // Standard Eclipse views | |
48 | private static final String PROPERTIES_VIEW_ID = IPageLayout.ID_PROP_SHEET; | |
49 | private static final String PROBLEM_VIEW_ID = IPageLayout.ID_PROBLEM_VIEW; | |
50 | ||
51 | /* (non-Javadoc) | |
52 | * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout) | |
53 | */ | |
d4011df2 | 54 | @Override |
6e512b93 ASL |
55 | public void createInitialLayout(IPageLayout layout) { |
56 | ||
57 | layout.setEditorAreaVisible(false); | |
58 | ||
59 | addFastViews(layout); | |
60 | addViewShortcuts(layout); | |
61 | addPerspectiveShortcuts(layout); | |
62 | ||
63 | // Create the top left folder | |
3b38ea61 | 64 | IFolderLayout topLeftFolder = layout.createFolder("topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ |
6e512b93 ASL |
65 | topLeftFolder.addView(PROJECT_VIEW_ID); |
66 | topLeftFolder.addView(CONTROL_VIEW_ID); | |
67 | ||
68 | // Create the bottom left folder | |
3b38ea61 | 69 | IFolderLayout bottomLeftFolder = layout.createFolder("bottomLeftFolder", IPageLayout.BOTTOM, 0.50f, "topLeftFolder"); //$NON-NLS-1$ //$NON-NLS-2$ |
6e512b93 ASL |
70 | bottomLeftFolder.addView(PROPERTIES_VIEW_ID); |
71 | ||
72 | // Create the middle right folder | |
3b38ea61 | 73 | IFolderLayout topRightFolder = layout.createFolder("topRightFolder", IPageLayout.TOP, 0.50f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ |
6e512b93 ASL |
74 | topRightFolder.addView(CONTROL_FLOW_VIEW_ID); |
75 | topRightFolder.addView(RESOURCES_VIEW_ID); | |
76 | topRightFolder.addView(STATISTICS_VIEW_ID); | |
77 | ||
78 | // Create the middle right folder | |
3b38ea61 | 79 | IFolderLayout middleRightFolder = layout.createFolder("middleRightFolder", IPageLayout.BOTTOM, 0.50f, "topRightFolder"); //$NON-NLS-1$//$NON-NLS-2$ |
6e512b93 ASL |
80 | middleRightFolder.addView(EVENTS_VIEW_ID); |
81 | ||
82 | // Create the bottom right folder | |
3b38ea61 | 83 | IFolderLayout bottomRightFolder = layout.createFolder("bottomRightFolder", IPageLayout.BOTTOM, 0.65f, "middleRightFolder"); //$NON-NLS-1$ //$NON-NLS-2$ |
6e512b93 ASL |
84 | bottomRightFolder.addView(TIME_FRAME_VIEW_ID); |
85 | bottomRightFolder.addView(HISTOGRAM_VIEW_ID); | |
86 | bottomRightFolder.addView(PROBLEM_VIEW_ID); | |
87 | ||
88 | } | |
89 | ||
90 | /** | |
91 | * Add fast views to the perspective | |
92 | * | |
93 | * @param layout | |
94 | */ | |
95 | private void addFastViews(IPageLayout layout) { | |
96 | // TODO Auto-generated method stub | |
97 | } | |
98 | ||
99 | /** | |
100 | * Add view shortcuts to the perspective | |
101 | * | |
102 | * @param layout | |
103 | */ | |
104 | private void addViewShortcuts(IPageLayout layout) { | |
105 | // TODO Auto-generated method stub | |
106 | } | |
107 | ||
108 | /** | |
109 | * Add perspective shortcuts to the perspective | |
110 | * | |
111 | * @param layout | |
112 | */ | |
113 | private void addPerspectiveShortcuts(IPageLayout layout) { | |
114 | // TODO Auto-generated method stub | |
115 | } | |
116 | ||
117 | } |