mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-01 20:53:12 +02:00
[297387] [disassembly] When location combo box has focus, 'Home' key shouldn't jump to PC address
Patch from Navid Mehregani
This commit is contained in:
parent
1a64d13fda
commit
a326de8cbd
3 changed files with 36 additions and 8 deletions
|
@ -223,7 +223,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
// private static final String COMMAND_ID_RUN_TO_LINE = "org.eclipse.debug.ui.commands.RunToLine"; //$NON-NLS-1$
|
// private static final String COMMAND_ID_RUN_TO_LINE = "org.eclipse.debug.ui.commands.RunToLine"; //$NON-NLS-1$
|
||||||
// private static final String COMMAND_ID_TOGGLE_STEPPING_MODE = "org.eclipse.cdt.dsf.debug.ui.debug.ui.menu.showDisassemblyAction"; //$NON-NLS-1$
|
// private static final String COMMAND_ID_TOGGLE_STEPPING_MODE = "org.eclipse.cdt.dsf.debug.ui.debug.ui.menu.showDisassemblyAction"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String KEY_BINDING_CONTEXT_DISASSEMBLY = "org.eclipse.cdt.dsf.debug.ui.disassembly.context"; //$NON-NLS-1$
|
public static final String KEY_BINDING_CONTEXT_DISASSEMBLY = "org.eclipse.cdt.dsf.debug.ui.disassembly.context"; //$NON-NLS-1$
|
||||||
|
|
||||||
protected DisassemblyViewer fViewer;
|
protected DisassemblyViewer fViewer;
|
||||||
|
|
||||||
|
@ -749,10 +749,9 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
handlerService.deactivateHandlers(fHandlerActivations);
|
handlerService.deactivateHandlers(fHandlerActivations);
|
||||||
fHandlerActivations = null;
|
fHandlerActivations = null;
|
||||||
}
|
}
|
||||||
if (fContextActivation != null) {
|
|
||||||
IContextService ctxService = (IContextService)site.getService(IContextService.class);
|
deactivateDisassemblyContext();
|
||||||
ctxService.deactivateContext(fContextActivation);
|
|
||||||
}
|
|
||||||
fViewer = null;
|
fViewer = null;
|
||||||
setDebugContext(null);
|
setDebugContext(null);
|
||||||
DsfSession.removeSessionEndedListener(this);
|
DsfSession.removeSessionEndedListener(this);
|
||||||
|
@ -1187,8 +1186,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
private void contributeToActionBars() {
|
private void contributeToActionBars() {
|
||||||
IWorkbenchPartSite site = getSite();
|
IWorkbenchPartSite site = getSite();
|
||||||
site.setSelectionProvider(new DisassemblySelectionProvider(this));
|
site.setSelectionProvider(new DisassemblySelectionProvider(this));
|
||||||
IContextService ctxService = (IContextService)site.getService(IContextService.class);
|
activateDisassemblyContext();
|
||||||
fContextActivation = ctxService.activateContext(KEY_BINDING_CONTEXT_DISASSEMBLY);
|
|
||||||
contributeToActionBars(getActionBars());
|
contributeToActionBars(getActionBars());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3410,4 +3408,16 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
messageDialog.open();
|
messageDialog.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void activateDisassemblyContext() {
|
||||||
|
IContextService ctxService = (IContextService)getSite().getService(IContextService.class);
|
||||||
|
if (ctxService!=null)
|
||||||
|
fContextActivation = ctxService.activateContext(KEY_BINDING_CONTEXT_DISASSEMBLY);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deactivateDisassemblyContext() {
|
||||||
|
if (fContextActivation != null) {
|
||||||
|
IContextService ctxService = (IContextService)getSite().getService(IContextService.class);
|
||||||
|
ctxService.deactivateContext(fContextActivation);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,6 +232,11 @@ public class AddressBarContributionItem extends ContributionItem {
|
||||||
};
|
};
|
||||||
|
|
||||||
public void focusGained(FocusEvent e) {
|
public void focusGained(FocusEvent e) {
|
||||||
|
// [nmehregani] bugzilla 297387: 'Home' shouldn't jump to PC address when focus is on location combo box
|
||||||
|
if (action instanceof JumpToAddressAction)
|
||||||
|
((JumpToAddressAction)action).deactivateDisassemblyContext();
|
||||||
|
// end 297387
|
||||||
|
|
||||||
// Erase the guide text when the focus is gained.
|
// Erase the guide text when the focus is gained.
|
||||||
if (addressBox.getText().trim().equals(initialText))
|
if (addressBox.getText().trim().equals(initialText))
|
||||||
addressBox.setText(""); //$NON-NLS-1$
|
addressBox.setText(""); //$NON-NLS-1$
|
||||||
|
@ -241,6 +246,11 @@ public class AddressBarContributionItem extends ContributionItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void focusLost(FocusEvent e) {
|
public void focusLost(FocusEvent e) {
|
||||||
|
// [nmehregani] bugzilla 297387: 'Home' shouldn't jump to PC address when focus is on location combo box
|
||||||
|
if (action instanceof JumpToAddressAction)
|
||||||
|
((JumpToAddressAction)action).activateDisassemblyContext();
|
||||||
|
// end 297387
|
||||||
|
|
||||||
// Re-insert the guide text when the focus is lost and the text
|
// Re-insert the guide text when the focus is lost and the text
|
||||||
// field is empty.
|
// field is empty.
|
||||||
if (addressBox.getText().trim().length() == 0)
|
if (addressBox.getText().trim().length() == 0)
|
||||||
|
|
|
@ -61,4 +61,12 @@ public class JumpToAddressAction extends Action {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void activateDisassemblyContext() {
|
||||||
|
fDisassemblyPart.activateDisassemblyContext();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void deactivateDisassemblyContext() {
|
||||||
|
fDisassemblyPart.deactivateDisassemblyContext();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue