1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 23:25:26 +02:00

[252688] - [update policy] Refresh All action is not always properly enabled.

This commit is contained in:
Pawel Piech 2008-10-30 04:43:26 +00:00
parent adc7da00a3
commit 404bddfa60

View file

@ -111,12 +111,20 @@ abstract public class RetargetDebugContextAction implements IWorkbenchWindowActi
if (fAction == null) { if (fAction == null) {
return; return;
} }
if (fTargetAdapter != null) { fTargetAdapter = null;
if (fDebugContext instanceof IStructuredSelection) {
IStructuredSelection ss = (IStructuredSelection) fDebugContext;
if (!ss.isEmpty()) {
Object object = ss.getFirstElement();
if (object instanceof IAdaptable) {
fTargetAdapter = getAdapter((IAdaptable) object);
fAction.setEnabled(canPerformAction(fTargetAdapter, fDebugContext)); fAction.setEnabled(canPerformAction(fTargetAdapter, fDebugContext));
} else { return;
fAction.setEnabled(false);
} }
} }
}
fAction.setEnabled(false);
}
public void dispose() { public void dispose() {
DebugUITools.getDebugContextManager().getContextService(fWindow).removePostDebugContextListener(this); DebugUITools.getDebugContextManager().getContextService(fWindow).removePostDebugContextListener(this);
@ -125,16 +133,6 @@ abstract public class RetargetDebugContextAction implements IWorkbenchWindowActi
public void debugContextChanged(DebugContextEvent event) { public void debugContextChanged(DebugContextEvent event) {
fDebugContext = event.getContext(); fDebugContext = event.getContext();
fTargetAdapter = null;
if (fDebugContext instanceof IStructuredSelection) {
IStructuredSelection ss = (IStructuredSelection) fDebugContext;
if (!ss.isEmpty()) {
Object object = ss.getFirstElement();
if (object instanceof IAdaptable) {
fTargetAdapter = getAdapter((IAdaptable) object);
}
}
}
update(); update();
} }