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:
parent
adc7da00a3
commit
404bddfa60
1 changed files with 12 additions and 14 deletions
|
@ -111,11 +111,19 @@ abstract public class RetargetDebugContextAction implements IWorkbenchWindowActi
|
||||||
if (fAction == null) {
|
if (fAction == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (fTargetAdapter != null) {
|
fTargetAdapter = null;
|
||||||
fAction.setEnabled(canPerformAction(fTargetAdapter, fDebugContext));
|
if (fDebugContext instanceof IStructuredSelection) {
|
||||||
} else {
|
IStructuredSelection ss = (IStructuredSelection) fDebugContext;
|
||||||
fAction.setEnabled(false);
|
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() {
|
public void dispose() {
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue