blob: 2ca83774622a8db0138d99f15ae98020cd7d1fc2 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2016, 2019 Chalmers | University of Gothenburg, rt-labs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Chalmers | University of Gothenburg and rt-labs - initial API and implementation and/or initial documentation
* Chalmers | University of Gothenburg - additional features, updated API
*******************************************************************************/
package org.eclipse.capra.ui.perspective;
import org.eclipse.capra.ui.views.SelectionView;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
/**
* Defines the Eclipse perspective for Capra, in particular the initial views
* that will be shown when the perspective is chosen.
*/
public class CapraPerspective implements IPerspectiveFactory {
private IPageLayout factory;
public void createInitialLayout(IPageLayout factory) {
this.factory = factory;
addViews();
}
private void addViews() {
IFolderLayout bottom = factory.createFolder("bottomRight", IPageLayout.BOTTOM, 0.6f, factory.getEditorArea());
bottom.addView(SelectionView.ID);
IFolderLayout topLeft = factory.createFolder("topLeft", IPageLayout.LEFT, 0.25f, factory.getEditorArea());
topLeft.addView(IPageLayout.ID_PROJECT_EXPLORER);
IFolderLayout topRight = factory.createFolder("topRight", IPageLayout.RIGHT, 0.75f, factory.getEditorArea());
topRight.addView(IPageLayout.ID_OUTLINE);
}
}