1
0
Fork 0
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:
Mikhail Khodjaiants 2002-09-18 20:58:54 +00:00
parent b47529d93e
commit 80ad51d3a9

View file

@ -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 );
}
}
}
}