Home | History | Annotate | Download | only in ui
      1 /*******************************************************************************
      2  * Copyright (c) 2000, 2009 IBM Corporation and others.
      3  * All rights reserved. This program and the accompanying materials
      4  * are made available under the terms of the Eclipse Public License v1.0
      5  * which accompanies this distribution, and is available at
      6  * http://www.eclipse.org/legal/epl-v10.html
      7  *
      8  * Contributors:
      9  *     IBM Corporation - initial API and implementation
     10  *******************************************************************************/
     11 package org.eclipse.test.internal.performance.results.ui;
     12 
     13 import org.eclipse.ui.IFolderLayout;
     14 import org.eclipse.ui.IPageLayout;
     15 import org.eclipse.ui.IPerspectiveFactory;
     16 
     17 /**
     18  *  Defines the 'Performances' perspective.
     19  */
     20 public class PerformanceResultsPerspective implements IPerspectiveFactory {
     21 
     22 	private IPageLayout factory;
     23 
     24 /*
     25  * (non-Javadoc)
     26  * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
     27  */
     28 public void createInitialLayout(IPageLayout layout) {
     29 	this.factory = layout;
     30 	addViews();
     31 }
     32 
     33 /*
     34  * Add views to the perspective
     35  */
     36 private void addViews() {
     37 
     38 	// Component results view put on bottom
     39 	IFolderLayout bottom =
     40 		this.factory.createFolder(
     41 			"bottomRight", //NON-NLS-1
     42 			IPageLayout.BOTTOM,
     43 			0.5f,
     44 			this.factory.getEditorArea());
     45 	bottom.addView("org.eclipse.test.internal.performance.results.ui.ComponentsResultsView");
     46 
     47 	// Components and Builds view put on perspective top left
     48 	IFolderLayout topLeft =
     49 		this.factory.createFolder(
     50 			"topLeft", //NON-NLS-1
     51 			IPageLayout.LEFT,
     52 			0.5f,
     53 			this.factory.getEditorArea());
     54 	topLeft.addView("org.eclipse.test.internal.performance.results.ui.ComponentsView"); //NON-NLS-1
     55 	topLeft.addView("org.eclipse.test.internal.performance.results.ui.BuildsView"); //NON-NLS-1
     56 
     57 	// Properties view put on perspective top right
     58 	IFolderLayout topRight =
     59 		this.factory.createFolder(
     60 			"topRight", //NON-NLS-1
     61 			IPageLayout.RIGHT,
     62 			0.5f,
     63 			this.factory.getEditorArea());
     64 	topRight.addView(IPageLayout.ID_PROP_SHEET); //NON-NLS-1
     65 
     66 	this.factory.setEditorAreaVisible(false);
     67 }
     68 
     69 }
     70