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) {
|
||||
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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue