projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Made InstructionTable a bit easier to use
[Mograsim.git]
/
plugins
/
net.mograsim.plugin.core
/
src
/
net
/
mograsim
/
plugin
/
tables
/
mi
/
MnemonicEditingSupport.java
diff --git
a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/MnemonicEditingSupport.java
b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/MnemonicEditingSupport.java
index
1140e68
..
7248f4f
100644
(file)
--- a/
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/MnemonicEditingSupport.java
+++ b/
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/MnemonicEditingSupport.java
@@
-25,8
+25,10
@@
public class MnemonicEditingSupport extends EditingSupport
super(viewer);
family = (MnemonicFamily) definition.getParameterClassifications()[index];
editor = new ComboBoxCellEditor(viewer.getTable(), family.getStringValues(), SWT.READ_ONLY);
super(viewer);
family = (MnemonicFamily) definition.getParameterClassifications()[index];
editor = new ComboBoxCellEditor(viewer.getTable(), family.getStringValues(), SWT.READ_ONLY);
+ editor.setActivationStyle(
+ ComboBoxCellEditor.DROP_DOWN_ON_TRAVERSE_ACTIVATION | ComboBoxCellEditor.DROP_DOWN_ON_PROGRAMMATIC_ACTIVATION
+ | ComboBoxCellEditor.DROP_DOWN_ON_MOUSE_ACTIVATION | ComboBoxCellEditor.DROP_DOWN_ON_KEY_ACTIVATION);
this.index = index;
this.index = index;
- editor.setValidator(new MnemonicCellEditorValidator(family));
this.provider = provider;
}
this.provider = provider;
}
@@
-54,7
+56,10
@@
public class MnemonicEditingSupport extends EditingSupport
{
InstructionTableRow row = ((InstructionTableRow) element);
MicroInstructionParameter[] params = row.data.getCell(row.address).getParameters();
{
InstructionTableRow row = ((InstructionTableRow) element);
MicroInstructionParameter[] params = row.data.getCell(row.address).getParameters();
- params[index] = family.get((Integer) value);
+ Mnemonic newParam = family.get((Integer) value);
+ if (newParam.equals(params[index]))
+ return;
+ params[index] = newParam;
row.data.setCell(row.address, MicroInstruction.create(params));
provider.update(row.address);
}
row.data.setCell(row.address, MicroInstruction.create(params));
provider.update(row.address);
}