aboutsummaryrefslogtreecommitdiffstats
path: root/ddms
diff options
context:
space:
mode:
authorSiva Velusamy <vsiva@google.com>2011-08-11 11:50:33 -0700
committerSiva Velusamy <vsiva@google.com>2011-08-11 13:16:37 -0700
commit421337231d14d2208759e5219a9beab13fa56105 (patch)
tree23830680ca665eaf89eded2b6d01c6b3618ba1b1 /ddms
parenta8af648c3d6cb37e80df4afcd8ea9d5874945bcd (diff)
downloadsdk-421337231d14d2208759e5219a9beab13fa56105.zip
sdk-421337231d14d2208759e5219a9beab13fa56105.tar.gz
sdk-421337231d14d2208759e5219a9beab13fa56105.tar.bz2
Support clearing all logcat messages from the table.
Change-Id: If7fb4b181974ddd0c1c41e54f7c76bfb6b2812bc
Diffstat (limited to 'ddms')
-rw-r--r--ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessageList.java7
-rw-r--r--ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPanel.java8
-rw-r--r--ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiver.java7
3 files changed, 21 insertions, 1 deletions
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessageList.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessageList.java
index 6adca85..ce9017d 100644
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessageList.java
+++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessageList.java
@@ -54,6 +54,13 @@ public final class LogCatMessageList {
}
/**
+ * Clear all messages in the list.
+ */
+ public synchronized void clear() {
+ mQ.clear();
+ }
+
+ /**
* Obtain all the messages currently present in the list.
* @return array containing all the log messages
*/
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPanel.java
index e326a05..3fd81a6 100644
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPanel.java
+++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPanel.java
@@ -345,11 +345,17 @@ public final class LogCatPanel extends SelectionDependentPanel
clearLog.setImage(
ImageLoader.getDdmUiLibLoader().loadImage(IMAGE_CLEAR_LOG, toolBar.getDisplay()));
clearLog.setToolTipText("Clear Log");
+ clearLog.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ mReceiver.clearMessages();
+ mViewer.refresh();
+ }
+ });
/* FIXME: Enable all the UI elements after adding support for user interaction with them. */
mLiveFilterText.setEnabled(false);
mLiveFilterLevelCombo.setEnabled(false);
- clearLog.setEnabled(false);
}
/**
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiver.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiver.java
index 9c737f9..e3c752c 100644
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiver.java
+++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiver.java
@@ -168,6 +168,13 @@ public final class LogCatReceiver {
}
/**
+ * Clear the list of messages received from the currently active device.
+ */
+ public void clearMessages() {
+ mLogMessages.clear();
+ }
+
+ /**
* Add to list of message event listeners.
* @param l listener to notified when messages are received from the device
*/