1 /* 2 * Copyright (C) 2010 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.ide.eclipse.hierarchyviewer; 18 19 import com.android.ide.eclipse.ddms.Perspective; 20 import com.android.ide.eclipse.hierarchyviewer.views.DeviceSelectorView; 21 import com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectLoupeView; 22 import com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectTreeView; 23 import com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectView; 24 25 import org.eclipse.ui.IFolderLayout; 26 import org.eclipse.ui.IPageLayout; 27 import org.eclipse.ui.IPerspectiveFactory; 28 29 public class PixelPerfectPespective implements IPerspectiveFactory { 30 31 public static final String ID = 32 "com.android.ide.eclipse.hierarchyviewer.PixelPerfectPespective"; //$NON-NLS-1$ 33 34 @Override createInitialLayout(IPageLayout layout)35 public void createInitialLayout(IPageLayout layout) { 36 layout.setEditorAreaVisible(false); 37 38 String editorArea = layout.getEditorArea(); 39 IFolderLayout folder; 40 41 folder = layout.createFolder("tree", IPageLayout.LEFT, 0.25f, editorArea); //$NON-NLS-1$ 42 folder.addView(DeviceSelectorView.ID); 43 folder.addView(PixelPerfectTreeView.ID); 44 45 folder = layout.createFolder("overview", IPageLayout.RIGHT, 0.4f, editorArea); //$NON-NLS-1$ 46 folder.addView(PixelPerfectView.ID); 47 48 folder = layout.createFolder("main", IPageLayout.RIGHT, 0.35f, editorArea); //$NON-NLS-1$ 49 folder.addView(PixelPerfectLoupeView.ID); 50 51 52 layout.addShowViewShortcut(DeviceSelectorView.ID); 53 layout.addShowViewShortcut(PixelPerfectTreeView.ID); 54 layout.addShowViewShortcut(PixelPerfectLoupeView.ID); 55 layout.addShowViewShortcut(PixelPerfectView.ID); 56 57 layout.addPerspectiveShortcut("org.eclipse.jdt.ui.JavaPerspective"); //$NON-NLS-1$ 58 layout.addPerspectiveShortcut(TreeViewPerspective.ID); 59 layout.addPerspectiveShortcut(Perspective.ID); 60 } 61 62 } 63