mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 07:15:39 +02:00
172860 Traditional memory rendering: Null pointer exception at R...
173323 Traditional Memory Rendering: Memory View Tab Label is no... 173331 Traditional Memory Rendering: Performance Issue - Unneces...
This commit is contained in:
parent
80a07c9313
commit
57d3112ade
2 changed files with 78 additions and 24 deletions
|
@ -572,6 +572,12 @@ public abstract class AbstractPane extends Canvas
|
||||||
protected void paint(PaintEvent pe)
|
protected void paint(PaintEvent pe)
|
||||||
{
|
{
|
||||||
fRowCount = getBounds().height / getCellHeight();
|
fRowCount = getBounds().height / getCellHeight();
|
||||||
|
|
||||||
|
if(fRendering.isDirty())
|
||||||
|
{
|
||||||
|
fRendering.setDirty(false);
|
||||||
|
fRendering.refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract protected BigInteger getViewportAddress(int col, int row)
|
abstract protected BigInteger getViewportAddress(int col, int row)
|
||||||
|
|
|
@ -17,6 +17,7 @@ import java.util.Iterator;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
|
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.DebugEvent;
|
import org.eclipse.debug.core.DebugEvent;
|
||||||
|
@ -46,6 +47,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
|
||||||
import org.eclipse.jface.resource.JFaceResources;
|
import org.eclipse.jface.resource.JFaceResources;
|
||||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||||
|
import org.eclipse.jface.viewers.IBasicPropertyConstants;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.dnd.Clipboard;
|
import org.eclipse.swt.dnd.Clipboard;
|
||||||
import org.eclipse.swt.dnd.TextTransfer;
|
import org.eclipse.swt.dnd.TextTransfer;
|
||||||
|
@ -75,6 +77,7 @@ import org.eclipse.swt.widgets.Slider;
|
||||||
import org.eclipse.swt.widgets.Text;
|
import org.eclipse.swt.widgets.Text;
|
||||||
import org.eclipse.ui.IWorkbenchActionConstants;
|
import org.eclipse.ui.IWorkbenchActionConstants;
|
||||||
import org.eclipse.ui.model.IWorkbenchAdapter;
|
import org.eclipse.ui.model.IWorkbenchAdapter;
|
||||||
|
import org.eclipse.ui.progress.UIJob;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A memory rendering displaying memory in a traditional
|
* A memory rendering displaying memory in a traditional
|
||||||
|
@ -182,6 +185,22 @@ public class TraditionalRendering extends AbstractMemoryRendering
|
||||||
this.fRendering.gotoAddress(address);
|
this.fRendering.gotoAddress(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateRenderingLabels()
|
||||||
|
{
|
||||||
|
UIJob job = new UIJob("updateLabels"){ //$NON-NLS-1$
|
||||||
|
public IStatus runInUIThread(IProgressMonitor monitor) {
|
||||||
|
|
||||||
|
// update tab labels
|
||||||
|
String fLabel = getLabel();
|
||||||
|
firePropertyChangedEvent(new PropertyChangeEvent(TraditionalRendering.this,
|
||||||
|
IBasicPropertyConstants.P_TEXT, null, fLabel));
|
||||||
|
|
||||||
|
return Status.OK_STATUS;
|
||||||
|
}};
|
||||||
|
job.setSystem(true);
|
||||||
|
job.schedule();
|
||||||
|
}
|
||||||
|
|
||||||
private Color colorBackground;
|
private Color colorBackground;
|
||||||
private Color colorChanged;
|
private Color colorChanged;
|
||||||
private Color colorEdit;
|
private Color colorEdit;
|
||||||
|
@ -950,6 +969,9 @@ class Rendering extends Composite implements IDebugEventSetListener
|
||||||
|
|
||||||
private int fPaneSpacing = 16;
|
private int fPaneSpacing = 16;
|
||||||
|
|
||||||
|
// flag whether the memory cache is dirty
|
||||||
|
private boolean fCacheDirty = false;
|
||||||
|
|
||||||
public Rendering(Composite parent,
|
public Rendering(Composite parent,
|
||||||
TraditionalRendering renderingParent)
|
TraditionalRendering renderingParent)
|
||||||
{
|
{
|
||||||
|
@ -1700,6 +1722,16 @@ class Rendering extends Composite implements IDebugEventSetListener
|
||||||
fAddressBar.setText(getAddressString(getViewportStartAddress()));
|
fAddressBar.setText(getAddressString(getViewportStartAddress()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDirty(boolean needRefresh)
|
||||||
|
{
|
||||||
|
fCacheDirty = needRefresh;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDirty()
|
||||||
|
{
|
||||||
|
return fCacheDirty;
|
||||||
|
}
|
||||||
|
|
||||||
public void dispose()
|
public void dispose()
|
||||||
{
|
{
|
||||||
if(fViewportCache != null)
|
if(fViewportCache != null)
|
||||||
|
@ -1966,9 +1998,20 @@ class Rendering extends Composite implements IDebugEventSetListener
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void refresh()
|
protected void refresh()
|
||||||
|
{
|
||||||
|
if(!this.isDisposed())
|
||||||
|
{
|
||||||
|
if(this.isVisible())
|
||||||
{
|
{
|
||||||
fViewportCache.refresh();
|
fViewportCache.refresh();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setDirty(true);
|
||||||
|
fParent.updateRenderingLabels();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void archiveDeltas()
|
protected void archiveDeltas()
|
||||||
{
|
{
|
||||||
|
@ -2265,6 +2308,8 @@ class Rendering extends Composite implements IDebugEventSetListener
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void redrawPanes()
|
protected void redrawPanes()
|
||||||
|
{
|
||||||
|
if(this.isVisible())
|
||||||
{
|
{
|
||||||
if(fAddressPane.isPaneVisible())
|
if(fAddressPane.isPaneVisible())
|
||||||
{
|
{
|
||||||
|
@ -2291,6 +2336,9 @@ class Rendering extends Composite implements IDebugEventSetListener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fParent.updateRenderingLabels();
|
||||||
|
}
|
||||||
|
|
||||||
private void layoutPanes()
|
private void layoutPanes()
|
||||||
{
|
{
|
||||||
packColumns();
|
packColumns();
|
||||||
|
|
Loading…
Add table
Reference in a new issue