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