Switched BooleanEditingSupport back to ´CheckBoxCellEditor
[Mograsim.git] / plugins / net.mograsim.plugin.core / src / net / mograsim / plugin / tables / mi / BooleanEditingSupport.java
index fa7a918..8fbfe39 100644 (file)
@@ -10,10 +10,11 @@ import net.mograsim.machine.mi.MicroInstruction;
 import net.mograsim.machine.mi.MicroInstructionDefinition;
 import net.mograsim.machine.mi.parameters.BooleanClassification;
 import net.mograsim.machine.mi.parameters.MicroInstructionParameter;
+import net.mograsim.machine.mi.parameters.Mnemonic;
 
 public class BooleanEditingSupport extends EditingSupport
 {
-       private final CheckboxCellEditor editor;
+       private final CellEditor editor;
        private final BooleanClassification boolClass;
        private final TableViewer viewer;
        private final int index;
@@ -43,6 +44,7 @@ public class BooleanEditingSupport extends EditingSupport
        protected Object getValue(Object element)
        {
                InstructionTableRow row = (InstructionTableRow) element;
+               // true is 0 because the true value comes first in the combo box
                return row.data.getCell(row.address).getParameter(index).getValue().getMSBit(0).equals(Bit.ONE);
        }
 
@@ -51,7 +53,10 @@ public class BooleanEditingSupport extends EditingSupport
        {
                InstructionTableRow row = (InstructionTableRow) element;
                MicroInstructionParameter[] params = row.data.getCell(row.address).getParameters();
-               params[index] = boolClass.get((Boolean) value);
+               // true is 0 because the true value comes first in the combo box
+               Mnemonic newParam = boolClass.get((Boolean) value);
+
+               params[index] = newParam;
                row.data.setCell(row.address, MicroInstruction.create(params));
                viewer.update(element, null);
        }