From 20f943f6268cd39ec5288bdb6a7cb766db51844b Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Fri, 10 Jun 2005 17:52:54 +0000 Subject: [PATCH] Bug 81353: automatically opening of the disassembly window. --- debug/org.eclipse.cdt.debug.ui/ChangeLog | 5 +++++ ...ggleInstructionStepModeActionDelegate.java | 21 ++++++++++++++++++- .../cdt/debug/ui/ICDebugUIConstants.java | 5 +++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/debug/org.eclipse.cdt.debug.ui/ChangeLog b/debug/org.eclipse.cdt.debug.ui/ChangeLog index 664d3c9fb9e..be717338f56 100644 --- a/debug/org.eclipse.cdt.debug.ui/ChangeLog +++ b/debug/org.eclipse.cdt.debug.ui/ChangeLog @@ -1,3 +1,8 @@ +2005-06-10 Mikhail Khodjaiants + Bug 81353: automatically opening of the disassembly window. + * ToggleInstructionStepModeActionDelegate.java + * ICDebugUIConstants.java + 2005-06-10 Mikhail Khodjaiants Warning cleanup. * AddExpressionEditorActionDelegate.java diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleInstructionStepModeActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleInstructionStepModeActionDelegate.java index d8b5d06ad2d..9805506a790 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleInstructionStepModeActionDelegate.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleInstructionStepModeActionDelegate.java @@ -11,6 +11,8 @@ package org.eclipse.cdt.debug.internal.ui.actions; import org.eclipse.cdt.debug.core.model.ICDebugTarget; +import org.eclipse.cdt.debug.ui.CDebugUIPlugin; +import org.eclipse.cdt.debug.ui.ICDebugUIConstants; import org.eclipse.core.runtime.Preferences.IPropertyChangeListener; import org.eclipse.core.runtime.Preferences.PropertyChangeEvent; import org.eclipse.debug.core.model.IDebugElement; @@ -21,6 +23,7 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.swt.widgets.Event; import org.eclipse.ui.IViewActionDelegate; import org.eclipse.ui.IViewPart; +import org.eclipse.ui.PartInitException; import org.eclipse.ui.actions.ActionDelegate; /** @@ -32,6 +35,8 @@ public class ToggleInstructionStepModeActionDelegate extends ActionDelegate impl private IAction fAction = null; + private IViewPart fView; + /* (non-Javadoc) * @see org.eclipse.core.runtime.Preferences.IPropertyChangeListener#propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent) */ @@ -50,6 +55,7 @@ public class ToggleInstructionStepModeActionDelegate extends ActionDelegate impl * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) */ public void init( IViewPart view ) { + fView = view; } /* (non-Javadoc) @@ -76,9 +82,18 @@ public class ToggleInstructionStepModeActionDelegate extends ActionDelegate impl * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ public void run( IAction action ) { + boolean enabled = getAction().isChecked(); ICDebugTarget target = getTarget(); if ( target != null ) { - target.enableInstructionStepping( getAction().isChecked() ); + target.enableInstructionStepping( enabled ); + if ( enabled ) { + try { + getView().getSite().getPage().showView( ICDebugUIConstants.ID_DISASSEMBLY_VIEW ); + } + catch( PartInitException e ) { + CDebugUIPlugin.log( e.getStatus() ); + } + } } } @@ -135,4 +150,8 @@ public class ToggleInstructionStepModeActionDelegate extends ActionDelegate impl } return null; } + + private IViewPart getView() { + return fView; + } } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/ICDebugUIConstants.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/ICDebugUIConstants.java index ba86d18489e..3bb87db6f0f 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/ICDebugUIConstants.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/ICDebugUIConstants.java @@ -21,6 +21,11 @@ public interface ICDebugUIConstants { public static final String PREFIX = PLUGIN_ID + "."; //$NON-NLS-1$ + /** + * Disassembly view identifier (value "org.eclipse.cdt.debug.ui.DisassemblyView"). + */ + public static final String ID_DISASSEMBLY_VIEW = PREFIX + "DisassemblyView"; //$NON-NLS-1$ + /** * Modules view identifier (value "org.eclipse.cdt.debug.ui.ModulesView"). */