Perspective.java
Go to the documentation of this file.00001 package edu.rice.cs.hpc.viewer.framework;
00002
00003 import org.eclipse.swt.SWT;
00004 import org.eclipse.ui.IFolderLayout;
00005 import org.eclipse.ui.IPageLayout;
00006 import org.eclipse.ui.IPerspectiveFactory;
00007
00008 import edu.rice.cs.hpc.filter.view.FilterView;
00009 import edu.rice.cs.hpc.viewer.scope.bottomup.CallerScopeView;
00010 import edu.rice.cs.hpc.viewer.scope.flat.FlatScopeView;
00011 import edu.rice.cs.hpc.viewer.scope.topdown.ScopeView;
00012 import edu.rice.cs.hpc.viewer.window.ViewerWindow;
00013
00014
00015
00016
00017
00018
00019
00020 public class Perspective implements IPerspectiveFactory {
00021
00022 final private static String FOLDER_ID = "metricViews";
00023
00024
00025 private IFolderLayout[] objLayout = new IFolderLayout[ViewerWindow.maxDbNum];
00026
00027 public void createInitialLayout(IPageLayout layout) {
00028
00029 String editorArea = layout.getEditorArea();
00030 layout.setEditorAreaVisible(true);
00031 layout.setFixed(false);
00032
00033
00034
00035 for (int i=0 ; i<ViewerWindow.maxDbNum ; i++) {
00036 if (i==0) {
00037 objLayout[i] = layout.createFolder(FOLDER_ID + i, IPageLayout.BOTTOM, 0.6f, editorArea);
00038 } else {
00039 objLayout[i] = layout.createFolder(FOLDER_ID + i, IPageLayout.RIGHT, 0.3f, "metricViews"+ (i-1));
00040 }
00041 objLayout[i].addView(ScopeView.ID + ":" + i);
00042 objLayout[i].addView(CallerScopeView.ID + ":" + i);
00043 objLayout[i].addView(FlatScopeView.ID + ":" + i);
00044 }
00045 layout.addView(FilterView.ID, SWT.RIGHT, .5f, editorArea);
00046 }
00047
00048
00049
00050
00051
00052 public void createInitialLayout(IPageLayout layout, String baseViewId) {
00053 for (int i=0 ; i<ViewerWindow.maxDbNum ; i++) {
00054 objLayout[i].addPlaceholder(baseViewId + ":" + i);
00055 }
00056 }
00057 }