1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

[268693] [TraditionalRendering] update mode support

This commit is contained in:
Ted Williams 2009-03-15 22:56:45 +00:00
parent 88f16a48e3
commit 4276eab9a2
3 changed files with 89 additions and 18 deletions

View file

@ -142,6 +142,12 @@ public class Rendering extends Composite implements IDebugEventSetListener
// flag whether the memory cache is dirty
private boolean fCacheDirty = false;
// update modes
public final static int UPDATE_ALWAYS = 1;
public final static int UPDATE_ON_BREAKPOINT = 2;
public final static int UPDATE_MANUAL = 3;
public int fUpdateMode = UPDATE_ALWAYS;
public Rendering(Composite parent, TraditionalRendering renderingParent)
{
@ -535,6 +541,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
boolean isChangeOnly = false;
boolean isSuspend = false;
boolean isBreakpointHit = false;
for(int i = 0; i < events.length; i++)
{
@ -548,6 +555,8 @@ public class Rendering extends Composite implements IDebugEventSetListener
if(source.getDebugTarget() == getMemoryBlock()
.getDebugTarget())
{
if((detail & DebugEvent.BREAKPOINT) != 0)
isBreakpointHit = true;
if(kind == DebugEvent.SUSPEND)
{
handleSuspendEvent(detail);
@ -563,32 +572,39 @@ public class Rendering extends Composite implements IDebugEventSetListener
}
if(isSuspend)
handleSuspend();
handleSuspend(isBreakpointHit);
else if(isChangeOnly)
handleChange();
}
protected void handleSuspend()
protected void handleSuspend(boolean isBreakpointHit)
{
Display.getDefault().asyncExec(new Runnable()
{
public void run()
if(getUpdateMode() == UPDATE_ALWAYS ||
(getUpdateMode() == UPDATE_ON_BREAKPOINT && isBreakpointHit))
{
Display.getDefault().asyncExec(new Runnable()
{
archiveDeltas();
refresh();
}
});
public void run()
{
archiveDeltas();
refresh();
}
});
}
}
protected void handleChange()
{
Display.getDefault().asyncExec(new Runnable()
{
public void run()
{
refresh();
}
});
if(getUpdateMode() == UPDATE_ALWAYS)
{
Display.getDefault().asyncExec(new Runnable()
{
public void run()
{
refresh();
}
});
}
}
protected void handleSuspendEvent(int detail)
@ -1629,7 +1645,15 @@ public class Rendering extends Composite implements IDebugEventSetListener
return fTextMode;
}
protected String getCharacterSet(int mode)
public int getUpdateMode() {
return fUpdateMode;
}
public void setUpdateMode(int fUpdateMode) {
this.fUpdateMode = fUpdateMode;
}
protected String getCharacterSet(int mode)
{
switch(mode)
{

View file

@ -1061,6 +1061,49 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
sub.add(displayColumnCountCustom);
manager.add(sub);
final Action updateAlwaysAction = new Action(
TraditionalRenderingMessages
.getString("TraditionalRendering.UPDATE_ALWAYS"), //$NON-NLS-1$
IAction.AS_RADIO_BUTTON)
{
public void run()
{
fRendering.setUpdateMode(Rendering.UPDATE_ALWAYS);
}
};
updateAlwaysAction.setChecked(fRendering.getUpdateMode() == Rendering.UPDATE_ALWAYS);
final Action updateOnBreakpointAction = new Action(
TraditionalRenderingMessages
.getString("TraditionalRendering.UPDATE_ON_BREAKPOINT"), //$NON-NLS-1$
IAction.AS_RADIO_BUTTON)
{
public void run()
{
fRendering.setUpdateMode(Rendering.UPDATE_ON_BREAKPOINT);
}
};
updateOnBreakpointAction.setChecked(fRendering.getUpdateMode() == Rendering.UPDATE_ON_BREAKPOINT);
final Action updateManualAction = new Action(
TraditionalRenderingMessages
.getString("TraditionalRendering.UPDATE_MANUAL"), //$NON-NLS-1$
IAction.AS_RADIO_BUTTON)
{
public void run()
{
fRendering.setUpdateMode(Rendering.UPDATE_MANUAL);
}
};
updateManualAction.setChecked(fRendering.getUpdateMode() == Rendering.UPDATE_MANUAL);
sub = new MenuManager(TraditionalRenderingMessages
.getString("TraditionalRendering.UPDATEMODE")); //$NON-NLS-1$
sub.add(updateAlwaysAction);
sub.add(updateOnBreakpointAction);
sub.add(updateManualAction);
manager.add(sub);
manager.add(new Separator());
BigInteger start = fRendering.getSelection().getStart();

View file

@ -46,4 +46,8 @@ TraditionalRendering.COLUMN_COUNT_32=32
TraditionalRendering.COLUMN_COUNT_64=64
TraditionalRendering.COLUMN_COUNT_128=128
TraditionalRendering.COLUMN_COUNT_CUSTOM=Custom...
TraditionalRendering.COPY_ADDRESS=Copy Address
TraditionalRendering.COPY_ADDRESS=Copy Address
TraditionalRendering.UPDATEMODE=Update Mode
TraditionalRendering.UPDATE_ALWAYS=Always
TraditionalRendering.UPDATE_ON_BREAKPOINT=On Breakpoint
TraditionalRendering.UPDATE_MANUAL=Manual