Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Retargetable breakpoint actions always enabled for text selections
Retargetable breakpoint actions always enabled for text selections [message #488249] Sat, 26 September 2009 19:12
Matthew Dickie is currently offline Matthew DickieFriend
Messages: 56
Registered: July 2009
Member
Hi all,

Looking at the code for
org.eclipse.ui.debug.internal.action.RetargetAction it appears that the
retargetable breakpoint actions (such as RetargetWatchpointAction) are
always enabled for text selections. The method selectionChanged is
copied below. Is this deliberate? One of our QA people has created a bug
against our IDE because of this. Why is isTargetEnabled() only called
for IStructuredSelection and not ITextSelection, which would make the
actions enablement behave as one would expect.

public void selectionChanged(IAction action, ISelection selection) {
// if the active part did not provide an adapter, see if the selection
does
if (fTargetAdapter == null && selection instanceof IStructuredSelection) {
IStructuredSelection ss = (IStructuredSelection) selection;
if (!ss.isEmpty()) {
Object object = ss.getFirstElement();
if (object instanceof IAdaptable) {
fTargetAdapter = getAdapter((IAdaptable) object);
}
}
}
boolean enabled = fTargetAdapter != null;
if (selection instanceof IStructuredSelection) {
enabled = isTargetEnabled();
}
action.setEnabled(enabled);
}

Thanks in advance,

Matt D.
Previous Topic:Toggle watchpoint retargetable action in variables view.
Next Topic:AutoBuildJob executes Code from stopped Bundles
Goto Forum:
  


Current Time: Thu Apr 25 14:25:33 GMT 2024

Powered by FUDForum. Page generated in 0.03170 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top