blob: 7b51ef7d80633a2e8b02251bdb1f3a1f047379a3 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2020 RBEI and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v. 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Pavithra Krishna Reddy - Initial contribution and API
*******************************************************************************/
package org.eclipse.blockchain.ui.perspective;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
/**
* Blockchain Perspective class
*/
public class BlockChainPerspectiveFactory implements IPerspectiveFactory {
/**
* The id of the Blockchain perspective
*/
public static final String BLOCKCHAIN_PERSPECTIVE = "org.eclipse.blockchain.ui.perspective";
public static final String RUN_TIME_VIEWID = "org.eclipse.blockchain.ui.runtimeView";
public static final String TRANSACTION_VIEWID = "org.eclipse.blockchain.ui.transactionView";
public static final String COMPILE_TIME_VIEWID = "org.eclipse.blockchain.ui.compileView";
public static final String CONSOLE_VIEW = "org.eclipse.ui.console.ConsoleView";
public static final String SERVER_VIEW = "org.eclipse.wst.server.ui.ServersView";
public static final String ERROR_LOG_VIEW = "org.eclipse.pde.runtime.LogView";
private final String TRANSACTION_VIEW_ID = "org.eclipse.blockchain.ui.TransactionHistoryView";
/**
* {@inheritDoc}
*/
@Override
public void createInitialLayout(final IPageLayout layout) {
String editorArea = layout.getEditorArea();
IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT,
0.25f, editorArea);
left.addView(IPageLayout.ID_PROJECT_EXPLORER);
IFolderLayout rightLayout = layout.createFolder("rightLayout",
IPageLayout.RIGHT, 0.75f, editorArea);
rightLayout.addView(COMPILE_TIME_VIEWID);
rightLayout.addPlaceholder(IPageLayout.ID_TASK_LIST);
// Add View in the bottom area in separate way
layout.addView(TRANSACTION_VIEWID, IPageLayout.RIGHT, 0.65f,
editorArea);
IFolderLayout bottom = layout.createFolder("bottom", IPageLayout.BOTTOM,
0.75f, editorArea);
bottom.addView(CONSOLE_VIEW);
bottom.addView(SERVER_VIEW);
bottom.addView(ERROR_LOG_VIEW);
bottom.addView(this.TRANSACTION_VIEW_ID);
}
}