diff options
author | Xavier Ducrohet <xav@android.com> | 2010-09-07 16:19:56 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2010-09-07 16:19:56 -0700 |
commit | 70f06667d8a0d73920fcc38ca722c2591607e5e4 (patch) | |
tree | f4d956f959afd79d532580f87c509c2d1d78e856 /eclipse/plugins | |
parent | 0662cb950e8e8a5e33ef8a6870f331d5ea452e1d (diff) | |
download | sdk-70f06667d8a0d73920fcc38ca722c2591607e5e4.zip sdk-70f06667d8a0d73920fcc38ca722c2591607e5e4.tar.gz sdk-70f06667d8a0d73920fcc38ca722c2591607e5e4.tar.bz2 |
Open the debug perspective when showing hprof files.
This prevents the creation of an editor area in the
ddms perspective (the only way to get rid of it later
seems to be to reset the perspective).
Change-Id: I1eb4a3f6a77f27cc462b18b9db43d27cfef09337
Diffstat (limited to 'eclipse/plugins')
2 files changed, 24 insertions, 2 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java index c2088df..afe04ae 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java @@ -16,8 +16,6 @@ package com.android.ide.eclipse.adt; -import com.android.ddmuilib.StackTracePanel; -import com.android.ddmuilib.StackTracePanel.ISourceRevealer; import com.android.ddmuilib.console.DdmConsole; import com.android.ddmuilib.console.IDdmConsole; import com.android.ide.eclipse.adt.internal.VersionCheck; diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java index f2033de..bbaded7 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java @@ -42,6 +42,8 @@ import com.android.ide.eclipse.ddms.preferences.PreferenceInitializer; import org.eclipse.core.filesystem.EFS; import org.eclipse.core.filesystem.IFileStore; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.Path; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; @@ -56,8 +58,12 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IActionBars; import org.eclipse.ui.ISharedImages; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.WorkbenchException; import org.eclipse.ui.ide.IDE; import org.eclipse.ui.part.ViewPart; @@ -228,6 +234,24 @@ public class DeviceView extends ViewPart implements IUiSelectionListener, IClien IFileStore fileStore = EFS.getLocalFileSystem().getStore(new Path(tempPath)); if (!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists()) { + // before we open the file in an editor window, we make sure the current + // workbench page has an editor area (typically the ddms perspective doesn't). + IWorkbench workbench = PlatformUI.getWorkbench(); + IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); + IWorkbenchPage page = window.getActivePage(); + if (page.isEditorAreaVisible() == false) { + IAdaptable input; + if (page != null) + input= page.getInput(); + else + input= ResourcesPlugin.getWorkspace().getRoot(); + try { + workbench.showPerspective("org.eclipse.debug.ui.DebugPerspective", + window, input); + } catch (WorkbenchException e) { + } + } + IDE.openEditorOnFileStore( getSite().getWorkbenchWindow().getActivePage(), fileStore); |