From 694bd732f6efcecc6a2cdfe2eb4a39e1a8db2e55 Mon Sep 17 00:00:00 2001 From: Siva Velusamy Date: Tue, 21 Feb 2012 17:10:11 -0800 Subject: ddms: Add Network Stats View Change-Id: I89bf6b84a2ef2ed9a876eec41fae9a974ba93137 --- .../icons/networkstats.png | Bin 0 -> 476 bytes .../com.android.ide.eclipse.ddms/plugin.properties | 1 + .../com.android.ide.eclipse.ddms/plugin.xml | 8 ++++ .../com/android/ide/eclipse/ddms/Perspective.java | 3 ++ .../eclipse/ddms/views/NetworkStatisticsView.java | 47 +++++++++++++++++++++ 5 files changed, 59 insertions(+) create mode 100644 eclipse/plugins/com.android.ide.eclipse.ddms/icons/networkstats.png create mode 100644 eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/NetworkStatisticsView.java (limited to 'eclipse/plugins') diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/icons/networkstats.png b/eclipse/plugins/com.android.ide.eclipse.ddms/icons/networkstats.png new file mode 100644 index 0000000..7018705 Binary files /dev/null and b/eclipse/plugins/com.android.ide.eclipse.ddms/icons/networkstats.png differ diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/plugin.properties b/eclipse/plugins/com.android.ide.eclipse.ddms/plugin.properties index 5a37fd5..6fd8e50 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/plugin.properties +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/plugin.properties @@ -9,6 +9,7 @@ view.name.Heap = Heap view.name.File_Explorer = File Explorer view.name.Emulator_Control = Emulator Control view.name.Allocation_Tracker = Allocation Tracker +view.name.Network_Stats = Network Statistics perspective.name.DDMS = DDMS page.name.DDMS = DDMS page.name.LogCat = LogCat diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/plugin.xml b/eclipse/plugins/com.android.ide.eclipse.ddms/plugin.xml index 1255b62..c1d43ae 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/plugin.xml +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/plugin.xml @@ -79,6 +79,14 @@ icon="icons/heap.png" id="com.android.ide.eclipse.ddms.views.AllocTrackerView" name="%view.name.Allocation_Tracker"/> + + 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 4f3494c..d86a526 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 @@ -22,6 +22,7 @@ import com.android.ide.eclipse.ddms.views.EmulatorControlView; import com.android.ide.eclipse.ddms.views.FileExplorerView; import com.android.ide.eclipse.ddms.views.HeapView; import com.android.ide.eclipse.ddms.views.LogCatView; +import com.android.ide.eclipse.ddms.views.NetworkStatisticsView; import com.android.ide.eclipse.ddms.views.ThreadView; import org.eclipse.ui.IFolderLayout; @@ -63,6 +64,7 @@ public class Perspective implements IPerspectiveFactory { folder.addView(ThreadView.ID); folder.addView(HeapView.ID); folder.addView(AllocTrackerView.ID); + folder.addView(NetworkStatisticsView.ID); folder.addView(FileExplorerView.ID); layout.addPerspectiveShortcut("org.eclipse.ui.resourcePerspective"); //$NON-NLS-1$ @@ -75,6 +77,7 @@ public class Perspective implements IPerspectiveFactory { layout.addShowViewShortcut(AllocTrackerView.ID); layout.addShowViewShortcut(LogCatView.ID); layout.addShowViewShortcut(ThreadView.ID); + layout.addShowViewShortcut(NetworkStatisticsView.ID); layout.addShowViewShortcut(IPageLayout.ID_RES_NAV); layout.addShowViewShortcut(IPageLayout.ID_BOOKMARKS); diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/NetworkStatisticsView.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/NetworkStatisticsView.java new file mode 100644 index 0000000..f90189c --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/NetworkStatisticsView.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2012 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.net.NetworkPanel; + +import org.eclipse.swt.widgets.Composite; + +public class NetworkStatisticsView extends TableView { + public static final String ID = "com.android.ide.eclipse.ddms.views.NetworkStatsView"; + + private NetworkPanel mPanel; + + public NetworkStatisticsView() { + } + + @Override + public void createPartControl(Composite parent) { + mPanel = new NetworkPanel(); + mPanel.createPanel(parent); + + setSelectionDependentPanel(mPanel); + + // listen to focus changes for table(s) of the panel. + setupTableFocusListener(mPanel, parent); + } + + @Override + public void setFocus() { + mPanel.setFocus(); + } + +} -- cgit v1.1