- case INTEGER_IMMEDIATE:
- longestPossibleContents = generateLongestHexStrings(classes[i].getExpectedBits());
- break;
- case BOOLEAN_IMMEDIATE:
- case MNEMONIC:
- longestPossibleContents = ((MnemonicFamily) classes[i]).getStringValues();
- break;
- default:
- longestPossibleContents = new String[0];
- break;
- }
-
- col = createTableViewerColumn(name, longestPossibleContents);
- columns[i + 1] = col;
- createEditingAndLabel(col, miDef, i);
- }
- }
-
- private static final String[] HEX_DIGITS = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F" };
-
- private static String[] generateLongestHexStrings(int bitWidth)
- {
- return Arrays.stream(HEX_DIGITS).map(s -> "0x" + s.repeat((bitWidth + 3) / 4)).toArray(String[]::new);
+ if (n != memory)
+ highlight(-1);
+ };
+ m.getMicroInstructionMemory().registerMemoryReassignedListener(memReassignedListener);
+ // clear highlighting if the active machine changes
+ context.addActiveMachineListener(n ->
+ {
+ if (n.isEmpty() || n.get() != m)
+ {
+ highlight(-1);
+ m.getMicroInstructionMemory().deregisterMemoryReassignedListener(memReassignedListener);
+ }
+ });
+ m.getMicroInstructionMemory().bind(memory);
+ }));