X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=plugins%2Fnet.mograsim.plugin.core%2Fsrc%2Fnet%2Fmograsim%2Fplugin%2Ftables%2Fmi%2FInstructionView.java;h=7a692c9495a66d2cf1cfb47b5eda0a019cd40389;hb=ae2d1ae853d5232df4337e4b2c417a9d57e11aa7;hp=0158c7bbc864a317ea427f46b0a0a4397830d22e;hpb=6b01ce390c1bb33d133902479645abfcc293704f;p=Mograsim.git diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionView.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionView.java index 0158c7bb..7a692c94 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionView.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionView.java @@ -11,7 +11,6 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IEditorSite; import org.eclipse.ui.IFileEditorInput; @@ -27,17 +26,16 @@ import net.mograsim.machine.mi.MicroInstructionMemoryParser; import net.mograsim.plugin.nature.MachineContext; import net.mograsim.plugin.nature.ProjectMachineContext; import net.mograsim.plugin.tables.DisplaySettings; -import net.mograsim.plugin.tables.LazyTableViewer; import net.mograsim.plugin.tables.RadixSelector; public class InstructionView extends EditorPart implements MemoryCellModifiedListener, ActiveMicroInstructionChangedListener { private InstructionTableContentProvider provider; - private int highlighted = 0; private boolean dirty = false; private MicroInstructionMemory memory; private InstructionTable table; private MachineContext context; + private RowHighlighter highlighter; @SuppressWarnings("unused") @Override @@ -58,23 +56,12 @@ public class InstructionView extends EditorPart implements MemoryCellModifiedLis GridData viewerData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH); viewerData.horizontalSpan = 3; table.getTableViewer().getTable().setLayoutData(viewerData); + highlighter = new RowHighlighter(table.getTableViewer()); } public void highlight(int index) { - Display.getDefault().asyncExec(() -> - { - LazyTableViewer viewer = table.getTableViewer(); - viewer.highlightRow(highlighted, false); - highlighted = index; - if (index != -1) - { - viewer.highlightRow(index, true); - viewer.getTable() - .showItem(viewer.getTable().getItem(Math.min((int) memory.getDefinition().getMaximalAddress(), index + 2))); - viewer.getTable().showItem(viewer.getTable().getItem(index)); - } - }); + highlighter.highlight(index); } private void addActivationButton(Composite parent)