package ij;
import ij.io.*;
import java.awt.*;
import java.io.*;
public class RecentOpener implements Runnable {
private String path;
RecentOpener(String path) {
this.path = path;
Thread thread = new Thread(this, "RecentOpener");
thread.start();
}
public void run() {
Opener o = new Opener();
o.open(path);
Menu menu = Menus.getOpenRecentMenu();
int n = menu.getItemCount();
int index = 0;
for (int i=0; i<n; i++) {
if (menu.getItem(i).getLabel().equals(path)) {
index = i;
break;
}
}
if (index>0) {
MenuItem item = menu.getItem(index);
menu.remove(index);
menu.insert(item, 0);
}
}
}