aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse
diff options
context:
space:
mode:
authorSiva Velusamy <vsiva@google.com>2012-02-22 08:56:52 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-22 08:56:52 -0800
commit469d3f0c294da5380c4765ae2f48aaf9fe345e7f (patch)
treedb08b65baac48206599726fa03a77b065a7b9a5c /eclipse
parente890c844ab80c80e304ed5ee233cf1a72a993811 (diff)
parent694bd732f6efcecc6a2cdfe2eb4a39e1a8db2e55 (diff)
downloadsdk-469d3f0c294da5380c4765ae2f48aaf9fe345e7f.zip
sdk-469d3f0c294da5380c4765ae2f48aaf9fe345e7f.tar.gz
sdk-469d3f0c294da5380c4765ae2f48aaf9fe345e7f.tar.bz2
Merge "ddms: Add Network Stats View"
Diffstat (limited to 'eclipse')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.ddms/icons/networkstats.pngbin0 -> 476 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.ddms/plugin.properties1
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.ddms/plugin.xml8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/Perspective.java3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/NetworkStatisticsView.java47
5 files changed, 59 insertions, 0 deletions
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
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/icons/networkstats.png
Binary files 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"/>
+ <view
+ category="com.android.ide.eclipse.ddms.views.category"
+ class="com.android.ide.eclipse.ddms.views.NetworkStatisticsView"
+ icon="icons/networkstats.png"
+ id="com.android.ide.eclipse.ddms.views.NetworkStatsView"
+ name="%view.name.Network_Stats"
+ restorable="true">
+ </view>
</extension>
<extension
point="org.eclipse.ui.perspectives">
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();
+ }
+
+}