X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.plugin.core%2Fsrc%2Fnet%2Fmograsim%2Fplugin%2Ftables%2Fmi%2FInstructionView.java;fp=net.mograsim.plugin.core%2Fsrc%2Fnet%2Fmograsim%2Fplugin%2Ftables%2Fmi%2FInstructionView.java;h=d86449182acb4cfb2db3fab3e28acfff2c196360;hb=7958e659b3ea9aac43c1a67a0b2921c5323e4c84;hp=f0db46fe8f77ab9bf96833fd3579a4aad9a50b51;hpb=a8ba08b067b7c5e449656fca56ac067d5d701270;p=Mograsim.git diff --git a/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionView.java b/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionView.java index f0db46fe..d8644918 100644 --- a/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionView.java +++ b/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionView.java @@ -25,7 +25,6 @@ import net.mograsim.machine.mi.MicroInstructionMemoryParser; import net.mograsim.machine.mi.parameters.ParameterClassification; import net.mograsim.plugin.MachineContext; import net.mograsim.plugin.MachineContext.ContextObserver; -import net.mograsim.plugin.asm.AsmNumberUtil.NumberType; import net.mograsim.plugin.tables.AddressLabelProvider; import net.mograsim.plugin.tables.DisplaySettings; import net.mograsim.plugin.tables.RadixSelector; @@ -40,12 +39,13 @@ public class InstructionView extends ViewPart implements ContextObserver private MicroInstructionDefinition miDef; private MicroInstructionMemory memory; private DisplaySettings displaySettings; + private InstructionTableContentProvider provider; @SuppressWarnings("unused") @Override public void createPartControl(Composite parent) { - InstructionTableContentProvider provider = new InstructionTableContentProvider(); + provider = new InstructionTableContentProvider(); GridLayout layout = new GridLayout(3, false); setupMenuButtons(parent); @@ -54,11 +54,13 @@ public class InstructionView extends ViewPart implements ContextObserver parent.setLayout(layout); viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER | SWT.VIRTUAL); + Table table = viewer.getTable(); table.setHeaderVisible(true); table.setLinesVisible(true); viewer.setUseHashlookup(true); viewer.setContentProvider(provider); + getSite().setSelectionProvider(viewer); GridData viewerData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH); viewerData.horizontalSpan = 3; @@ -152,7 +154,7 @@ public class InstructionView extends ViewPart implements ContextObserver provider = new ParameterLabelProvider(index); break; case INTEGER_IMMEDIATE: - support = new IntegerEditingSupport(viewer, miDef, index, new DisplaySettings(NumberType.DECIMAL)); + support = new IntegerEditingSupport(viewer, miDef, index, displaySettings, this.provider); provider = new IntegerColumnLabelProvider(displaySettings, index); break; case MNEMONIC: