Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 81acb504c33947b8bfccbb5e71d5a9a088892e16 (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
/*******************************************************************************
 * Copyright (c) 2006, 2017 IBM Corporation and others.
 * 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:
 *     IBM Corporation - Jeff Briggs, Henry Hughes, Ryan Morse
 *******************************************************************************/

package org.eclipse.linuxtools.internal.systemtap.ui.ide;

import org.eclipse.linuxtools.internal.systemtap.ui.ide.views.FunctionBrowserView;
import org.eclipse.linuxtools.internal.systemtap.ui.ide.views.KernelBrowserView;
import org.eclipse.linuxtools.internal.systemtap.ui.ide.views.ProbeAliasBrowserView;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
import org.eclipse.ui.console.IConsoleConstants;

/**
 * The <code>IDEPerspective</code> class defines the layout of the IDE perspective
 * in the application.
 * @see org.eclipse.ui.IPerspectiveFactory
 * @author Ryan Morse
 */
public class IDEPerspective implements IPerspectiveFactory {
    public static final String ID = "org.eclipse.linuxtools.systemtap.ui.ide.IDEPerspective"; //$NON-NLS-1$

    @Override
    public void createInitialLayout(IPageLayout layout) {
        String editorArea = layout.getEditorArea();
        layout.setEditorAreaVisible(true);

        IFolderLayout browsers = layout.createFolder("browsers", IPageLayout.LEFT, 0.25f, editorArea); //$NON-NLS-1$
        browsers.addPlaceholder(ProbeAliasBrowserView.ID + ":*"); //$NON-NLS-1$

        browsers.addView(ProbeAliasBrowserView.ID);
        browsers.addView(FunctionBrowserView.ID);
        browsers.addView(KernelBrowserView.ID);
        browsers.addView(IPageLayout.ID_PROJECT_EXPLORER);


        layout.getViewLayout(ProbeAliasBrowserView.ID).setCloseable(false);
        layout.getViewLayout(FunctionBrowserView.ID).setCloseable(false);
        layout.getViewLayout(KernelBrowserView.ID).setCloseable(false);

        IFolderLayout output = layout.createFolder("output", IPageLayout.BOTTOM, 0.75f, editorArea); //$NON-NLS-1$
        output.addView(IConsoleConstants.ID_CONSOLE_VIEW);

        layout.getViewLayout(IConsoleConstants.ID_CONSOLE_VIEW).setCloseable(false);

        layout.addShowViewShortcut(ProbeAliasBrowserView.ID);
        layout.addShowViewShortcut(FunctionBrowserView.ID);
        layout.addShowViewShortcut(KernelBrowserView.ID);
        layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW);

        layout.addPerspectiveShortcut(ID);
    }
}

Back to the top