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
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
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();

Thanks in advance,

Matt D.
Previous Topic:Toggle watchpoint retargetable action in variables view.
Next Topic:vmargs of eclipse.ini ignored in case any vmarg is passed on the command line
Goto Forum:

Current Time: Sat Apr 21 08:12:18 GMT 2018

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

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