Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamantha Chan2006-03-08 17:50:44 -0500
committerSamantha Chan2006-03-08 17:50:44 -0500
commit56e3da92e39d67779df0366ad429ddfef473b9e6 (patch)
tree500c8cce8f75234a0cc240f84c2238a90d221665
parent99c99e99256e8b61076a802298f741174b0bd2a3 (diff)
downloadeclipse.platform.debug-56e3da92e39d67779df0366ad429ddfef473b9e6.tar.gz
eclipse.platform.debug-56e3da92e39d67779df0366ad429ddfef473b9e6.tar.xz
eclipse.platform.debug-56e3da92e39d67779df0366ad429ddfef473b9e6.zip
Bug 130953 - [Memory View] Create provisional APIs
-rw-r--r--org.eclipse.debug.ui/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.debug.ui/plugin.xml2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java182
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java70
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractAsyncTableRendering.java)245
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTextRendering.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractAsyncTextRendering.java)8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/IMemoryViewPresentationContext.java69
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelProxyFactory.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java35
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPresentationContext.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java73
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PendingPropertyChanges.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentDescriptor.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPresentationContext.java54
22 files changed, 573 insertions, 286 deletions
diff --git a/org.eclipse.debug.ui/META-INF/MANIFEST.MF b/org.eclipse.debug.ui/META-INF/MANIFEST.MF
index 95b33528b..e70deac3d 100644
--- a/org.eclipse.debug.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.debug.ui/META-INF/MANIFEST.MF
@@ -19,6 +19,7 @@ Export-Package: org.eclipse.debug.internal.ui;x-internal:=true,
org.eclipse.debug.internal.ui.importexport.breakpoints;x-internal:=true,
org.eclipse.debug.internal.ui.launchConfigurations;x-internal:=true,
org.eclipse.debug.internal.ui.memory;x-internal:=true,
+ org.eclipse.debug.internal.ui.memory.provisional;x-internal:=true,
org.eclipse.debug.internal.ui.preferences;x-internal:=true,
org.eclipse.debug.internal.ui.sourcelookup;x-internal:=true,
org.eclipse.debug.internal.ui.sourcelookup.browsers;x-internal:=true,
diff --git a/org.eclipse.debug.ui/plugin.xml b/org.eclipse.debug.ui/plugin.xml
index 37e8dbf47..aa2ae3f72 100644
--- a/org.eclipse.debug.ui/plugin.xml
+++ b/org.eclipse.debug.ui/plugin.xml
@@ -1383,7 +1383,7 @@
class="org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingPropertiesPage"
id="org.eclipse.debug.ui.properties.asynctablerendering"
name="%TableRenderingInfo.label"
- objectClass="org.eclipse.debug.internal.ui.views.memory.renderings.AbstractAsyncTableRendering"/>
+ objectClass="org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering"/>
</extension>
<!-- commands and their bindings
NOTE:
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java
index 4a8c55081..f34fa3e38 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java
@@ -24,13 +24,13 @@ import org.eclipse.debug.core.model.IMemoryBlockExtension;
import org.eclipse.debug.core.model.MemoryByte;
import org.eclipse.debug.internal.ui.DebugUIMessages;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
+import org.eclipse.debug.internal.ui.memory.provisional.IMemoryViewPresentationContext;
import org.eclipse.debug.internal.ui.viewers.provisional.AsynchronousContentAdapter;
import org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext;
import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
-import org.eclipse.debug.internal.ui.views.memory.renderings.AbstractAsyncTableRendering;
import org.eclipse.debug.internal.ui.views.memory.renderings.MemorySegment;
import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingContentDescriptor;
-import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingPresentationContext;
import org.eclipse.debug.ui.memory.IMemoryRendering;
public class MemoryBlockContentAdapter extends AsynchronousContentAdapter {
@@ -51,10 +51,10 @@ public class MemoryBlockContentAdapter extends AsynchronousContentAdapter {
if (!(parent instanceof IMemoryBlock))
return new Object[0];
- if (!(context instanceof TableRenderingPresentationContext))
+ if (!(context instanceof IMemoryViewPresentationContext))
return new Object[0];
- TableRenderingPresentationContext memoryViewContext = (TableRenderingPresentationContext)context;
+ IMemoryViewPresentationContext memoryViewContext = (IMemoryViewPresentationContext)context;
IMemoryRendering rendering = memoryViewContext.getRendering();
if (!(rendering instanceof AbstractAsyncTableRendering))
@@ -72,8 +72,11 @@ public class MemoryBlockContentAdapter extends AsynchronousContentAdapter {
protected boolean hasChildren(Object element, IPresentationContext context)
throws CoreException {
- if (context instanceof TableRenderingPresentationContext)
- return true;
+ if (context instanceof IMemoryViewPresentationContext)
+ {
+ if (((IMemoryViewPresentationContext)context).getRendering() != null)
+ return true;
+ }
return false;
}
@@ -83,7 +86,7 @@ public class MemoryBlockContentAdapter extends AsynchronousContentAdapter {
}
- private Object[] getMemoryFromMemoryBlock(TableRenderingPresentationContext context) throws DebugException {
+ private Object[] getMemoryFromMemoryBlock(IMemoryViewPresentationContext context) throws DebugException {
IMemoryBlock memoryBlock = context.getRendering().getMemoryBlock();
if (memoryBlock instanceof IMemoryBlockExtension)
{
@@ -97,88 +100,100 @@ public class MemoryBlockContentAdapter extends AsynchronousContentAdapter {
/**
* @throws DebugException
*/
- public Object[] loadContentForSimpleMemoryBlock(TableRenderingPresentationContext context) throws DebugException {
- AbstractAsyncTableRendering rendering = context.getTableRendering();
- IMemoryBlock memoryBlock = rendering.getMemoryBlock();
- long startAddress = memoryBlock.getStartAddress();
- BigInteger address = BigInteger.valueOf(startAddress);
- long length = memoryBlock.getLength();
- long numLines = length / rendering.getBytesPerLine();
- return getMemoryToFitTable(address, numLines, context);
+ public Object[] loadContentForSimpleMemoryBlock(IMemoryViewPresentationContext context) throws DebugException {
+ AbstractAsyncTableRendering rendering = getTableRendering(context);
+ if (rendering != null)
+ {
+ IMemoryBlock memoryBlock = rendering.getMemoryBlock();
+ long startAddress = memoryBlock.getStartAddress();
+ BigInteger address = BigInteger.valueOf(startAddress);
+ long length = memoryBlock.getLength();
+ long numLines = length / rendering.getBytesPerLine();
+ return getMemoryToFitTable(address, numLines, context);
+ }
+ return EMPTY;
}
/**
* @throws DebugException
*/
- public Object[] loadContentForExtendedMemoryBlock(TableRenderingPresentationContext context) throws DebugException {
-
- AbstractAsyncTableRendering rendering = context.getTableRendering();
- TableRenderingContentDescriptor descriptor = context.getContentDescriptor();
- // calculate top buffered address
- BigInteger loadAddress = descriptor.getLoadAddress();
- if (loadAddress == null)
- {
- loadAddress = new BigInteger("0"); //$NON-NLS-1$
- }
-
- BigInteger mbStart = descriptor.getStartAddress();
- BigInteger mbEnd = descriptor.getEndAddress();
-
- // check that the load address is within range
- if (loadAddress.compareTo(mbStart) < 0 || loadAddress.compareTo(mbEnd) > 0)
- {
- // default load address to memory block base address
- loadAddress = ((IMemoryBlockExtension)descriptor.getMemoryBlock()).getBigBaseAddress();
- descriptor.setLoadAddress(loadAddress);
- }
+ public Object[] loadContentForExtendedMemoryBlock(IMemoryViewPresentationContext context) throws DebugException {
- // if address is still out of range, throw an exception
- if (loadAddress.compareTo(mbStart) < 0 || loadAddress.compareTo(mbEnd) > 0)
+ AbstractAsyncTableRendering rendering = getTableRendering(context);
+ if (rendering != null)
{
- throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_0 + loadAddress.toString(16), null));
- }
-
- int addressableUnitsPerLine = rendering.getAddressableUnitPerLine();
- BigInteger bufferStart = loadAddress.subtract(BigInteger.valueOf(descriptor.getPreBuffer()*addressableUnitsPerLine));
- BigInteger bufferEnd = loadAddress.add(BigInteger.valueOf(descriptor.getPostBuffer()*addressableUnitsPerLine));
- bufferEnd = bufferEnd.add(BigInteger.valueOf(descriptor.getNumLines()*addressableUnitsPerLine));
-
- // TODO: should rely on input to tell us what to load
- // instead of having the content adapter override the setting
- if (context.isDynamicLoad())
- {
- if (bufferStart.compareTo(mbStart) < 0)
- bufferStart = mbStart;
+ TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)rendering.getAdapter(TableRenderingContentDescriptor.class);
- if (bufferEnd.compareTo(mbEnd) > 0)
- bufferEnd = mbEnd;
+ if (descriptor == null)
+ return new Object[0];
- // buffer end must be greater than buffer start
- if (bufferEnd.compareTo(bufferStart) <= 0)
- throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_1, null));
+ // calculate top buffered address
+ BigInteger loadAddress = descriptor.getLoadAddress();
+ if (loadAddress == null)
+ {
+ loadAddress = new BigInteger("0"); //$NON-NLS-1$
+ }
- int numLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue()+1;
- // get stoarage to fit the memory view tab size
- return getMemoryToFitTable(bufferStart, numLines,context);
- }
- else
- {
- if (bufferStart.compareTo(mbStart) < 0)
- bufferStart = mbStart;
+ BigInteger mbStart = descriptor.getStartAddress();
+ BigInteger mbEnd = descriptor.getEndAddress();
- if (bufferEnd.compareTo(mbEnd) > 0)
+ // check that the load address is within range
+ if (loadAddress.compareTo(mbStart) < 0 || loadAddress.compareTo(mbEnd) > 0)
{
- bufferStart = mbEnd.subtract(BigInteger.valueOf((descriptor.getNumLines()-1)*addressableUnitsPerLine));
+ // default load address to memory block base address
+ loadAddress = ((IMemoryBlockExtension)descriptor.getMemoryBlock()).getBigBaseAddress();
+ descriptor.setLoadAddress(loadAddress);
}
- // buffer end must be greater than buffer start
- if (bufferEnd.compareTo(bufferStart) <= 0)
- throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_2, null));
+ // if address is still out of range, throw an exception
+ if (loadAddress.compareTo(mbStart) < 0 || loadAddress.compareTo(mbEnd) > 0)
+ {
+ throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_0 + loadAddress.toString(16), null));
+ }
- int numLines = descriptor.getNumLines();
- // get stoarage to fit the memory view tab size
- return getMemoryToFitTable(bufferStart, numLines, context);
+ int addressableUnitsPerLine = rendering.getAddressableUnitPerLine();
+ BigInteger bufferStart = loadAddress.subtract(BigInteger.valueOf(descriptor.getPreBuffer()*addressableUnitsPerLine));
+ BigInteger bufferEnd = loadAddress.add(BigInteger.valueOf(descriptor.getPostBuffer()*addressableUnitsPerLine));
+ bufferEnd = bufferEnd.add(BigInteger.valueOf(descriptor.getNumLines()*addressableUnitsPerLine));
+
+ // TODO: should rely on input to tell us what to load
+ // instead of having the content adapter override the setting
+ if (descriptor.isDynamicLoad())
+ {
+ if (bufferStart.compareTo(mbStart) < 0)
+ bufferStart = mbStart;
+
+ if (bufferEnd.compareTo(mbEnd) > 0)
+ bufferEnd = mbEnd;
+
+ // buffer end must be greater than buffer start
+ if (bufferEnd.compareTo(bufferStart) <= 0)
+ throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_1, null));
+
+ int numLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue()+1;
+ // get stoarage to fit the memory view tab size
+ return getMemoryToFitTable(bufferStart, numLines,context);
+ }
+ else
+ {
+ if (bufferStart.compareTo(mbStart) < 0)
+ bufferStart = mbStart;
+
+ if (bufferEnd.compareTo(mbEnd) > 0)
+ {
+ bufferStart = mbEnd.subtract(BigInteger.valueOf((descriptor.getNumLines()-1)*addressableUnitsPerLine));
+ }
+
+ // buffer end must be greater than buffer start
+ if (bufferEnd.compareTo(bufferStart) <= 0)
+ throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_2, null));
+
+ int numLines = descriptor.getNumLines();
+ // get stoarage to fit the memory view tab size
+ return getMemoryToFitTable(bufferStart, numLines, context);
+ }
}
+ return EMPTY;
}
/**
@@ -188,16 +203,19 @@ public class MemoryBlockContentAdapter extends AsynchronousContentAdapter {
* @param updateDelta
* @throws DebugException
*/
- public Object[] getMemoryToFitTable(BigInteger startAddress, long numberOfLines, TableRenderingPresentationContext context) throws DebugException
+ public Object[] getMemoryToFitTable(BigInteger startAddress, long numberOfLines, IMemoryViewPresentationContext context) throws DebugException
{
- TableRenderingContentDescriptor descriptor = context.getContentDescriptor();
- AbstractAsyncTableRendering tableRendering = context.getTableRendering();
+ AbstractAsyncTableRendering tableRendering = getTableRendering(context);
if (tableRendering == null)
{
DebugException e = new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.MemoryViewContentProvider_Unable_to_retrieve_content, null));
throw e;
}
+ TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)tableRendering.getAdapter(TableRenderingContentDescriptor.class);
+ if(descriptor == null)
+ return new Object[0];
+
// do not ask for memory from memory block if the debug target
// is already terminated
IDebugTarget target = descriptor.getMemoryBlock().getDebugTarget();
@@ -371,7 +389,7 @@ public class MemoryBlockContentAdapter extends AsynchronousContentAdapter {
}
- private Object[] organizeLines(long numberOfLines, MemoryByte[] memoryBuffer, BigInteger address, boolean manageDelta, TableRenderingPresentationContext context)
+ private Object[] organizeLines(long numberOfLines, MemoryByte[] memoryBuffer, BigInteger address, boolean manageDelta, IMemoryViewPresentationContext context)
{
Vector lineCache = new Vector();
IMemoryRendering rendering = context.getRendering();
@@ -441,4 +459,14 @@ public class MemoryBlockContentAdapter extends AsynchronousContentAdapter {
}
return memoryBuffer;
}
+
+ protected AbstractAsyncTableRendering getTableRendering(IMemoryViewPresentationContext context)
+ {
+ IMemoryRendering memRendering = context.getRendering();
+ if (memRendering != null && memRendering instanceof AbstractAsyncTableRendering)
+ {
+ return (AbstractAsyncTableRendering)memRendering;
+ }
+ return null;
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java
index 461e6a6f1..f8602b035 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java
@@ -18,14 +18,14 @@ import org.eclipse.debug.core.model.MemoryByte;
import org.eclipse.debug.internal.ui.DebugPluginImages;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
+import org.eclipse.debug.internal.ui.memory.provisional.IMemoryViewPresentationContext;
import org.eclipse.debug.internal.ui.viewers.provisional.AsynchronousLabelAdapter;
import org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext;
import org.eclipse.debug.internal.ui.views.launch.DebugElementHelper;
-import org.eclipse.debug.internal.ui.views.memory.renderings.AbstractAsyncTableRendering;
import org.eclipse.debug.internal.ui.views.memory.renderings.AbstractBaseTableRendering;
import org.eclipse.debug.internal.ui.views.memory.renderings.MemorySegment;
import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingContentDescriptor;
-import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingPresentationContext;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.memory.IMemoryBlockTablePresentation;
import org.eclipse.debug.ui.memory.MemoryRenderingElement;
@@ -44,25 +44,29 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
protected String[] getLabels(Object element, IPresentationContext context)
throws CoreException {
- if (context instanceof TableRenderingPresentationContext)
+ if (context instanceof IMemoryViewPresentationContext)
{
- TableRenderingPresentationContext tableRenderingContext = (TableRenderingPresentationContext)context;
- if (tableRenderingContext.getTableRendering() != null)
+ IMemoryViewPresentationContext tableRenderingContext = (IMemoryViewPresentationContext)context;
+ if (tableRenderingContext.getRendering() != null && tableRenderingContext.getRendering() instanceof AbstractAsyncTableRendering)
{
- AbstractAsyncTableRendering tableRendering = tableRenderingContext.getTableRendering();
- String addressStr = getColumnText(element, 0, tableRendering, tableRenderingContext.getContentDescriptor());
- int numColumns = tableRendering.getAddressableUnitPerLine() / tableRendering.getAddressableUnitPerColumn();
-
- String[] labels = new String[numColumns+2];
- labels[0] = addressStr;
-
- for (int i=0; i<=numColumns; i++)
+ AbstractAsyncTableRendering tableRendering = (AbstractAsyncTableRendering)tableRenderingContext.getRendering();
+ TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)tableRendering.getAdapter(TableRenderingContentDescriptor.class);
+ if (descriptor != null)
{
- labels[i+1] = getColumnText(element, i+1, tableRendering, tableRenderingContext.getContentDescriptor());
+ String addressStr = getColumnText(element, 0, tableRendering, descriptor);
+ int numColumns = tableRendering.getAddressableUnitPerLine() / tableRendering.getAddressableUnitPerColumn();
+
+ String[] labels = new String[numColumns+2];
+ labels[0] = addressStr;
+
+ for (int i=0; i<=numColumns; i++)
+ {
+ labels[i+1] = getColumnText(element, i+1, tableRendering, (TableRenderingContentDescriptor)tableRendering.getAdapter(TableRenderingContentDescriptor.class));
+ }
+
+ labels[labels.length - 1 ] = ""; //$NON-NLS-1$
+ return labels;
}
-
- labels[labels.length - 1 ] = ""; //$NON-NLS-1$
- return labels;
}
}
return new String[0];
@@ -133,12 +137,12 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
protected ImageDescriptor[] getImageDescriptors(Object element,
IPresentationContext context) throws CoreException {
- if (context instanceof TableRenderingPresentationContext)
+ if (context instanceof IMemoryViewPresentationContext)
{
- TableRenderingPresentationContext tableRenderingContext = (TableRenderingPresentationContext)context;
- if (tableRenderingContext.getTableRendering() != null)
+ IMemoryViewPresentationContext tableRenderingContext = (IMemoryViewPresentationContext)context;
+ if (tableRenderingContext.getRendering() != null && tableRenderingContext.getRendering() instanceof AbstractAsyncTableRendering)
{
- AbstractAsyncTableRendering tableRendering = tableRenderingContext.getTableRendering();
+ AbstractAsyncTableRendering tableRendering = (AbstractAsyncTableRendering)tableRenderingContext.getRendering();
int numColumns = tableRendering.getAddressableUnitPerLine() / tableRendering.getAddressableUnitPerColumn();
ImageDescriptor[] images = new ImageDescriptor[numColumns+2];
@@ -206,12 +210,12 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
protected FontData[] getFontDatas(Object element,
IPresentationContext context) throws CoreException {
- if (context instanceof TableRenderingPresentationContext)
+ if (context instanceof IMemoryViewPresentationContext)
{
- TableRenderingPresentationContext tableRenderingContext = (TableRenderingPresentationContext)context;
- if (tableRenderingContext.getTableRendering() != null)
+ IMemoryViewPresentationContext tableRenderingContext = (IMemoryViewPresentationContext)context;
+ if (tableRenderingContext.getRendering() != null && tableRenderingContext.getRendering() instanceof AbstractAsyncTableRendering)
{
- AbstractAsyncTableRendering tableRendering = tableRenderingContext.getTableRendering();
+ AbstractAsyncTableRendering tableRendering = (AbstractAsyncTableRendering)tableRenderingContext.getRendering();
int numColumns = tableRendering.getAddressableUnitPerLine() / tableRendering.getAddressableUnitPerColumn();
FontData[] fontData = new FontData[numColumns+2];
@@ -252,12 +256,12 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
protected RGB[] getForegrounds(Object element, IPresentationContext context)
throws CoreException {
- if (context instanceof TableRenderingPresentationContext)
+ if (context instanceof IMemoryViewPresentationContext)
{
- TableRenderingPresentationContext tableRenderingContext = (TableRenderingPresentationContext)context;
- if (tableRenderingContext.getTableRendering() != null)
+ IMemoryViewPresentationContext tableRenderingContext = (IMemoryViewPresentationContext)context;
+ if (tableRenderingContext.getRendering() != null && tableRenderingContext.getRendering() instanceof AbstractAsyncTableRendering)
{
- AbstractAsyncTableRendering tableRendering = tableRenderingContext.getTableRendering();
+ AbstractAsyncTableRendering tableRendering = (AbstractAsyncTableRendering)tableRenderingContext.getRendering();
int numColumns = tableRendering.getAddressableUnitPerLine() / tableRendering.getAddressableUnitPerColumn();
RGB[] colors = new RGB[numColumns+2];
@@ -354,12 +358,12 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
protected RGB[] getBackgrounds(Object element, IPresentationContext context)
throws CoreException {
- if (context instanceof TableRenderingPresentationContext)
+ if (context instanceof IMemoryViewPresentationContext)
{
- TableRenderingPresentationContext tableRenderingContext = (TableRenderingPresentationContext)context;
- if (tableRenderingContext.getTableRendering() != null)
+ IMemoryViewPresentationContext tableRenderingContext = (IMemoryViewPresentationContext)context;
+ if (tableRenderingContext.getRendering() != null && tableRenderingContext.getRendering() instanceof AbstractAsyncTableRendering)
{
- AbstractAsyncTableRendering tableRendering = tableRenderingContext.getTableRendering();
+ AbstractAsyncTableRendering tableRendering = (AbstractAsyncTableRendering)tableRenderingContext.getRendering();
int numColumns = tableRendering.getAddressableUnitPerLine() / tableRendering.getAddressableUnitPerColumn();
RGB[] colors = new RGB[numColumns+2];
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractAsyncTableRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
index e7411ca50..85f9f011d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractAsyncTableRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
@@ -9,7 +9,7 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
+package org.eclipse.debug.internal.ui.memory.provisional;
import java.math.BigInteger;
@@ -31,7 +31,26 @@ import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
import org.eclipse.debug.internal.ui.viewers.provisional.IModelChangedListener;
import org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta;
+import org.eclipse.debug.internal.ui.views.memory.MemoryViewPresentationContext;
import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
+import org.eclipse.debug.internal.ui.views.memory.renderings.AbstractBaseTableRendering;
+import org.eclipse.debug.internal.ui.views.memory.renderings.AbstractVirtualContentTableModel;
+import org.eclipse.debug.internal.ui.views.memory.renderings.AsyncTableRenderingCellModifier;
+import org.eclipse.debug.internal.ui.views.memory.renderings.AsyncTableRenderingViewer;
+import org.eclipse.debug.internal.ui.views.memory.renderings.AsyncVirtualContentTableViewer;
+import org.eclipse.debug.internal.ui.views.memory.renderings.CopyTableRenderingToClipboardAction;
+import org.eclipse.debug.internal.ui.views.memory.renderings.FormatTableRenderingAction;
+import org.eclipse.debug.internal.ui.views.memory.renderings.FormatTableRenderingDialog;
+import org.eclipse.debug.internal.ui.views.memory.renderings.GoToAddressAction;
+import org.eclipse.debug.internal.ui.views.memory.renderings.IPresentationErrorListener;
+import org.eclipse.debug.internal.ui.views.memory.renderings.IVirtualContentListener;
+import org.eclipse.debug.internal.ui.views.memory.renderings.MemorySegment;
+import org.eclipse.debug.internal.ui.views.memory.renderings.PendingPropertyChanges;
+import org.eclipse.debug.internal.ui.views.memory.renderings.PrintTableRenderingAction;
+import org.eclipse.debug.internal.ui.views.memory.renderings.ReformatAction;
+import org.eclipse.debug.internal.ui.views.memory.renderings.ResetToBaseAddressAction;
+import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingContentDescriptor;
+import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingLine;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.memory.AbstractTableRendering;
@@ -94,12 +113,52 @@ import org.eclipse.ui.model.IWorkbenchAdapter;
import org.eclipse.ui.part.PageBook;
import org.eclipse.ui.progress.UIJob;
-//TODO: different representation in a rendering
-//TODO: show memory tab is busy updating
-//TODO: linux - cannot resize columns to preferred size
-//TODO: review use of MemorySegment, need to be careful to ensure flexible hierarchy
+/**
+ * Abstract implementation of a table rendering.
+ * <p>
+ * Clients should subclass from this class if they wish to provide a
+ * table rendering.
+ * </p>
+ * <p>
+ *
+ * The label of the rendering is constructed by retrieving the expression from
+ * <code>IMemoryBlockExtension</code>. For IMemoryBlock, the label is constructed
+ * using the memory block's start address.
+ *
+ * This rendering manages the change states of its memory bytes if the memory
+ * block does not opt to manage the change states. For IMemoryBlockExtension, if
+ * the memory block returns false when #supportsChangeManagement() is called, this
+ * rendering will calculate the change state for each byte when its content is updated.
+ * Clients may manages the change states of its memory block by returning true when
+ * #supportsChangeManagement() is called. This will cause this rendering to stop
+ * calculating the change states of the memory block. Instead it would rely on the
+ * attributes returned in the MemoryByte array to determine if a byte has changed.
+ * For IMemoryBlock, this rendering will manage the change states its content.
+ *
+ * When firing change event, be aware of the following:
+ * - whenever a change event is fired, the content provider for Memory View
+ * view checks to see if memory has actually changed.
+ * - If memory has actually changed, a refresh will commence. Changes to the memory block
+ * will be computed and will be shown with the delta icons.
+ * - If memory has not changed, content will not be refreshed. However, previous delta information
+ * will be erased. The screen will be refreshed to show that no memory has been changed. (All
+ * delta icons will be removed.)
+ *
+ * Please note that these APIs will be called multiple times by the Memory View.
+ * To improve performance, debug adapters need to cache the content of its memory block and only
+ * retrieve updated data when necessary.
+ * </p>
+
+ * @since 3.2
+ */
public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRendering implements IPropertyChangeListener, IResettableMemoryRendering {
+
+// TODO: different representation in a rendering
+// TODO: show memory tab is busy updating
+// TODO: linux - cannot resize columns to preferred size
+// TODO: review use of MemorySegment, need to be careful to ensure flexible hierarchy
+
private class ToggleAddressColumnAction extends Action {
public ToggleAddressColumnAction() {
@@ -175,7 +234,7 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
private AsyncTableRenderingViewer fTableViewer;
private TextViewer fTextViewer;
private Shell fToolTipShell;
- private TableRenderingPresentationContext fPresentationContext;
+ private MemoryViewPresentationContext fPresentationContext;
private int fAddressableSize;
private TableRenderingContentDescriptor fContentDescriptor;
private int fBytePerLine;
@@ -203,11 +262,29 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
private PendingPropertyChanges fPendingSyncProperties;
- // context menu group ids
- // empty groups have been added to allow clients to insert actions in the context menu
+ /**
+ * Identifier for an empty group preceding all context menu actions
+ * (value <code>"popUpBegin"</code>).
+ */
public static final String EMPTY_MEMORY_GROUP = "popUpBegin"; //$NON-NLS-1$
+
+ /**
+ * Identifier for an empty group following navigation actions in the rendering
+ * (value <code>navigationGroup</code>).
+ */
public static final String EMPTY_NAVIGATION_GROUP = "navigationGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for an empty group following actions that are only applicable in
+ * non-auto loading mode
+ * (value <code>nonAutoLoadGroup</code>).
+ */
public static final String EMPTY_NON_AUTO_LOAD_GROUP = "nonAutoLoadGroup"; //$NON-NLS-1$
+
+ /**
+ * Identifier for an empty group following properties actions
+ * (value <code>propertyGroup</code>).
+ */
public static final String EMPTY_PROPERTY_GROUP = "propertyGroup"; //$NON-NLS-1$
private ISelectionChangedListener fViewerSelectionChangedListener = new ISelectionChangedListener() {
@@ -267,10 +344,20 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
showMessage(status.getMessage());
}};
+
+ /**
+ * Constructs a new table rendering of the specified type.
+ *
+ * @param renderingId memory rendering type identifier
+ */
public AbstractAsyncTableRendering(String renderingId) {
super(renderingId);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.memory.IResettableMemoryRendering#resetRendering()
+ */
public void resetRendering() throws DebugException {
BigInteger baseAddress = fContentDescriptor.getContentBaseAddress();
goToAddress(baseAddress);
@@ -278,6 +365,9 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
fTableViewer.setTopIndex(baseAddress);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.memory.IMemoryRendering#createControl(org.eclipse.swt.widgets.Composite)
+ */
public Control createControl(Composite parent) {
fPageBook = new PageBook(parent, SWT.NONE);
@@ -287,6 +377,10 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
return fPageBook;
}
+ /**
+ * Create the error page of this rendering
+ * @param parent
+ */
private void createMessagePage(Composite parent)
{
if (fTextViewer == null)
@@ -328,8 +422,8 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
public IStatus runInUIThread(IProgressMonitor progressMonitor) {
fTableViewer = new AsyncTableRenderingViewer(AbstractAsyncTableRendering.this, parent, SWT.VIRTUAL | SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.HIDE_SELECTION | SWT.BORDER);
- fPresentationContext = new TableRenderingPresentationContext(getMemoryRenderingContainer().getMemoryRenderingSite().getSite().getPart());
- fPresentationContext.setContainerId(getMemoryRenderingContainer().getId());
+ fPresentationContext = new MemoryViewPresentationContext(getMemoryRenderingContainer().getMemoryRenderingSite().getSite().getPart());
+ fPresentationContext.setMemoryRenderingContainer(getMemoryRenderingContainer());
fPresentationContext.setRendering(AbstractAsyncTableRendering.this);
fTableViewer.setContext(fPresentationContext);
@@ -353,8 +447,6 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
fContentDescriptor.setPostBuffer(0);
}
- fPresentationContext.setContentDescriptor(fContentDescriptor);
-
setupInitialFormat();
fTableViewer.setCellModifier(createCellModifier());
fTableViewer.getTable().setHeaderVisible(true);
@@ -407,6 +499,11 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
job.schedule();
}
+ /**
+ * Create popup menu for this rendering
+ * @param control - control to create the popup menu for
+ * @param menuListener - listener to notify when popup meu is about to show
+ */
private void createPopupMenu(Control control, IMenuListener menuListener)
{
IMemoryRenderingContainer container = getMemoryRenderingContainer();
@@ -598,10 +695,16 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
return true;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.memory.IMemoryRendering#getControl()
+ */
public Control getControl() {
return fPageBook;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+ */
public void propertyChange(PropertyChangeEvent event) {
if (!fIsCreated)
@@ -1156,10 +1259,10 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
}
/**
- * Displays an error message for the given exception.
- * @param e exception to display
+ * Displays the given message on the error page
+ * @param message - the message to display
*/
- private void showMessage(final String message)
+ protected void showMessage(final String message)
{
UIJob job = new UIJob("Display Message Job"){ //$NON-NLS-1$
public IStatus runInUIThread(IProgressMonitor monitor) {
@@ -1199,6 +1302,11 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
return fBytePerLine;
}
+ /**
+ * Returns whether the error page is displayed.
+ *
+ * @return whether the error page is displayed
+ */
public boolean isDisplayingError()
{
return fShowMessage;
@@ -1388,6 +1496,9 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
}
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.memory.AbstractMemoryRendering#dispose()
+ */
public void dispose() {
if (fIsDisposed)
@@ -1472,6 +1583,10 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
return decorateLabel(label);
}
+ /* Returns the label of this rendering.
+ *
+ * @return label of this rendering
+ */
public String getLabel() {
if (fLabel == null)
@@ -1483,6 +1598,9 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
return fLabel;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
+ */
public Object getAdapter(Class adapter) {
if (adapter == IColorProvider.class)
@@ -1524,6 +1642,9 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
return fWorkbenchAdapter;
}
+ if (adapter == TableRenderingContentDescriptor.class)
+ return getContentDescriptor();
+
return super.getAdapter(adapter);
}
@@ -1540,7 +1661,7 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
}
/**
- * Create actions for the view tab
+ * Create actions for this rendering
*/
protected void createActions() {
@@ -1564,6 +1685,11 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
fPrevAction = new PrevPageAction();
}
+ /**
+ * Returns the currently selected address in this rendering.
+ *
+ * @return the currently selected address in this rendering
+ */
public BigInteger getSelectedAddress() {
Object key = fTableViewer.getSelectionKey();
@@ -1647,6 +1773,13 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
return tableItem.getText(col);
}
+ /**
+ * Moves the cursor to the specified address.
+ * Will load more memory if the address is not currently visible.
+ *
+ * @param address address to position cursor at
+ * @throws DebugException if an exception occurrs
+ */
public void goToAddress(BigInteger address) throws DebugException {
if (fTableViewer.getVirtualContentModel() == null)
@@ -1704,10 +1837,18 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
}
}
+ /**
+ * Refresh the table viewer with the current top visible address.
+ * Update labels in the memory rendering.
+ */
public void refresh() {
fTableViewer.refresh();
}
+
+ /**
+ * Resize column to the preferred size.
+ */
public void resizeColumnsToPreferredSize() {
fTableViewer.resizeColumnsToPreferredSize();
if (!fIsShowAddressColumn)
@@ -1826,7 +1967,7 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
private boolean isDynamicLoad()
{
- return fPresentationContext.isDynamicLoad();
+ return fContentDescriptor.isDynamicLoad();
}
private int getPageSize()
@@ -1847,7 +1988,7 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
private void setDynamicLoad(boolean load)
{
- fPresentationContext.setDynamicLoad(load);
+ fContentDescriptor.setDynamicLoad(load);
}
private void handlePageStartAddressChanged(BigInteger address)
@@ -1921,6 +2062,9 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
}
}
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.memory.IMemoryRendering#becomesHidden()
+ */
public void becomesHidden() {
// creates new object for storing potential changes in sync properties
@@ -2489,36 +2633,6 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
}
/**
- * Returns text for the given memory bytes at the specified address for the specified
- * rendering type. This is called by the label provider for.
- * Subclasses must override.
- *
- * @param renderingTypeId rendering type identifier
- * @param address address where the bytes belong to
- * @param data the bytes
- * @return a string to represent the memory. Cannot not return <code>null</code>.
- * Returns a string to pad the cell if the memory cannot be converted
- * successfully.
- */
- abstract public String getString(String renderingTypeId, BigInteger address, MemoryByte[] data);
-
- /**
- * Returns bytes for the given text corresponding to bytes at the given
- * address for the specified rendering type. This is called by the cell modifier
- * when modifying bytes in a memory block.
- * Subclasses must convert the string value to an array of bytes. The bytes will
- * be passed to the debug adapter for memory block modification.
- * Returns <code>null</code> if the bytes cannot be formatted properly.
- *
- * @param renderingTypeId rendering type identifier
- * @param address address the bytes begin at
- * @param currentValues current values of the data in bytes format
- * @param newValue the string to be converted to bytes
- * @return the bytes converted from a string
- */
- abstract public byte[] getBytes(String renderingTypeId, BigInteger address, MemoryByte[] currentValues, String newValue);
-
- /**
* @param topVisibleAddress
*/
private void createContentDescriptor(final BigInteger topVisibleAddress) {
@@ -2558,4 +2672,39 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
}
}
+
+ private TableRenderingContentDescriptor getContentDescriptor()
+ {
+ return fContentDescriptor;
+ }
+
+ /**
+ * Returns text for the given memory bytes at the specified address for the specified
+ * rendering type. This is called by the label provider for.
+ * Subclasses must override.
+ *
+ * @param renderingTypeId rendering type identifier
+ * @param address address where the bytes belong to
+ * @param data the bytes
+ * @return a string to represent the memory. Cannot not return <code>null</code>.
+ * Returns a string to pad the cell if the memory cannot be converted
+ * successfully.
+ */
+ abstract public String getString(String renderingTypeId, BigInteger address, MemoryByte[] data);
+
+ /**
+ * Returns bytes for the given text corresponding to bytes at the given
+ * address for the specified rendering type. This is called by the cell modifier
+ * when modifying bytes in a memory block.
+ * Subclasses must convert the string value to an array of bytes. The bytes will
+ * be passed to the debug adapter for memory block modification.
+ * Returns <code>null</code> if the bytes cannot be formatted properly.
+ *
+ * @param renderingTypeId rendering type identifier
+ * @param address address the bytes begin at
+ * @param currentValues current values of the data in bytes format
+ * @param newValue the string to be converted to bytes
+ * @return the bytes converted from a string
+ */
+ abstract public byte[] getBytes(String renderingTypeId, BigInteger address, MemoryByte[] currentValues, String newValue);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractAsyncTextRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTextRendering.java
index 22197c618..f672f9549 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractAsyncTextRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTextRendering.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
+package org.eclipse.debug.internal.ui.memory.provisional;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
@@ -80,8 +80,9 @@ abstract public class AbstractAsyncTextRendering extends AbstractAsyncTableRende
return fCodePage;
}
+
/* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.AbstractTableRendering#getString(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[])
+ * @see org.eclipse.debug.internal.ui.views.memory.provisional.AbstractAsyncTableRendering#getString(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[])
*/
public String getString(String dataType, BigInteger address, MemoryByte[] data) {
try {
@@ -122,8 +123,9 @@ abstract public class AbstractAsyncTextRendering extends AbstractAsyncTableRende
}
}
+
/* (non-Javadoc)
- * @see com.ibm.debug.extended.ui.AbstractTableViewTabLabelProvider#getBytes(java.lang.String)
+ * @see org.eclipse.debug.internal.ui.views.memory.provisional.AbstractAsyncTableRendering#getBytes(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[], java.lang.String)
*/
public byte[] getBytes(String dataType, BigInteger address, MemoryByte[] currentValues, String data) {
try {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/IMemoryViewPresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/IMemoryViewPresentationContext.java
new file mode 100644
index 000000000..925b66790
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/IMemoryViewPresentationContext.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.debug.internal.ui.memory.provisional;
+
+import org.eclipse.debug.core.model.IMemoryBlock;
+import org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext;
+import org.eclipse.debug.ui.memory.IMemoryRendering;
+import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
+import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
+
+/**
+ * Context in which an asynchronous request has been made. This context provides
+ * additional information about the Memory View.
+ *
+ */
+public interface IMemoryViewPresentationContext extends IPresentationContext{
+
+ /**
+ * Returns the memory rendering site from which the asynchronous request
+ * has been made from.
+ *
+ * @return the memory rendering site
+ */
+ public IMemoryRenderingSite getMemoryRenderingSite();
+
+ /**
+ * Returns the container identifier of the memory rendering container from which the
+ * asynchronous request has been made from. This method returns <code>null</code> if
+ * the request does not originate from a memory rendering container
+ *
+ * @return the memory rendering container
+ */
+ public IMemoryRenderingContainer getMemoryRenderingContainer();
+
+ /**
+ * Returns the rendering of which the asynchronous request has been made from.
+ * If the request is not made from a rendering, this method returns <code>null</code>.
+ *
+ * @return the rendering or <code>null</code>
+ */
+ public IMemoryRendering getRendering();
+
+ /**
+ * Returns if the memory view is currently pinned
+ * @return true if the Memory View is currently pinned, false otherwise.
+ */
+ public boolean isPinned();
+
+ /**
+ * Returns if the given memory block is registered with the Memory View.
+ * A memory block is registered to the view if it's added from that Memory View.
+ *
+ * TODO: need to review this again and see what to do about registering memory blocks
+ *
+ * @param memoryBlock the memory block to check
+ * @return true if the memory block is registered, false otherwise.
+ */
+ public boolean isMemoryBlockRegistered(IMemoryBlock memoryBlock);
+
+} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelProxyFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelProxyFactory.java
index 58d593ba9..6b5033183 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelProxyFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelProxyFactory.java
@@ -19,10 +19,10 @@ import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.core.model.IStackFrame;
import org.eclipse.debug.core.model.IWatchExpression;
+import org.eclipse.debug.internal.ui.memory.provisional.IMemoryViewPresentationContext;
import org.eclipse.debug.internal.ui.viewers.provisional.IModelProxy;
import org.eclipse.debug.internal.ui.viewers.provisional.IModelProxyFactoryAdapter;
import org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingPresentationContext;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.ui.IWorkbenchPart;
@@ -66,14 +66,18 @@ public class DefaultModelProxyFactory implements IModelProxyFactoryAdapter {
if (IDebugUIConstants.ID_MEMORY_VIEW.equals(id)) {
if (element instanceof IMemoryBlockRetrieval)
return new MemoryRetrievalProxy((IMemoryBlockRetrieval)element);
+ if (context instanceof IMemoryViewPresentationContext)
+ {
+ if (((IMemoryViewPresentationContext)context).getRendering() != null)
+ {
+ if (element instanceof IMemoryBlock)
+ return new MemoryBlockProxy((IMemoryBlock)element);
+ }
+ }
}
}
- if (context instanceof TableRenderingPresentationContext)
- {
- if (element instanceof IMemoryBlock)
- return new MemoryBlockProxy((IMemoryBlock)element);
- }
+
return null;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java
index 1ea813ca8..0b87ff52f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java
@@ -17,11 +17,11 @@ import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IMemoryBlockListener;
import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
+import org.eclipse.debug.internal.ui.memory.provisional.IMemoryViewPresentationContext;
import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
import org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext;
import org.eclipse.debug.internal.ui.viewers.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewPresentationContext;
import org.eclipse.debug.ui.memory.IMemoryRendering;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -168,14 +168,14 @@ public class MemoryRetrievalProxy extends AbstractModelProxy implements IMemoryB
if (memoryBlocks.length == 1)
return true;
- if (getPresentationContext() instanceof MemoryViewPresentationContext)
+ if (getPresentationContext() instanceof IMemoryViewPresentationContext)
{
// if registered, meaning the memory block is added from this view, select
- MemoryViewPresentationContext context = (MemoryViewPresentationContext)getPresentationContext();
+ IMemoryViewPresentationContext context = (IMemoryViewPresentationContext)getPresentationContext();
if (context.isMemoryBlockRegistered(memoryBlock))
return true;
// if display is not pinned, select
- else if (!context.isPinMBDisplay())
+ else if (!context.isPinned())
return true;
}
return false;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java
index 914910834..0ffaf88e4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java
@@ -39,6 +39,7 @@ import org.eclipse.debug.internal.ui.views.variables.ViewerState;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.memory.IMemoryRendering;
+import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
@@ -72,7 +73,7 @@ import org.eclipse.ui.progress.UIJob;
/**
* Tree viewer for memory blocks
*/
-public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionChangedListener, IMemoryViewPane{
+public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionChangedListener, IMemoryViewPane, IMemoryRenderingContainer{
public static final String PANE_ID = DebugUIPlugin.getUniqueIdentifier() + ".MemoryView.MemoryBlocksTreeViewPane"; //$NON-NLS-1$
@@ -87,7 +88,8 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
private boolean fVisible = true;
private TreeViewPaneContextListener fDebugContextListener;
private ViewPaneEventHandler fEvtHandler;
- private Hashtable fViewerState = new Hashtable(); // for saving and restoring expansion and selection
+ private Hashtable fViewerState = new Hashtable(); // for saving and restoring expansion and selection
+ private String fLabel;
class TreeViewerRemoveMemoryBlocksAction extends Action
{
@@ -316,9 +318,10 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
{
fPaneId = paneId;
fTreeViewer = new AsynchronousTreeViewer(parent);
+ fLabel = label;
MemoryViewPresentationContext presentationContext = new MemoryViewPresentationContext(fParent);
- presentationContext.setContainerId(getId());
+ presentationContext.setMemoryRenderingContainer(this);
fTreeViewer.setContext(presentationContext);
IAdaptable context = DebugUITools.getDebugContext();
@@ -652,4 +655,30 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
{
return fTreeViewer;
}
+
+ public IMemoryRenderingSite getMemoryRenderingSite() {
+ if (fParent instanceof IMemoryRenderingSite)
+ return (IMemoryRenderingSite)fParent;
+ return null;
+ }
+
+ public void addMemoryRendering(IMemoryRendering rendering) {
+ // do nothing
+ }
+
+ public void removeMemoryRendering(IMemoryRendering rendering) {
+ // do nothing
+ }
+
+ public IMemoryRendering[] getRenderings() {
+ return new IMemoryRendering[0];
+ }
+
+ public IMemoryRendering getActiveRendering() {
+ return null;
+ }
+
+ public String getLabel() {
+ return fLabel;
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPresentationContext.java
index b1668bf90..a9d4d0b73 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPresentationContext.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPresentationContext.java
@@ -11,13 +11,16 @@
package org.eclipse.debug.internal.ui.views.memory;
import org.eclipse.debug.core.model.IMemoryBlock;
+import org.eclipse.debug.internal.ui.memory.provisional.IMemoryViewPresentationContext;
import org.eclipse.debug.internal.ui.viewers.PresentationContext;
import org.eclipse.debug.ui.memory.IMemoryRendering;
+import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
+import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
import org.eclipse.ui.IWorkbenchPart;
-public class MemoryViewPresentationContext extends PresentationContext {
+public class MemoryViewPresentationContext extends PresentationContext implements IMemoryViewPresentationContext {
- private String fContainerId; // optional field to indicate which container the context is in
+ private IMemoryRenderingContainer fContainer; // optional field to indicate which container the context is in
private IMemoryRendering fRendering; // optional field to indicate which rendering the context is in
private MemoryView fMemoryView;
@@ -29,14 +32,19 @@ public class MemoryViewPresentationContext extends PresentationContext {
}
}
- public void setContainerId(String paneId)
+ public IMemoryRenderingSite getMemoryRenderingSite()
{
- fContainerId = paneId;
+ return fMemoryView;
}
- public String getContainerId()
+ public void setMemoryRenderingContainer(IMemoryRenderingContainer container)
{
- return fContainerId;
+ fContainer = container;
+ }
+
+ public IMemoryRenderingContainer getMemoryRenderingContainer()
+ {
+ return fContainer;
}
public void setRendering(IMemoryRendering rendering)
@@ -49,7 +57,7 @@ public class MemoryViewPresentationContext extends PresentationContext {
return fRendering;
}
- public boolean isPinMBDisplay()
+ public boolean isPinned()
{
if (fMemoryView != null)
{
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java
index 0d8fbcad5..f339400f4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java
@@ -13,6 +13,7 @@ package org.eclipse.debug.internal.ui.views.memory.renderings;
import java.math.BigInteger;
import org.eclipse.debug.core.model.MemoryByte;
+import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTextRendering;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.util.PropertyChangeEvent;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java
index 54e78e03f..ae86a19cf 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java
@@ -13,6 +13,7 @@ package org.eclipse.debug.internal.ui.views.memory.renderings;
import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IMemoryBlockExtension;
import org.eclipse.debug.core.model.MemoryByte;
+import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java
index dc066ecfe..75e43af2e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java
@@ -22,6 +22,7 @@ import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IMemoryBlockExtension;
import org.eclipse.debug.core.model.MemoryByte;
import org.eclipse.debug.internal.ui.DebugUIMessages;
+import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
import org.eclipse.jface.viewers.ICellModifier;
import org.eclipse.swt.widgets.TableItem;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java
index 7c0207713..562825152 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java
@@ -18,9 +18,12 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IMemoryBlockExtension;
+import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
+import org.eclipse.debug.internal.ui.memory.provisional.IMemoryViewPresentationContext;
import org.eclipse.debug.internal.ui.viewers.TableUpdatePolicy;
import org.eclipse.debug.internal.ui.viewers.provisional.IModelChangedListener;
import org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta;
+import org.eclipse.debug.ui.memory.IMemoryRendering;
import org.eclipse.ui.progress.UIJob;
/**
@@ -29,7 +32,7 @@ import org.eclipse.ui.progress.UIJob;
* when the memory block has changed when the rendering is not visible
*
*/
-class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy
+public class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy
{
public void modelChanged(IModelDelta node) {
@@ -98,36 +101,38 @@ class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy
protected void handleMemoryBlockChanged(IMemoryBlock mb, IModelDelta delta)
{
try {
- if (getViewer().getPresentationContext() instanceof TableRenderingPresentationContext)
+ if (getViewer().getPresentationContext() instanceof IMemoryViewPresentationContext)
{
- TableRenderingPresentationContext context = (TableRenderingPresentationContext)getViewer().getPresentationContext();
- TableRenderingContentDescriptor descriptor = context.getContentDescriptor();
-
- final AbstractAsyncTableRendering rendering = context.getTableRendering();
-
+ IMemoryViewPresentationContext context = (IMemoryViewPresentationContext)getViewer().getPresentationContext();
+ final AbstractAsyncTableRendering rendering = getTableRendering(context);
if (rendering != null)
{
- final BigInteger address = getMemoryBlockBaseAddress(mb);
- if (!address.equals(descriptor.getContentBaseAddress()))
- {
- descriptor.updateContentBaseAddress();
- UIJob job = new UIJob("go to address"){ //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- try {
- rendering.goToAddress(address);
- } catch (DebugException e) {
- if (getTableViewer() != null)
- getTableViewer().handlePresentationFailure(null, e.getStatus());
- }
- return Status.OK_STATUS;
- }};
- job.setSystem(true);
- job.schedule();
- }
- else
+ TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)rendering.getAdapter(TableRenderingContentDescriptor.class);
+
+ if (descriptor != null)
{
- rendering.refresh();
+ final BigInteger address = getMemoryBlockBaseAddress(mb);
+ if (!address.equals(descriptor.getContentBaseAddress()))
+ {
+ descriptor.updateContentBaseAddress();
+ UIJob job = new UIJob("go to address"){ //$NON-NLS-1$
+
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ try {
+ rendering.goToAddress(address);
+ } catch (DebugException e) {
+ if (getTableViewer() != null)
+ getTableViewer().handlePresentationFailure(null, e.getStatus());
+ }
+ return Status.OK_STATUS;
+ }};
+ job.setSystem(true);
+ job.schedule();
+ }
+ else
+ {
+ rendering.refresh();
+ }
}
}
}
@@ -154,9 +159,9 @@ class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy
private boolean containsEvent(IModelDelta delta)
{
- if (getViewer().getPresentationContext() instanceof TableRenderingPresentationContext)
+ if (getViewer().getPresentationContext() instanceof IMemoryViewPresentationContext)
{
- TableRenderingPresentationContext context = (TableRenderingPresentationContext) getViewer().getPresentationContext();
+ IMemoryViewPresentationContext context = (IMemoryViewPresentationContext) getViewer().getPresentationContext();
if (context.getRendering() instanceof AbstractAsyncTableRendering)
{
AbstractAsyncTableRendering rendering = (AbstractAsyncTableRendering)context.getRendering();
@@ -166,4 +171,14 @@ class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy
}
return true;
}
+
+ protected AbstractAsyncTableRendering getTableRendering(IMemoryViewPresentationContext context)
+ {
+ IMemoryRendering memRendering = context.getRendering();
+ if (memRendering != null && memRendering instanceof AbstractAsyncTableRendering)
+ {
+ return (AbstractAsyncTableRendering)memRendering;
+ }
+ return null;
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java
index ea3ad2ab4..0f57f8c4e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java
@@ -19,6 +19,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.debug.internal.ui.DebugUIMessages;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
import org.eclipse.debug.internal.ui.viewers.AbstractUpdatePolicy;
import org.eclipse.debug.internal.ui.viewers.AsynchronousModel;
import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java
index 0d1c7da76..3316a2742 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java
@@ -15,6 +15,7 @@ import java.math.BigInteger;
import org.eclipse.debug.core.model.MemoryByte;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
import org.eclipse.debug.ui.IDebugUIConstants;
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PendingPropertyChanges.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PendingPropertyChanges.java
index 82386b432..ce3b06406 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PendingPropertyChanges.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PendingPropertyChanges.java
@@ -17,7 +17,7 @@ import java.math.BigInteger;
* These data will be used to sync up the rendering when it becomes visible again.
*
*/
-class PendingPropertyChanges
+public class PendingPropertyChanges
{
BigInteger fTopVisibleAddress;
BigInteger fSelectedAddress;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentDescriptor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentDescriptor.java
index 265f90995..5a88629d8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentDescriptor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentDescriptor.java
@@ -30,6 +30,8 @@ public class TableRenderingContentDescriptor{
private int fAddressSize = -1;
private int fAddressableSize = -1;
+ private boolean fIsDynamicLoad;
+
public TableRenderingContentDescriptor(AbstractBaseTableRendering rendering)
{
fRendering = rendering;
@@ -179,5 +181,15 @@ public class TableRenderingContentDescriptor{
public void setAddressSize(int addressSize) {
fAddressSize = addressSize;
}
+
+ public void setDynamicLoad(boolean dynamic)
+ {
+ fIsDynamicLoad = dynamic;
+ }
+
+ public boolean isDynamicLoad()
+ {
+ return fIsDynamicLoad;
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java
index 3faf2f82e..7f26d0392 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java
@@ -16,6 +16,7 @@ import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IMemoryBlockExtension;
+import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
import org.eclipse.debug.ui.memory.AbstractTableRendering;
import org.eclipse.debug.ui.memory.IMemoryRendering;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java
index 4327e6e33..c3c95adc1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java
@@ -25,8 +25,11 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IMemoryBlockExtension;
import org.eclipse.debug.core.model.MemoryByte;
+import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
+import org.eclipse.debug.internal.ui.memory.provisional.IMemoryViewPresentationContext;
import org.eclipse.debug.internal.ui.viewers.AsynchronousTableViewer;
import org.eclipse.debug.internal.ui.viewers.ModelNode;
+import org.eclipse.debug.ui.memory.IMemoryRendering;
public class TableRenderingModel extends AbstractVirtualContentTableModel
@@ -159,12 +162,12 @@ public class TableRenderingModel extends AbstractVirtualContentTableModel
private int getAddressableUnitsPerColumn()
{
AsynchronousTableViewer viewer = getTableViewer();
- if (viewer.getPresentationContext() instanceof TableRenderingPresentationContext)
+ if (viewer.getPresentationContext() instanceof IMemoryViewPresentationContext)
{
- TableRenderingPresentationContext context = (TableRenderingPresentationContext)viewer.getPresentationContext();
- if (context.getTableRendering() != null)
+ IMemoryViewPresentationContext context = (IMemoryViewPresentationContext)viewer.getPresentationContext();
+ if (getTableRendering(context)!= null)
{
- return context.getTableRendering().getAddressableUnitPerColumn();
+ return getTableRendering(context).getAddressableUnitPerColumn();
}
}
return -1;
@@ -242,6 +245,12 @@ public class TableRenderingModel extends AbstractVirtualContentTableModel
if (isEmpty())
return;
+ IMemoryViewPresentationContext context = (IMemoryViewPresentationContext)getTableViewer().getPresentationContext();
+ AbstractAsyncTableRendering rendering = getTableRendering(context);
+
+ if (rendering == null)
+ return;
+
ArrayList segments = new ArrayList();
Enumeration enumeration = fOrderedCache.elements();
@@ -260,14 +269,8 @@ public class TableRenderingModel extends AbstractVirtualContentTableModel
int bytesPerLine = -1;
int numAddressableUnitPerLine = -1;
-
- if (getTableViewer().getPresentationContext() instanceof TableRenderingPresentationContext)
- {
- TableRenderingPresentationContext context = (TableRenderingPresentationContext)getTableViewer().getPresentationContext();
- AbstractAsyncTableRendering rendering = context.getTableRendering();
- bytesPerLine = rendering.getBytesPerLine();
- numAddressableUnitPerLine = rendering.getAddressableUnitPerLine();
- }
+ bytesPerLine = rendering.getBytesPerLine();
+ numAddressableUnitPerLine = rendering.getAddressableUnitPerLine();
clearCache();
MemorySegment[] newSegments = convertMemoryBytesToSegments(address, bytes, bytesPerLine, numAddressableUnitPerLine);
@@ -279,6 +282,12 @@ public class TableRenderingModel extends AbstractVirtualContentTableModel
private void rebuildContent()
{
+ IMemoryViewPresentationContext context = (IMemoryViewPresentationContext)getTableViewer().getPresentationContext();
+ AbstractAsyncTableRendering rendering = getTableRendering(context);
+
+ if (rendering == null)
+ return;
+
ArrayList segments = new ArrayList();
Object[] elements = getElements();
for (int i=0; i<elements.length; i++)
@@ -294,14 +303,9 @@ public class TableRenderingModel extends AbstractVirtualContentTableModel
int bytesPerLine = -1;
int numAddressableUnitPerLine = -1;
-
- if (getTableViewer().getPresentationContext() instanceof TableRenderingPresentationContext)
- {
- TableRenderingPresentationContext context = (TableRenderingPresentationContext)getTableViewer().getPresentationContext();
- AbstractAsyncTableRendering rendering = context.getTableRendering();
- bytesPerLine = rendering.getBytesPerLine();
- numAddressableUnitPerLine = rendering.getAddressableUnitPerLine();
- }
+
+ bytesPerLine = rendering.getBytesPerLine();
+ numAddressableUnitPerLine = rendering.getAddressableUnitPerLine();
BigInteger address = (BigInteger)getKey(0);
@@ -409,4 +413,14 @@ public class TableRenderingModel extends AbstractVirtualContentTableModel
}
super.init(root);
}
+
+ private AbstractAsyncTableRendering getTableRendering(IMemoryViewPresentationContext context)
+ {
+ IMemoryRendering memRendering = context.getRendering();
+ if (memRendering != null && memRendering instanceof AbstractAsyncTableRendering)
+ {
+ return (AbstractAsyncTableRendering)memRendering;
+ }
+ return null;
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPresentationContext.java
deleted file mode 100644
index 9fda7a27e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPresentationContext.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewPresentationContext;
-import org.eclipse.ui.IWorkbenchPart;
-
-public class TableRenderingPresentationContext extends MemoryViewPresentationContext{
-
- private TableRenderingContentDescriptor fContentDescriptor;
- private boolean fIsDynamicLoad;
-
- public TableRenderingPresentationContext(IWorkbenchPart part) {
- super(part);
- }
-
- public void setContentDescriptor(TableRenderingContentDescriptor input)
- {
- fContentDescriptor = input;
- }
-
- public TableRenderingContentDescriptor getContentDescriptor()
- {
- return fContentDescriptor;
- }
-
- public boolean isDynamicLoad()
- {
- return fIsDynamicLoad;
- }
-
- public void setDynamicLoad(boolean load)
- {
- fIsDynamicLoad = load;
- }
-
- public AbstractAsyncTableRendering getTableRendering()
- {
- if (getRendering() instanceof AbstractAsyncTableRendering)
- return (AbstractAsyncTableRendering)getRendering();
-
- return null;
- }
-
-}

Back to the top