mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-15 04:05:38 +02:00
Added 'Add expresion' action to the C editor context menu.
This commit is contained in:
parent
b47529d93e
commit
80ad51d3a9
1 changed files with 16 additions and 10 deletions
|
@ -87,16 +87,7 @@ public class AddExpressionActionDelegate implements IWorkbenchWindowActionDelega
|
||||||
}
|
}
|
||||||
window.getPartService().addPartListener( this );
|
window.getPartService().addPartListener( this );
|
||||||
window.getSelectionService().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this );
|
window.getSelectionService().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this );
|
||||||
IAdaptable context = DebugUITools.getDebugContext();
|
initializeDebugTarget();
|
||||||
if ( context != null && context instanceof IDebugElement )
|
|
||||||
{
|
|
||||||
IDebugTarget target = ((IDebugElement)context).getDebugTarget();
|
|
||||||
if ( target != null && target instanceof ICExpressionEvaluator )
|
|
||||||
{
|
|
||||||
setDebugTarget( target );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,6 +206,7 @@ public class AddExpressionActionDelegate implements IWorkbenchWindowActionDelega
|
||||||
{
|
{
|
||||||
setAction( action );
|
setAction( action );
|
||||||
setTargetPart( targetEditor );
|
setTargetPart( targetEditor );
|
||||||
|
initializeDebugTarget();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,4 +303,18 @@ public class AddExpressionActionDelegate implements IWorkbenchWindowActionDelega
|
||||||
{
|
{
|
||||||
return fDebugTarget;
|
return fDebugTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void initializeDebugTarget()
|
||||||
|
{
|
||||||
|
setDebugTarget( null );
|
||||||
|
IAdaptable context = DebugUITools.getDebugContext();
|
||||||
|
if ( context != null && context instanceof IDebugElement )
|
||||||
|
{
|
||||||
|
IDebugTarget target = ((IDebugElement)context).getDebugTarget();
|
||||||
|
if ( target != null && target instanceof ICExpressionEvaluator )
|
||||||
|
{
|
||||||
|
setDebugTarget( target );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue