/*******************************************************************************
 * Copyright (c) 2012, 2015 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.lttng.scope.lttng.kernel.ui.views.internal;

import org.eclipse.tracecompass.tmf.ui.project.wizards.NewTmfProjectWizard;
import org.eclipse.tracecompass.tmf.ui.views.histogram.HistogramView;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
import org.lttng.scope.lttng.kernel.ui.views.controlflow.internal.ControlFlowView;
import org.lttng.scope.lttng.kernel.ui.views.resources.internal.ResourcesView;

/**
 * The default LTTng perspective.
 */
public class PerspectiveFactory implements IPerspectiveFactory {

    /** Perspective ID */
    public static final String ID = "org.eclipse.linuxtools.lttng2.kernel.ui.perspective"; //$NON-NLS-1$

    // LTTng views
    private static final String HISTOGRAM_VIEW_ID = HistogramView.ID;
    private static final String CONTROLFLOW_VIEW_ID = ControlFlowView.ID;
    private static final String RESOURCES_VIEW_ID = ResourcesView.ID;

    // Standard Eclipse views
    private static final String PROJECT_VIEW_ID = IPageLayout.ID_PROJECT_EXPLORER;
    private static final String PROPERTIES_VIEW_ID = IPageLayout.ID_PROP_SHEET;
    private static final String BOOKMARKS_VIEW_ID = IPageLayout.ID_BOOKMARKS;

    @Override
    public void createInitialLayout(IPageLayout layout) {

        layout.setEditorAreaVisible(true);

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

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

        // Create the top right folder
        IFolderLayout topRightFolder = layout.createFolder(
                "topRightFolder", IPageLayout.TOP, 0.40f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
        topRightFolder.addView(CONTROLFLOW_VIEW_ID);
        topRightFolder.addView(RESOURCES_VIEW_ID);

        // Create the bottom right folder
        IFolderLayout bottomRightFolder = layout.createFolder(
                "bottomRightFolder", IPageLayout.BOTTOM, 0.50f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$
        bottomRightFolder.addView(HISTOGRAM_VIEW_ID);
        bottomRightFolder.addView(PROPERTIES_VIEW_ID);
        bottomRightFolder.addView(BOOKMARKS_VIEW_ID);

        layout.addNewWizardShortcut(NewTmfProjectWizard.ID);
    }

    /**
     * Add fast views to the perspective
     *
     * @param layout
     */
    private void addFastViews(IPageLayout layout) {
    }

    /**
     * Add view shortcuts to the perspective
     *
     * @param layout
     */
    private void addViewShortcuts(IPageLayout layout) {
    }

    /**
     * Add perspective shortcuts to the perspective
     *
     * @param layout
     */
    private void addPerspectiveShortcuts(IPageLayout layout) {
    }

}

@@ -865,141 +865,39 @@
 ope.
-lttng.kernel.ui.views.controlflow.internal.ControlFlowView;%0Aimport org.lttng.scope.lttng.kernel.ui.views.resources.internal.Resources
+tmf2.views.ui.timeline.Timeline
 View
@@ -1231,152 +1231,8 @@
 .ID;
-%0A    private static final String CONTROLFLOW_VIEW_ID = ControlFlowView.ID;%0A    private static final String RESOURCES_VIEW_ID = ResourcesView.ID;
 %0A%0A  
@@ -1622,114 +1622,8 @@
 );%0A%0A
-        addFastViews(layout);%0A        addViewShortcuts(layout);%0A        addPerspectiveShortcuts(layout);%0A%0A
     
@@ -1768,18 +1768,17 @@
 LEFT, 0.
-15
+2
 f, IPage
@@ -2020,10 +2020,9 @@
 , 0.
-40
+6
 f, I
@@ -2098,71 +2098,21 @@
 iew(
-CONTROLFLOW_VIEW_ID);%0A        topRightFolder.addView(RESOURCES_
+TimelineView.
 VIEW
@@ -2286,10 +2286,9 @@
 , 0.
-50
+6
 f, I
@@ -2565,468 +2565,6 @@
  %7D%0A%0A
-    /**%0A     * Add fast views to the perspective%0A     *%0A     * @param layout%0A     */%0A    private void addFastViews(IPageLayout layout) %7B%0A    %7D%0A%0A    /**%0A     * Add view shortcuts to the perspective%0A     *%0A     * @param layout%0A     */%0A    private void addViewShortcuts(IPageLayout layout) %7B%0A    %7D%0A%0A    /**%0A     * Add perspective shortcuts to the perspective%0A     *%0A     * @param layout%0A     */%0A    private void addPerspectiveShortcuts(IPageLayout layout) %7B%0A    %7D%0A%0A
 %7D%0A

Use the Timeline View in the kernel perspective