aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse
diff options
context:
space:
mode:
authorSiva Velusamy <vsiva@google.com>2012-04-30 15:12:15 -0700
committerSiva Velusamy <vsiva@google.com>2012-05-03 13:38:44 -0700
commit231d5ea266e58657282865b1166e329fd333dcd1 (patch)
tree84c78df23b543cb7fc959bcabb7b041eb441d7c7 /eclipse
parent42ba62270d9102024f4400923eba4ce46a951163 (diff)
downloadsdk-231d5ea266e58657282865b1166e329fd333dcd1.zip
sdk-231d5ea266e58657282865b1166e329fd333dcd1.tar.gz
sdk-231d5ea266e58657282865b1166e329fd333dcd1.tar.bz2
logcat: Remove JFace TableViewer and use SWT Table directly
This patch fixes a bunch of outstanding issues related to scrolling in the presence of a full buffer. Currently, the logbuffer is provided as the input model to the TableViewer, and ViewerFilter's are used to filter the data. This patch removes the JFace toolkit and directly works on the SWT Table. When log messages arrive, rather than refreshing the entire table, we can now just delete the TableItems corresponding to the logs that were pushed out, and add new TableItems for the incoming logs. At steady state, this implementation performs far less work than the previous implementation. However, during startup, this implementation will perform more work since it does not use the SWT.VIRTUAL bit (as all TableItems are created anyway). Also, zebra striping has been removed to avoid appearance of flicker when scroll lock is on. Auto scroll lock behavior has been removed, and scroll lock button behaves exactly like the scroll lock button in an Eclipse console. Change-Id: Ic14487f7ad41338a581aed0ba2d85d292a584950
Diffstat (limited to 'eclipse')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/LogCatMonitor.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/LogCatMonitor.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/LogCatMonitor.java
index f9c94a7..1e50822 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/LogCatMonitor.java
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/LogCatMonitor.java
@@ -19,7 +19,7 @@ import com.android.ddmlib.AndroidDebugBridge;
import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener;
import com.android.ddmlib.IDevice;
import com.android.ddmlib.Log.LogLevel;
-import com.android.ddmuilib.logcat.ILogCatMessageEventListener;
+import com.android.ddmuilib.logcat.ILogCatBufferChangeListener;
import com.android.ddmuilib.logcat.LogCatMessage;
import com.android.ddmuilib.logcat.LogCatReceiver;
import com.android.ddmuilib.logcat.LogCatReceiverFactory;
@@ -98,7 +98,7 @@ public class LogCatMonitor {
return;
}
- data.receiver.removeMessageReceivedEventListener(data.messageEventListener);
+ data.receiver.removeMessageReceivedEventListener(data.bufferChangeListener);
}
public void monitorDevice(final IDevice device) {
@@ -113,10 +113,11 @@ public class LogCatMonitor {
}
LogCatReceiver r = LogCatReceiverFactory.INSTANCE.newReceiver(device, mPrefStore);
- ILogCatMessageEventListener l = new ILogCatMessageEventListener() {
+ ILogCatBufferChangeListener l = new ILogCatBufferChangeListener() {
@Override
- public void messageReceived(List<LogCatMessage> receivedMessages) {
- checkMessages(receivedMessages, device);
+ public void bufferChanged(List<LogCatMessage> addedMessages,
+ List<LogCatMessage> deletedMessages) {
+ checkMessages(addedMessages, device);
}
};
r.addMessageReceivedEventListener(l);
@@ -205,11 +206,11 @@ public class LogCatMonitor {
private static class DeviceData {
public final LogCatReceiver receiver;
- public final ILogCatMessageEventListener messageEventListener;
+ public final ILogCatBufferChangeListener bufferChangeListener;
- public DeviceData(LogCatReceiver r, ILogCatMessageEventListener l) {
+ public DeviceData(LogCatReceiver r, ILogCatBufferChangeListener l) {
receiver = r;
- messageEventListener = l;
+ bufferChangeListener = l;
}
}
}