1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 10:46:02 +02:00

Use the 'isEditable' method of ICDIVariable instead of using types in the 'supportsModification' method.

This commit is contained in:
Mikhail Khodjaiants 2003-03-10 21:27:13 +00:00
parent 31e5b4acc3
commit c8d69784d7

View file

@ -24,6 +24,8 @@ import org.eclipse.debug.core.model.IValue;
*/ */
public abstract class CModificationVariable extends CVariable public abstract class CModificationVariable extends CVariable
{ {
private Boolean fEditable = null;
/** /**
* Constructor for CModificationVariable. * Constructor for CModificationVariable.
* @param parent * @param parent
@ -39,30 +41,26 @@ public abstract class CModificationVariable extends CVariable
*/ */
public boolean supportsValueModification() public boolean supportsValueModification()
{ {
CDebugTarget target = (CDebugTarget)getDebugTarget().getAdapter( CDebugTarget.class ); if ( fEditable == null )
if ( target == null || target.isCoreDumpTarget() ) {
CDebugTarget target = (CDebugTarget)getDebugTarget().getAdapter( CDebugTarget.class );
if ( target != null && !target.isCoreDumpTarget() )
{ {
return false;
}
try try
{ {
IValue value = getValue(); fEditable = new Boolean( getCDIVariable().isEditable() );
if ( value != null && value instanceof ICValue )
{
switch( ((ICValue)value).getType() )
{
case ICValue.TYPE_POINTER:
return true;
} }
return !( value.hasVariables() ); catch( CDIException e )
}
}
catch( DebugException e )
{ {
logError( e ); logError( e );
} }
return false; }
else
{
fEditable = new Boolean( false );
}
}
return ( fEditable != null ) ? fEditable.booleanValue() : false;
} }
/** /**