1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 392095 The Traditional Memory Renderer does not work properly with the TCF Memory Block.

Tightened up obtaining the factory using an adapter ( pawel input ).
This commit is contained in:
Randy Rohrbach 2012-10-22 23:03:38 +02:00
parent 60ff7da7a4
commit efd76606b2

View file

@ -23,6 +23,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.model.IMemoryBlock; import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IMemoryBlockExtension; import org.eclipse.debug.core.model.IMemoryBlockExtension;
import org.eclipse.debug.core.model.MemoryByte; import org.eclipse.debug.core.model.MemoryByte;
@ -250,7 +251,8 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
/* /*
* Working with the model proxy must be done on the UI dispatch thread. * Working with the model proxy must be done on the UI dispatch thread.
*/ */
if ( block instanceof IModelProxyFactory ) { final IModelProxyFactory factory = (IModelProxyFactory) DebugPlugin.getAdapter(block, IModelProxyFactory.class );
if ( factory != null ) {
Display.getDefault().asyncExec(new Runnable() { Display.getDefault().asyncExec(new Runnable() {
public void run() { public void run() {
@ -265,7 +267,6 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
* Get a new proxy and perform the initialization sequence so we are known the * Get a new proxy and perform the initialization sequence so we are known the
* the model provider. * the model provider.
*/ */
IModelProxyFactory factory = (IModelProxyFactory) block;
fModel = factory.createModelProxy(block, context); fModel = factory.createModelProxy(block, context);
fModel.installed(null); fModel.installed(null);
fModel.addModelChangedListener(TraditionalRendering.this); fModel.addModelChangedListener(TraditionalRendering.this);