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;
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);
}
{
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);
}