X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=plugins%2Fnet.mograsim.plugin.core%2Fsrc%2Fnet%2Fmograsim%2Fplugin%2Feditors%2FSimulationViewEditor.java;h=651852edfad7d8aaed6f0c3f923a26d78172b939;hb=0eb525202d3c871a2a20f789af1728248f3cff11;hp=d40bc77bafe60d0ed2868b410e30d728caa1616a;hpb=6b01ce390c1bb33d133902479645abfcc293704f;p=Mograsim.git diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/SimulationViewEditor.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/SimulationViewEditor.java index d40bc77b..651852ed 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/SimulationViewEditor.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/SimulationViewEditor.java @@ -72,7 +72,7 @@ public class SimulationViewEditor extends EditorPart public SimulationViewEditor() { - activeMachineListener = m -> recreateContextDependentControls(); + activeMachineListener = (oldM, newM) -> recreateContextDependentControls(); memCellListener = a -> instPreview.refresh(); clockObserver = o -> { @@ -159,6 +159,9 @@ public class SimulationViewEditor extends EditorPart canvasParent.layout(); + // update preview + ((ActiveInstructionPreviewContentProvider) instPreview.getTableViewer().getContentProvider()).setMachine(machine); + // initialize executer exec = new LogicExecuter(machine.getTimeline()); updateSpeedFactorFromInput(simSpeedInput.getValue()); @@ -300,7 +303,9 @@ public class SimulationViewEditor extends EditorPart { instPreview = new InstructionTable(parent, new DisplaySettings(), getSite().getWorkbenchWindow().getWorkbench().getThemeManager()); instPreview.getTableViewer().getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - instPreview.setContentProvider(new ActiveInstructionPreviewContentProvider(instPreview.getTableViewer())); + ActiveInstructionPreviewContentProvider cProv; + instPreview.setContentProvider(cProv = new ActiveInstructionPreviewContentProvider(instPreview.getTableViewer())); + cProv.setMachine(machine); } private static void setPauseText(Button pauseButton, boolean hovered)