• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2007 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.ddms;
18 
19 import com.android.ide.eclipse.ddms.i18n.Messages;
20 import com.android.ide.eclipse.ddms.views.AllocTrackerView;
21 import com.android.ide.eclipse.ddms.views.DeviceView;
22 import com.android.ide.eclipse.ddms.views.EmulatorControlView;
23 import com.android.ide.eclipse.ddms.views.FileExplorerView;
24 import com.android.ide.eclipse.ddms.views.HeapView;
25 import com.android.ide.eclipse.ddms.views.LogCatView;
26 import com.android.ide.eclipse.ddms.views.ThreadView;
27 
28 import org.eclipse.ui.IFolderLayout;
29 import org.eclipse.ui.IPageLayout;
30 import org.eclipse.ui.IPerspectiveFactory;
31 
32 public class Perspective implements IPerspectiveFactory {
33 
34     public static String ID = "com.android.ide.eclipse.ddms.Perspective"; //$NON-NLS-1$
35 
createInitialLayout(IPageLayout layout)36     public void createInitialLayout(IPageLayout layout) {
37         // create a default layout that looks like the stand alone DDMS.
38 
39         // no editor window
40         layout.setEditorAreaVisible(false);
41 
42         String editorArea = layout.getEditorArea();
43         IFolderLayout folder;
44 
45         folder = layout.createFolder("logcat", IPageLayout.BOTTOM, 0.8f, //$NON-NLS-1$
46                 editorArea);
47         folder.addPlaceholder(LogCatView.ID + ":*"); //$NON-NLS-1$
48         folder.addView(LogCatView.ID);
49 
50         folder = layout.createFolder("devices", IPageLayout.LEFT, 0.3f, //$NON-NLS-1$
51                 editorArea);
52         folder.addPlaceholder(DeviceView.ID + ":*"); //$NON-NLS-1$
53         folder.addView(DeviceView.ID);
54 
55         folder = layout.createFolder("emulator", IPageLayout.BOTTOM, 0.5f, //$NON-NLS-1$
56                 "devices"); //$NON-NLS-1$
57         folder.addPlaceholder(EmulatorControlView.ID + ":*"); //$NON-NLS-1$
58         folder.addView(EmulatorControlView.ID);
59 
60         folder = layout.createFolder("ddms-detail", IPageLayout.RIGHT, 0.5f, //$NON-NLS-1$
61                 editorArea);
62         folder.addPlaceholder(ThreadView.ID + ":*"); //$NON-NLS-1$
63         folder.addView(ThreadView.ID);
64         folder.addView(HeapView.ID);
65         folder.addView(AllocTrackerView.ID);
66         folder.addView(FileExplorerView.ID);
67 
68         layout.addPerspectiveShortcut("org.eclipse.ui.resourcePerspective"); //$NON-NLS-1$
69         layout.addPerspectiveShortcut("org.eclipse.debug.ui.DebugPerspective"); //$NON-NLS-1$
70         layout.addPerspectiveShortcut("org.eclipse.jdt.ui.JavaPerspective"); //$NON-NLS-1$
71 
72         layout.addShowViewShortcut(DeviceView.ID);
73         layout.addShowViewShortcut(FileExplorerView.ID);
74         layout.addShowViewShortcut(HeapView.ID);
75         layout.addShowViewShortcut(AllocTrackerView.ID);
76         layout.addShowViewShortcut(LogCatView.ID);
77         layout.addShowViewShortcut(ThreadView.ID);
78 
79         layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
80         layout.addShowViewShortcut(IPageLayout.ID_BOOKMARKS);
81         layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
82         layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET);
83         layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
84         layout.addShowViewShortcut(IPageLayout.ID_PROGRESS_VIEW);
85         layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
86     }
87 }
88