diff options
author | Xavier Ducrohet <xav@android.com> | 2009-12-08 15:27:43 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2009-12-08 15:27:43 -0800 |
commit | 1d6f06b48e5a5f04669e8f7c2be66a8e1b19aa99 (patch) | |
tree | 4f37cf6f627dc796fd4505bebb93a99e60f6aba8 /eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android | |
parent | 5e8170aca82ca20f3c4bb937ef3ef00387bfb131 (diff) | |
download | sdk-1d6f06b48e5a5f04669e8f7c2be66a8e1b19aa99.tar.gz |
Add the allocation tracker to the DDMS plug-in.
Change-Id: I294d92046fccdba71ba1b2ab4280014a7722e65e
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android')
2 files changed, 50 insertions, 0 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/Perspective.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/Perspective.java index 4c01e9b8d..b582ee2dc 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/Perspective.java +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/Perspective.java @@ -15,6 +15,7 @@ */ package com.android.ide.eclipse.ddms; +import com.android.ide.eclipse.ddms.views.AllocTrackerView; import com.android.ide.eclipse.ddms.views.DeviceView; import com.android.ide.eclipse.ddms.views.EmulatorControlView; import com.android.ide.eclipse.ddms.views.FileExplorerView; @@ -57,6 +58,7 @@ public class Perspective implements IPerspectiveFactory { folder.addPlaceholder(ThreadView.ID + ":*"); //$NON-NLS-1$ folder.addView(ThreadView.ID); folder.addView(HeapView.ID); + folder.addView(AllocTrackerView.ID); folder.addView(FileExplorerView.ID); layout.addPerspectiveShortcut("org.eclipse.ui.resourcePerspective"); //$NON-NLS-1$ @@ -66,6 +68,7 @@ public class Perspective implements IPerspectiveFactory { layout.addShowViewShortcut(DeviceView.ID); layout.addShowViewShortcut(FileExplorerView.ID); layout.addShowViewShortcut(HeapView.ID); + layout.addShowViewShortcut(AllocTrackerView.ID); layout.addShowViewShortcut(LogCatView.ID); layout.addShowViewShortcut(ThreadView.ID); diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/AllocTrackerView.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/AllocTrackerView.java new file mode 100644 index 000000000..e8b73ff51 --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/AllocTrackerView.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2007 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.ide.eclipse.ddms.views; + +import com.android.ddmuilib.AllocationPanel; + +import org.eclipse.swt.widgets.Composite; + +public class AllocTrackerView extends TableView { + + public static final String ID = "com.android.ide.eclipse.ddms.views.AllocTrackerView"; //$NON-NLS-1$ + private AllocationPanel mPanel; + + public AllocTrackerView() { + } + + @Override + public void createPartControl(Composite parent) { + mPanel = new AllocationPanel(); + mPanel.createPanel(parent); + + setSelectionDependentPanel(mPanel); + + // listen to focus changes for table(s) of the panel. + setupTableFocusListener(mPanel, parent); + } + + @Override + public void setFocus() { + mPanel.setFocus(); + } + +} |