OSDN Git Service

Save/Restore the width of all columns in the LogCatPanel table.
[android-x86/sdk.git] / ddms / app / src / com / android / ddms / UIThread.java
index 9931a93..0149739 100644 (file)
@@ -29,6 +29,7 @@ import com.android.ddmlib.ClientData.MethodProfilingStatus;
 import com.android.ddmlib.Log.ILogOutput;
 import com.android.ddmlib.Log.LogLevel;
 import com.android.ddmuilib.AllocationPanel;
+import com.android.ddmuilib.DdmUiPreferences;
 import com.android.ddmuilib.DevicePanel;
 import com.android.ddmuilib.EmulatorControlPanel;
 import com.android.ddmuilib.HeapPanel;
@@ -46,6 +47,8 @@ import com.android.ddmuilib.explorer.DeviceExplorer;
 import com.android.ddmuilib.handler.BaseFileHandler;
 import com.android.ddmuilib.handler.MethodProfilingHandler;
 import com.android.ddmuilib.log.event.EventLogPanel;
+import com.android.ddmuilib.logcat.LogCatPanel;
+import com.android.ddmuilib.logcat.LogCatReceiver;
 import com.android.ddmuilib.logcat.LogColors;
 import com.android.ddmuilib.logcat.LogFilter;
 import com.android.ddmuilib.logcat.LogPanel;
@@ -232,6 +235,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
     }
 
     private LogPanel mLogPanel; /* only valid when useOldLogCatView() == true */
+    private LogCatPanel mLogCatPanel; /* only valid when useOldLogCatView() == false */
 
     private ToolItemAction mCreateFilterAction;
     private ToolItemAction mDeleteFilterAction;
@@ -959,6 +963,8 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
 
         if (useOldLogCatView()) {
             createBottomPanel(bottomPanel);
+        } else {
+            createLogCatView(bottomPanel);
         }
 
         // form layout data
@@ -1359,6 +1365,15 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
         mLogPanel.startLogCat(mCurrentDevice);
     }
 
+    private void createLogCatView(Composite parent) {
+        mLogCatPanel = new LogCatPanel(new LogCatReceiver(), DdmUiPreferences.getStore());
+        mLogCatPanel.createPanel(parent);
+
+        if (mCurrentDevice != null) {
+            mLogCatPanel.deviceSelected(mCurrentDevice);
+        }
+    }
+
     /*
      * Create the contents of the left panel: a table of VMs.
      */
@@ -1701,6 +1716,8 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
             mEmulatorPanel.deviceSelected(mCurrentDevice);
             if (useOldLogCatView()) {
                 mLogPanel.deviceSelected(mCurrentDevice);
+            } else {
+                mLogCatPanel.deviceSelected(mCurrentDevice);
             }
             if (mEventLogPanel != null) {
                 mEventLogPanel.deviceSelected(mCurrentDevice);