+ tryHotReplaceIfChanged(event, mpmFile, this::assignMicroInstructionMemory, "MPM");
+
+ if (mpromFile.isPresent())
+ tryHotReplaceIfChanged(event, mpromFile.get(), this::assignMPROM, "MPROM");
+ }
+ }
+
+ private static void tryHotReplaceIfChanged(IResourceChangeEvent event, IFile memFile, RunnableThrowingCoreException assign, String type)
+ {
+ IResourceDelta mpmDelta = event.getDelta().findMember(memFile.getFullPath());
+ if (mpmDelta != null && (mpmDelta.getKind() & CHANGED) == CHANGED && memFile.exists())
+ tryHotReplace(memFile, assign, type);
+ }
+
+ private static void tryHotReplace(IFile memFile, RunnableThrowingCoreException assign, String type)
+ {
+ AtomicBoolean doHotReplace = new AtomicBoolean();
+ PlatformUI.getWorkbench().getDisplay().syncExec(() ->
+ {
+ if (MessageDialog.openConfirm(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Hot Replace " + type + "?",
+ String.format("The " + type + " %s has been modified on the file system. Replace simulated " + type
+ + " with modified contents?", memFile.getName())))
+ doHotReplace.set(true);
+ });
+ if (doHotReplace.get())
+ {
+ try