X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.plugin.core%2Fsrc%2Fnet%2Fmograsim%2Fplugin%2Ftables%2Fmi%2FMnemonicEditingSupport.java;h=765e434388d7b85a9feb2174d821f0c76a4aa161;hb=8bed58cd47f4e53a0a83e066d38864aa6875502f;hp=910fefa544bdb0e460e8fe09242cff248278b841;hpb=a8ba08b067b7c5e449656fca56ac067d5d701270;p=Mograsim.git diff --git a/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/MnemonicEditingSupport.java b/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/MnemonicEditingSupport.java index 910fefa5..765e4343 100644 --- a/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/MnemonicEditingSupport.java +++ b/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/MnemonicEditingSupport.java @@ -14,17 +14,18 @@ public class MnemonicEditingSupport extends EditingSupport { private final ComboBoxCellEditor editor; private final MnemonicFamily family; - private final TableViewer viewer; private final int index; + private InstructionTableContentProvider provider; - public MnemonicEditingSupport(TableViewer viewer, MicroInstructionDefinition definition, int index) + public MnemonicEditingSupport(TableViewer viewer, MicroInstructionDefinition definition, int index, + InstructionTableContentProvider provider) { super(viewer); - this.viewer = viewer; family = (MnemonicFamily) definition.getParameterClassifications()[index]; editor = new ComboBoxCellEditor(viewer.getTable(), family.getStringValues(), SWT.READ_ONLY); this.index = index; editor.setValidator(new MnemonicCellEditorValidator(family)); + this.provider = provider; } @Override @@ -48,8 +49,9 @@ public class MnemonicEditingSupport extends EditingSupport @Override protected void setValue(Object element, Object value) { - ((InstructionTableRow) element).data.setParameter(index, family.get((Integer) value)); - viewer.update(element, null); + InstructionTableRow row = ((InstructionTableRow) element); + row.data.setParameter(index, family.get((Integer) value)); + provider.update(row.address); } }