mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +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.getSelectionService().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this );
|
||||
IAdaptable context = DebugUITools.getDebugContext();
|
||||
if ( context != null && context instanceof IDebugElement )
|
||||
{
|
||||
IDebugTarget target = ((IDebugElement)context).getDebugTarget();
|
||||
if ( target != null && target instanceof ICExpressionEvaluator )
|
||||
{
|
||||
setDebugTarget( target );
|
||||
}
|
||||
|
||||
}
|
||||
initializeDebugTarget();
|
||||
update();
|
||||
}
|
||||
|
||||
|
@ -215,6 +206,7 @@ public class AddExpressionActionDelegate implements IWorkbenchWindowActionDelega
|
|||
{
|
||||
setAction( action );
|
||||
setTargetPart( targetEditor );
|
||||
initializeDebugTarget();
|
||||
update();
|
||||
}
|
||||
|
||||
|
@ -311,4 +303,18 @@ public class AddExpressionActionDelegate implements IWorkbenchWindowActionDelega
|
|||
{
|
||||
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