mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
[215697] refactoring to allow better customization by adopters
This commit is contained in:
parent
39f6ca8ccc
commit
6261ce70e5
5 changed files with 502 additions and 361 deletions
|
@ -62,40 +62,7 @@ public abstract class AbstractPane extends Canvas
|
|||
|
||||
protected boolean fPaneVisible = true;
|
||||
|
||||
public AbstractPane(Rendering rendering)
|
||||
{
|
||||
super(rendering, SWT.DOUBLE_BUFFERED);
|
||||
|
||||
fRendering = rendering;
|
||||
|
||||
try
|
||||
{
|
||||
fCaretAddress = rendering.getBigBaseAddress();
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
// pref
|
||||
|
||||
this.setFont(fRendering.getFont());
|
||||
|
||||
GC gc = new GC(this);
|
||||
gc.setFont(this.getFont());
|
||||
fCaret = new Caret(this, SWT.NONE);
|
||||
fCaret.setSize(1, gc.stringExtent("|").y); //$NON-NLS-1$
|
||||
gc.dispose();
|
||||
|
||||
this.addPaintListener(new PaintListener()
|
||||
{
|
||||
public void paintControl(PaintEvent pe)
|
||||
{
|
||||
AbstractPane.this.paint(pe);
|
||||
}
|
||||
});
|
||||
|
||||
this.addMouseListener(new MouseListener()
|
||||
class AbstractPaneMouseListener implements MouseListener
|
||||
{
|
||||
public void mouseUp(MouseEvent me)
|
||||
{
|
||||
|
@ -151,25 +118,12 @@ public abstract class AbstractPane extends Canvas
|
|||
|
||||
public void mouseDoubleClick(MouseEvent me)
|
||||
{
|
||||
try
|
||||
{
|
||||
BigInteger address = getViewportAddress(me.x / getCellWidth(), me.y
|
||||
/ getCellHeight());
|
||||
handleMouseDoubleClick(me);
|
||||
}
|
||||
|
||||
fRendering.getSelection().clear();
|
||||
fRendering.getSelection().setStart(address.add(BigInteger
|
||||
.valueOf(fRendering.getAddressesPerColumn())), address);
|
||||
fRendering.getSelection().setEnd(address.add(BigInteger
|
||||
.valueOf(fRendering.getAddressesPerColumn())), address);
|
||||
}
|
||||
catch(DebugException de)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.addMouseMoveListener(new MouseMoveListener()
|
||||
class AbstractPaneMouseMoveListener implements MouseMoveListener
|
||||
{
|
||||
public void mouseMove(MouseEvent me)
|
||||
{
|
||||
|
@ -179,9 +133,9 @@ public abstract class AbstractPane extends Canvas
|
|||
appendSelection(me.x, me.y);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.addKeyListener(new KeyListener()
|
||||
class AbstractPaneKeyListener implements KeyListener
|
||||
{
|
||||
public void keyPressed(KeyEvent ke)
|
||||
{
|
||||
|
@ -207,89 +161,27 @@ public abstract class AbstractPane extends Canvas
|
|||
|
||||
if(ke.keyCode == SWT.ARROW_RIGHT)
|
||||
{
|
||||
fSubCellCaretPosition++;
|
||||
if(fSubCellCaretPosition >= getCellCharacterCount())
|
||||
{
|
||||
fSubCellCaretPosition = 0;
|
||||
// Ensure that caret is within the addressable range
|
||||
BigInteger newCaretAddress = fCaretAddress.add(BigInteger
|
||||
.valueOf(getNumberOfBytesRepresentedByColumn() / fRendering.getAddressableSize()));
|
||||
if(newCaretAddress.compareTo(fRendering.getMemoryBlockEndAddress()) > 0)
|
||||
{
|
||||
fSubCellCaretPosition = getCellCharacterCount();
|
||||
}
|
||||
else
|
||||
{
|
||||
setCaretAddress(newCaretAddress);
|
||||
}
|
||||
}
|
||||
updateCaret();
|
||||
ensureCaretWithinViewport();
|
||||
handleRightArrowKey();
|
||||
}
|
||||
else if(ke.keyCode == SWT.ARROW_LEFT || ke.keyCode == SWT.BS)
|
||||
{
|
||||
fSubCellCaretPosition--;
|
||||
if(fSubCellCaretPosition < 0)
|
||||
{
|
||||
fSubCellCaretPosition = getCellCharacterCount() - 1;
|
||||
// Ensure that caret is within the addressable range
|
||||
BigInteger newCaretAddress = fCaretAddress.subtract(BigInteger
|
||||
.valueOf(getNumberOfBytesRepresentedByColumn() / fRendering.getAddressableSize()));
|
||||
if(newCaretAddress.compareTo(fRendering.getMemoryBlockStartAddress()) < 0)
|
||||
{
|
||||
fSubCellCaretPosition = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
setCaretAddress(newCaretAddress);
|
||||
}
|
||||
|
||||
}
|
||||
updateCaret();
|
||||
ensureCaretWithinViewport();
|
||||
handleLeftArrowKey();
|
||||
}
|
||||
else if(ke.keyCode == SWT.ARROW_DOWN)
|
||||
{
|
||||
// Ensure that caret is within the addressable range
|
||||
BigInteger newCaretAddress = fCaretAddress.add(BigInteger
|
||||
.valueOf(fRendering.getAddressableCellsPerRow()));
|
||||
setCaretAddress(newCaretAddress);
|
||||
|
||||
updateCaret();
|
||||
ensureCaretWithinViewport();
|
||||
handleDownArrowKey();
|
||||
}
|
||||
else if(ke.keyCode == SWT.ARROW_UP)
|
||||
{
|
||||
// Ensure that caret is within the addressable range
|
||||
BigInteger newCaretAddress = fCaretAddress.subtract(BigInteger
|
||||
.valueOf(fRendering.getAddressableCellsPerRow()));
|
||||
setCaretAddress(newCaretAddress);
|
||||
|
||||
updateCaret();
|
||||
ensureCaretWithinViewport();
|
||||
handleUpArrowKey();
|
||||
}
|
||||
else if(ke.keyCode == SWT.PAGE_DOWN)
|
||||
{
|
||||
// Ensure that caret is within the addressable range
|
||||
BigInteger newCaretAddress = fCaretAddress.add(BigInteger
|
||||
.valueOf(fRendering.getAddressableCellsPerRow()
|
||||
* (fRendering.getRowCount() - 1)));
|
||||
|
||||
setCaretAddress(newCaretAddress);
|
||||
|
||||
updateCaret();
|
||||
ensureCaretWithinViewport();
|
||||
handlePageDownKey();
|
||||
}
|
||||
else if(ke.keyCode == SWT.PAGE_UP)
|
||||
{
|
||||
// Ensure that caret is within the addressable range
|
||||
BigInteger newCaretAddress = fCaretAddress.subtract(BigInteger
|
||||
.valueOf(fRendering.getAddressableCellsPerRow()
|
||||
* (fRendering.getRowCount() - 1)));
|
||||
setCaretAddress(newCaretAddress);
|
||||
|
||||
updateCaret();
|
||||
ensureCaretWithinViewport();
|
||||
handlePageUpKey();
|
||||
}
|
||||
else if(ke.keyCode == SWT.ESC)
|
||||
{
|
||||
|
@ -337,7 +229,48 @@ public abstract class AbstractPane extends Canvas
|
|||
{
|
||||
// do nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
class AbstractPanePaintListener implements PaintListener
|
||||
{
|
||||
public void paintControl(PaintEvent pe)
|
||||
{
|
||||
AbstractPane.this.paint(pe);
|
||||
}
|
||||
}
|
||||
|
||||
public AbstractPane(Rendering rendering)
|
||||
{
|
||||
super(rendering, SWT.DOUBLE_BUFFERED);
|
||||
|
||||
fRendering = rendering;
|
||||
|
||||
try
|
||||
{
|
||||
fCaretAddress = rendering.getBigBaseAddress();
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
// pref
|
||||
|
||||
this.setFont(fRendering.getFont());
|
||||
|
||||
GC gc = new GC(this);
|
||||
gc.setFont(this.getFont());
|
||||
fCaret = new Caret(this, SWT.NONE);
|
||||
fCaret.setSize(1, gc.stringExtent("|").y); //$NON-NLS-1$
|
||||
gc.dispose();
|
||||
|
||||
this.addPaintListener(createPaintListener());
|
||||
|
||||
this.addMouseListener(createMouseListener());
|
||||
|
||||
this.addMouseMoveListener(createMouseMoveListener());
|
||||
|
||||
this.addKeyListener(createKeyListener());
|
||||
|
||||
this.addFocusListener(new FocusListener()
|
||||
{
|
||||
|
@ -364,6 +297,133 @@ public abstract class AbstractPane extends Canvas
|
|||
});
|
||||
}
|
||||
|
||||
protected MouseListener createMouseListener(){
|
||||
return new AbstractPaneMouseListener();
|
||||
}
|
||||
|
||||
protected MouseMoveListener createMouseMoveListener(){
|
||||
return new AbstractPaneMouseMoveListener();
|
||||
}
|
||||
|
||||
protected KeyListener createKeyListener(){
|
||||
return new AbstractPaneKeyListener();
|
||||
}
|
||||
|
||||
protected PaintListener createPaintListener(){
|
||||
return new AbstractPanePaintListener();
|
||||
}
|
||||
|
||||
protected void handleRightArrowKey()
|
||||
{
|
||||
fSubCellCaretPosition++;
|
||||
if(fSubCellCaretPosition >= getCellCharacterCount())
|
||||
{
|
||||
fSubCellCaretPosition = 0;
|
||||
// Ensure that caret is within the addressable range
|
||||
BigInteger newCaretAddress = fCaretAddress.add(BigInteger
|
||||
.valueOf(getNumberOfBytesRepresentedByColumn() / fRendering.getAddressableSize()));
|
||||
if(newCaretAddress.compareTo(fRendering.getMemoryBlockEndAddress()) > 0)
|
||||
{
|
||||
fSubCellCaretPosition = getCellCharacterCount();
|
||||
}
|
||||
else
|
||||
{
|
||||
setCaretAddress(newCaretAddress);
|
||||
}
|
||||
}
|
||||
updateCaret();
|
||||
ensureCaretWithinViewport();
|
||||
}
|
||||
|
||||
protected void handleLeftArrowKey()
|
||||
{
|
||||
fSubCellCaretPosition--;
|
||||
if(fSubCellCaretPosition < 0)
|
||||
{
|
||||
fSubCellCaretPosition = getCellCharacterCount() - 1;
|
||||
// Ensure that caret is within the addressable range
|
||||
BigInteger newCaretAddress = fCaretAddress.subtract(BigInteger
|
||||
.valueOf(getNumberOfBytesRepresentedByColumn() / fRendering.getAddressableSize()));
|
||||
if(newCaretAddress.compareTo(fRendering.getMemoryBlockStartAddress()) < 0)
|
||||
{
|
||||
fSubCellCaretPosition = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
setCaretAddress(newCaretAddress);
|
||||
}
|
||||
|
||||
}
|
||||
updateCaret();
|
||||
ensureCaretWithinViewport();
|
||||
}
|
||||
|
||||
protected void handleDownArrowKey()
|
||||
{
|
||||
// Ensure that caret is within the addressable range
|
||||
BigInteger newCaretAddress = fCaretAddress.add(BigInteger
|
||||
.valueOf(fRendering.getAddressableCellsPerRow()));
|
||||
setCaretAddress(newCaretAddress);
|
||||
|
||||
updateCaret();
|
||||
ensureCaretWithinViewport();
|
||||
}
|
||||
|
||||
protected void handleUpArrowKey()
|
||||
{
|
||||
// Ensure that caret is within the addressable range
|
||||
BigInteger newCaretAddress = fCaretAddress.subtract(BigInteger
|
||||
.valueOf(fRendering.getAddressableCellsPerRow()));
|
||||
setCaretAddress(newCaretAddress);
|
||||
|
||||
updateCaret();
|
||||
ensureCaretWithinViewport();
|
||||
}
|
||||
|
||||
protected void handlePageDownKey()
|
||||
{
|
||||
// Ensure that caret is within the addressable range
|
||||
BigInteger newCaretAddress = fCaretAddress.add(BigInteger
|
||||
.valueOf(fRendering.getAddressableCellsPerRow()
|
||||
* (fRendering.getRowCount() - 1)));
|
||||
|
||||
setCaretAddress(newCaretAddress);
|
||||
|
||||
updateCaret();
|
||||
ensureCaretWithinViewport();
|
||||
}
|
||||
|
||||
protected void handlePageUpKey()
|
||||
{
|
||||
// Ensure that caret is within the addressable range
|
||||
BigInteger newCaretAddress = fCaretAddress.subtract(BigInteger
|
||||
.valueOf(fRendering.getAddressableCellsPerRow()
|
||||
* (fRendering.getRowCount() - 1)));
|
||||
setCaretAddress(newCaretAddress);
|
||||
|
||||
updateCaret();
|
||||
ensureCaretWithinViewport();
|
||||
}
|
||||
|
||||
protected void handleMouseDoubleClick(MouseEvent me)
|
||||
{
|
||||
try
|
||||
{
|
||||
BigInteger address = getViewportAddress(me.x / getCellWidth(), me.y
|
||||
/ getCellHeight());
|
||||
|
||||
fRendering.getSelection().clear();
|
||||
fRendering.getSelection().setStart(address.add(BigInteger
|
||||
.valueOf(fRendering.getAddressesPerColumn())), address);
|
||||
fRendering.getSelection().setEnd(address.add(BigInteger
|
||||
.valueOf(fRendering.getAddressesPerColumn())), address);
|
||||
}
|
||||
catch(DebugException de)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isPaneVisible()
|
||||
{
|
||||
return fPaneVisible;
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package org.eclipse.dd.debug.memory.renderings.traditional;
|
||||
|
||||
public interface IMemoryByte {
|
||||
|
||||
public boolean isEdited();
|
||||
|
||||
public void setEdited(boolean edited);
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package org.eclipse.dd.debug.memory.renderings.traditional;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import org.eclipse.debug.core.DebugException;
|
||||
import org.eclipse.debug.core.model.MemoryByte;
|
||||
|
||||
public interface IViewportCache {
|
||||
|
||||
public void dispose();
|
||||
public void refresh();
|
||||
public MemoryByte[] getBytes(BigInteger address, int bytesRequested) throws DebugException;
|
||||
public void archiveDeltas();
|
||||
public void setEditedValue(BigInteger address, MemoryByte[] bytes);
|
||||
public void clearEditBuffer();
|
||||
public void writeEditBuffer();
|
||||
public boolean containsEditedCell(BigInteger address);
|
||||
// private void queueRequest(BigInteger startAddress, BigInteger endAddress);
|
||||
}
|
|
@ -63,11 +63,11 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
|
||||
// controls
|
||||
|
||||
private AddressPane fAddressPane;
|
||||
protected AddressPane fAddressPane;
|
||||
|
||||
private DataPane fBinaryPane;
|
||||
protected DataPane fBinaryPane;
|
||||
|
||||
private TextPane fTextPane;
|
||||
protected TextPane fTextPane;
|
||||
|
||||
private GoToAddressComposite fAddressBar;
|
||||
|
||||
|
@ -231,30 +231,16 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
switch(se.detail)
|
||||
{
|
||||
case SWT.ARROW_DOWN:
|
||||
fViewportAddress = fViewportAddress.add(BigInteger
|
||||
.valueOf(getAddressableCellsPerRow()));
|
||||
ensureViewportAddressDisplayable();
|
||||
redrawPanes();
|
||||
handleDownArrow();
|
||||
break;
|
||||
case SWT.PAGE_DOWN:
|
||||
fViewportAddress = fViewportAddress.add(BigInteger
|
||||
.valueOf(getAddressableCellsPerRow()
|
||||
* (Rendering.this.getRowCount() - 1)));
|
||||
ensureViewportAddressDisplayable();
|
||||
redrawPanes();
|
||||
handlePageDown();
|
||||
break;
|
||||
case SWT.ARROW_UP:
|
||||
fViewportAddress = fViewportAddress.subtract(BigInteger
|
||||
.valueOf(getAddressableCellsPerRow()));
|
||||
ensureViewportAddressDisplayable();
|
||||
redrawPanes();
|
||||
handleUpArrow();
|
||||
break;
|
||||
case SWT.PAGE_UP:
|
||||
fViewportAddress = fViewportAddress.subtract(BigInteger
|
||||
.valueOf(getAddressableCellsPerRow()
|
||||
* (Rendering.this.getRowCount() - 1)));
|
||||
ensureViewportAddressDisplayable();
|
||||
redrawPanes();
|
||||
handlePageUp();
|
||||
break;
|
||||
case SWT.SCROLL_LINE:
|
||||
if(getVerticalBar().getSelection() == getVerticalBar().getMinimum())
|
||||
|
@ -312,6 +298,25 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
}
|
||||
});
|
||||
|
||||
setLayout();
|
||||
|
||||
this.addControlListener(new ControlListener()
|
||||
{
|
||||
public void controlMoved(ControlEvent ce)
|
||||
{
|
||||
}
|
||||
|
||||
public void controlResized(ControlEvent ce)
|
||||
{
|
||||
packColumns();
|
||||
}
|
||||
});
|
||||
|
||||
DebugPlugin.getDefault().addDebugEventListener(this);
|
||||
}
|
||||
|
||||
protected void setLayout()
|
||||
{
|
||||
this.setLayout(new Layout()
|
||||
{
|
||||
public void layout(Composite composite, boolean changed)
|
||||
|
@ -382,20 +387,40 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
return new Point(100, 100); // dummy data
|
||||
}
|
||||
});
|
||||
|
||||
this.addControlListener(new ControlListener()
|
||||
{
|
||||
public void controlMoved(ControlEvent ce)
|
||||
{
|
||||
}
|
||||
|
||||
public void controlResized(ControlEvent ce)
|
||||
protected void handleDownArrow()
|
||||
{
|
||||
packColumns();
|
||||
fViewportAddress = fViewportAddress.add(BigInteger
|
||||
.valueOf(getAddressableCellsPerRow()));
|
||||
ensureViewportAddressDisplayable();
|
||||
redrawPanes();
|
||||
}
|
||||
});
|
||||
|
||||
DebugPlugin.getDefault().addDebugEventListener(this);
|
||||
protected void handleUpArrow()
|
||||
{
|
||||
fViewportAddress = fViewportAddress.subtract(BigInteger
|
||||
.valueOf(getAddressableCellsPerRow()));
|
||||
ensureViewportAddressDisplayable();
|
||||
redrawPanes();
|
||||
}
|
||||
|
||||
protected void handlePageDown()
|
||||
{
|
||||
fViewportAddress = fViewportAddress.add(BigInteger
|
||||
.valueOf(getAddressableCellsPerRow()
|
||||
* (Rendering.this.getRowCount() - 1)));
|
||||
ensureViewportAddressDisplayable();
|
||||
redrawPanes();
|
||||
}
|
||||
|
||||
protected void handlePageUp()
|
||||
{
|
||||
fViewportAddress = fViewportAddress.subtract(BigInteger
|
||||
.valueOf(getAddressableCellsPerRow()
|
||||
* (Rendering.this.getRowCount() - 1)));
|
||||
ensureViewportAddressDisplayable();
|
||||
redrawPanes();
|
||||
}
|
||||
|
||||
protected AddressPane createAddressPane()
|
||||
|
@ -561,7 +586,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
return false;
|
||||
}
|
||||
|
||||
private IMemoryBlockExtension getMemoryBlock()
|
||||
protected IMemoryBlockExtension getMemoryBlock()
|
||||
{
|
||||
IMemoryBlock block = fParent.getMemoryBlock();
|
||||
if(block != null)
|
||||
|
@ -576,12 +601,12 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
return fParent.getBigBaseAddress();
|
||||
}
|
||||
|
||||
protected int getAddressableSize()
|
||||
public int getAddressableSize()
|
||||
{
|
||||
return fParent.getAddressableSize();
|
||||
}
|
||||
|
||||
protected ViewportCache getViewportCache()
|
||||
protected IViewportCache getViewportCache()
|
||||
{
|
||||
return fViewportCache;
|
||||
}
|
||||
|
@ -589,7 +614,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
public MemoryByte[] getBytes(BigInteger address, int bytes)
|
||||
throws DebugException
|
||||
{
|
||||
return fViewportCache.getBytes(address, bytes);
|
||||
return getViewportCache().getBytes(address, bytes);
|
||||
}
|
||||
|
||||
// default visibility for performance
|
||||
|
@ -599,7 +624,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
{
|
||||
}
|
||||
|
||||
class ViewportCache extends Thread
|
||||
class ViewportCache extends Thread implements IViewportCache
|
||||
{
|
||||
class ArchiveDeltas implements Request
|
||||
{
|
||||
|
@ -665,7 +690,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
}
|
||||
}
|
||||
|
||||
protected void refresh()
|
||||
public void refresh()
|
||||
{
|
||||
assert Thread.currentThread().equals(
|
||||
Display.getDefault().getThread()) : TraditionalRenderingMessages
|
||||
|
@ -677,7 +702,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
}
|
||||
}
|
||||
|
||||
protected void archiveDeltas()
|
||||
public void archiveDeltas()
|
||||
{
|
||||
assert Thread.currentThread().equals(
|
||||
Display.getDefault().getThread()) : TraditionalRenderingMessages
|
||||
|
@ -886,7 +911,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
}
|
||||
|
||||
// bytes will be fetched from cache
|
||||
protected MemoryByte[] getBytes(BigInteger address, int bytesRequested)
|
||||
public MemoryByte[] getBytes(BigInteger address, int bytesRequested)
|
||||
throws DebugException
|
||||
{
|
||||
assert Thread.currentThread().equals(
|
||||
|
@ -933,7 +958,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
return bytes;
|
||||
}
|
||||
|
||||
private boolean containsEditedCell(BigInteger address)
|
||||
public boolean containsEditedCell(BigInteger address)
|
||||
{
|
||||
assert Thread.currentThread().equals(
|
||||
Display.getDefault().getThread()) : TraditionalRenderingMessages
|
||||
|
@ -951,7 +976,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
return (MemoryByte[]) fEditBuffer.get(address);
|
||||
}
|
||||
|
||||
protected void clearEditBuffer()
|
||||
public void clearEditBuffer()
|
||||
{
|
||||
assert Thread.currentThread().equals(
|
||||
Display.getDefault().getThread()) : TraditionalRenderingMessages
|
||||
|
@ -961,7 +986,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
Rendering.this.redrawPanes();
|
||||
}
|
||||
|
||||
protected void writeEditBuffer()
|
||||
public void writeEditBuffer()
|
||||
{
|
||||
assert Thread.currentThread().equals(
|
||||
Display.getDefault().getThread()) : TraditionalRenderingMessages
|
||||
|
@ -997,7 +1022,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
clearEditBuffer();
|
||||
}
|
||||
|
||||
protected void setEditedValue(BigInteger address, MemoryByte[] bytes)
|
||||
public void setEditedValue(BigInteger address, MemoryByte[] bytes)
|
||||
{
|
||||
assert Thread.currentThread().equals(
|
||||
Display.getDefault().getThread()) : TraditionalRenderingMessages
|
||||
|
@ -1334,9 +1359,9 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
{
|
||||
if(!this.isDisposed())
|
||||
{
|
||||
if(this.isVisible() && fViewportCache != null)
|
||||
if(this.isVisible() && getViewportCache() != null)
|
||||
{
|
||||
fViewportCache.refresh();
|
||||
getViewportCache().refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1348,7 +1373,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
|
||||
protected void archiveDeltas()
|
||||
{
|
||||
fViewportCache.archiveDeltas();
|
||||
this.getViewportCache().archiveDeltas();
|
||||
}
|
||||
|
||||
public void gotoAddress(BigInteger address)
|
||||
|
@ -1364,7 +1389,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
redrawPanes();
|
||||
}
|
||||
|
||||
protected void setViewportStartAddress(BigInteger newAddress)
|
||||
public void setViewportStartAddress(BigInteger newAddress)
|
||||
{
|
||||
fViewportAddress = newAddress;
|
||||
}
|
||||
|
@ -1615,6 +1640,36 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
}
|
||||
}
|
||||
|
||||
protected void redrawPane(int paneId)
|
||||
{
|
||||
if(!isDisposed() && this.isVisible())
|
||||
{
|
||||
AbstractPane pane = null;
|
||||
if(paneId == Rendering.PANE_ADDRESS)
|
||||
{
|
||||
pane = fAddressPane;
|
||||
}
|
||||
else if(paneId == Rendering.PANE_BINARY)
|
||||
{
|
||||
pane = fBinaryPane;
|
||||
}
|
||||
if(paneId == Rendering.PANE_TEXT)
|
||||
{
|
||||
pane = fTextPane;
|
||||
}
|
||||
if(pane != null && pane.isPaneVisible())
|
||||
{
|
||||
pane.redraw();
|
||||
pane.setRowCount();
|
||||
if(pane.isFocusControl())
|
||||
pane.updateCaret();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fParent.updateRenderingLabels();
|
||||
}
|
||||
|
||||
protected void redrawPanes()
|
||||
{
|
||||
if(!isDisposed() && this.isVisible())
|
||||
|
|
|
@ -95,10 +95,9 @@ import org.eclipse.ui.progress.UIJob;
|
|||
|
||||
public class TraditionalRendering extends AbstractMemoryRendering implements IRepositionableMemoryRendering
|
||||
{
|
||||
Rendering fRendering;
|
||||
|
||||
private Action displayEndianBigAction;
|
||||
private Action displayEndianLittleAction;
|
||||
protected Rendering fRendering;
|
||||
protected Action displayEndianBigAction;
|
||||
protected Action displayEndianLittleAction;
|
||||
|
||||
private IWorkbenchAdapter fWorkbenchAdapter;
|
||||
private IMemoryBlockConnection fConnection;
|
||||
|
@ -1086,7 +1085,7 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
|
|||
}
|
||||
|
||||
|
||||
class TraditionalMemoryByte extends MemoryByte
|
||||
class TraditionalMemoryByte extends MemoryByte implements IMemoryByte
|
||||
{
|
||||
private boolean isEdited = false;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue