aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse
diff options
context:
space:
mode:
authorSiva Velusamy <vsiva@google.com>2012-05-07 13:52:20 -0700
committerandroid code review <noreply-gerritcodereview@google.com>2012-05-07 13:52:20 -0700
commit6ab830e625ea25a23f1f27e9897f294b2177e1a2 (patch)
tree376618b52e474bccf12e174c9cdeca6b486836cf /eclipse
parent32ea87556eca0151638f2a002e71443892a7ea11 (diff)
parentfb9cf660de2d6316ba92a53e69d0fcbb81fbbdd3 (diff)
downloadsdk-6ab830e625ea25a23f1f27e9897f294b2177e1a2.zip
sdk-6ab830e625ea25a23f1f27e9897f294b2177e1a2.tar.gz
sdk-6ab830e625ea25a23f1f27e9897f294b2177e1a2.tar.bz2
Merge "Open hprof files if hprof content type is supported."
Diffstat (limited to 'eclipse')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferenceInitializer.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferenceInitializer.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferenceInitializer.java
index fa73dbc..cce470f 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferenceInitializer.java
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferenceInitializer.java
@@ -23,6 +23,8 @@ import com.android.ide.eclipse.ddms.views.LogCatView;
import com.android.ddmlib.DdmPreferences;
import com.android.ddmuilib.DdmUiPreferences;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.SWT;
@@ -106,7 +108,15 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
store.setDefault(ATTR_LOGCAT_FONT,
new FontData("Courier", 10, SWT.NORMAL).toString()); //$NON-NLS-1$
+ // When obtaining hprof files from the device, default to opening the file
+ // only if there is a registered content type for the hprof extension.
store.setDefault(ATTR_HPROF_ACTION, HProfHandler.ACTION_SAVE);
+ for (IContentType contentType: Platform.getContentTypeManager().getAllContentTypes()) {
+ if (contentType.isAssociatedWith(HProfHandler.DOT_HPROF)) {
+ store.setDefault(ATTR_HPROF_ACTION, HProfHandler.ACTION_OPEN);
+ break;
+ }
+ }
store.setDefault(ATTR_TIME_OUT, DdmPreferences.DEFAULT_TIMEOUT);