1 package net.mograsim.plugin.tables.mi;
3 import org.eclipse.jface.viewers.ICellEditorValidator;
5 import net.mograsim.machine.mi.parameters.MnemonicFamily;
7 public class MnemonicCellEditorValidator implements ICellEditorValidator
9 private MnemonicFamily family;
11 public MnemonicCellEditorValidator(MnemonicFamily family)
17 public String isValid(Object value)
19 int index = (Integer) value;
20 return index >= 0 && index < family.size() ? null
21 : String.format("MnemonicFamily has %s elements, index %s is out of bounds", family.size(), value.toString());