1 /*******************************************************************************
2 * Copyright (c) 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 * Vincent Perot - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.internal
.tmf
.pcap
.ui
;
15 import static org
.eclipse
.tracecompass
.common
.core
.NonNullUtils
.checkNotNull
;
17 import org
.eclipse
.jdt
.annotation
.Nullable
;
18 import org
.eclipse
.tracecompass
.internal
.tmf
.pcap
.ui
.stream
.StreamListView
;
19 import org
.eclipse
.tracecompass
.tmf
.ui
.project
.wizards
.NewTmfProjectWizard
;
20 import org
.eclipse
.tracecompass
.tmf
.ui
.views
.colors
.ColorsView
;
21 import org
.eclipse
.tracecompass
.tmf
.ui
.views
.filter
.FilterView
;
22 import org
.eclipse
.tracecompass
.tmf
.ui
.views
.histogram
.HistogramView
;
23 import org
.eclipse
.tracecompass
.tmf
.ui
.views
.statistics
.TmfStatisticsView
;
24 import org
.eclipse
.ui
.IFolderLayout
;
25 import org
.eclipse
.ui
.IPageLayout
;
26 import org
.eclipse
.ui
.IPerspectiveFactory
;
29 * The networking perspective definition.
31 * @author Vincent Perot
33 public class NetworkingPerspectiveFactory
implements IPerspectiveFactory
{
35 // ------------------------------------------------------------------------
37 // ------------------------------------------------------------------------
39 /** The Perspective ID */
40 public static final String ID
= "org.eclipse.linuxtools.tmf.pcap.ui.perspective.network"; //$NON-NLS-1$
43 private static final String PROJECT_VIEW_ID
= checkNotNull(IPageLayout
.ID_PROJECT_EXPLORER
);
44 private static final String PROPERTIES_VIEW_ID
= checkNotNull(IPageLayout
.ID_PROP_SHEET
);
45 private static final String BOOKMARKS_VIEW_ID
= checkNotNull(IPageLayout
.ID_BOOKMARKS
);
46 private static final String FILTER_VIEW_ID
= FilterView
.ID
;
47 private static final String HISTOGRAM_VIEW_ID
= HistogramView
.ID
;
48 private static final String STATISTICS_VIEW_ID
= TmfStatisticsView
.ID
;
49 private static final String COLOR_VIEW_ID
= ColorsView
.ID
;
50 private static final String STREAM_LIST_VIEW_ID
= StreamListView
.ID
;
52 // ------------------------------------------------------------------------
53 // IPerspectiveFactory
54 // ------------------------------------------------------------------------
57 public void createInitialLayout(@Nullable IPageLayout layout
) {
64 layout
.setEditorAreaVisible(true);
66 // Create the top left folder
67 IFolderLayout topLeftFolder
= layout
.createFolder("topLeftFolder", IPageLayout
.LEFT
, 0.15f
, IPageLayout
.ID_EDITOR_AREA
); //$NON-NLS-1$
68 topLeftFolder
.addView(PROJECT_VIEW_ID
);
70 // Create the middle right folder
71 IFolderLayout middleRightFolder
= layout
.createFolder("middleRightFolder", IPageLayout
.BOTTOM
, 0.40f
, IPageLayout
.ID_EDITOR_AREA
); //$NON-NLS-1$
72 middleRightFolder
.addView(PROPERTIES_VIEW_ID
);
73 middleRightFolder
.addView(HISTOGRAM_VIEW_ID
);
74 middleRightFolder
.addView(STATISTICS_VIEW_ID
);
75 middleRightFolder
.addView(COLOR_VIEW_ID
);
77 // Create the bottom right folder
78 IFolderLayout bottomRightFolder
= layout
.createFolder("bottomRightFolder", IPageLayout
.BOTTOM
, 0.65f
, "middleRightFolder"); //$NON-NLS-1$ //$NON-NLS-2$
79 bottomRightFolder
.addView(FILTER_VIEW_ID
);
80 bottomRightFolder
.addView(BOOKMARKS_VIEW_ID
);
81 bottomRightFolder
.addView(STREAM_LIST_VIEW_ID
);
83 // Populate menus, etc
84 layout
.addPerspectiveShortcut(ID
);
85 layout
.addNewWizardShortcut(NewTmfProjectWizard
.ID
);