Skip to main content



      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 15:12
Eclipse UserFriend
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: Mon Jul 07 06:35:58 EDT 2025

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

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

Back to the top