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