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.LayoutView; 22 import com.android.ide.eclipse.hierarchyviewer.views.PropertyView; 23 import com.android.ide.eclipse.hierarchyviewer.views.TreeOverviewView; 24 import com.android.ide.eclipse.hierarchyviewer.views.TreeViewView; 25 26 import org.eclipse.ui.IFolderLayout; 27 import org.eclipse.ui.IPageLayout; 28 import org.eclipse.ui.IPerspectiveFactory; 29 30 public class TreeViewPerspective implements IPerspectiveFactory { 31 32 public static final String ID = "com.android.ide.eclipse.hierarchyviewer.TreeViewPerspective"; //$NON-NLS-1$ 33 createInitialLayout(IPageLayout layout)34 public void createInitialLayout(IPageLayout layout) { 35 layout.setEditorAreaVisible(false); 36 37 String editorArea = layout.getEditorArea(); 38 IFolderLayout folder; 39 40 folder = layout.createFolder("properties", IPageLayout.LEFT, 0.10f, editorArea); //$NON-NLS-1$ 41 folder.addView(DeviceSelectorView.ID); 42 folder.addView(PropertyView.ID); 43 44 folder = layout.createFolder("main", IPageLayout.RIGHT, 0.24f, "properties"); //$NON-NLS-1$ //$NON-NLS-2$ 45 folder.addView(TreeViewView.ID); 46 47 folder = layout.createFolder("panel-top", IPageLayout.RIGHT, 0.7f, "main"); //$NON-NLS-1$ //$NON-NLS-2$ 48 folder.addView(TreeOverviewView.ID); 49 50 51 folder = layout.createFolder("panel-bottom", IPageLayout.BOTTOM, 0.5f, "panel-top"); //$NON-NLS-1$ //$NON-NLS-2$ 52 folder.addView(LayoutView.ID); 53 54 layout.addShowViewShortcut(DeviceSelectorView.ID); 55 layout.addShowViewShortcut(PropertyView.ID); 56 layout.addShowViewShortcut(TreeOverviewView.ID); 57 layout.addShowViewShortcut(LayoutView.ID); 58 layout.addShowViewShortcut(TreeViewView.ID); 59 60 layout.addPerspectiveShortcut("org.eclipse.jdt.ui.JavaPerspective"); //$NON-NLS-1$ 61 layout.addPerspectiveShortcut(PixelPerfectPespective.ID); 62 layout.addPerspectiveShortcut(Perspective.ID); 63 } 64 65 } 66