1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 18:56:02 +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,11 +111,19 @@ abstract public class RetargetDebugContextAction implements IWorkbenchWindowActi
if (fAction == null) {
return;
}
if (fTargetAdapter != null) {
fAction.setEnabled(canPerformAction(fTargetAdapter, fDebugContext));
} else {
fAction.setEnabled(false);
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));
return;
}
}
}
fAction.setEnabled(false);
}
public void dispose() {
@ -125,16 +133,6 @@ abstract public class RetargetDebugContextAction implements IWorkbenchWindowActi
public void debugContextChanged(DebugContextEvent event) {
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();
}