private void filterFileList(List<String> fileNameList) { List<String> invalidList = new ArrayList<String>(); for (int i = 0; i < fileNameList.size(); i++) { String filename = fileNameList.get(i); if (!new File(filename).exists()) { invalidList.add(filename); UserSettings.removeRecentFile(i); } } fileNameList.removeAll(invalidList); }
private void loadMenuItems() { List<String> recentList = UserSettings.loadRecentFileList(); filterFileList(recentList); for (int i = 0; i < recentList.size(); i++) { String fileName = recentList.get(i); if ((fileName != null) && (fileName.length() > 0)) { ((OpenRecentSpecificationAction) items[i].getAction()).setFileName(fileName); items[i].setVisible(true); items[i].setToolTipText(fileName); } else items[i].setVisible(false); } }
public void addRecentFile(String fullFileName) { UserSettings.pushRecentFile(fullFileName); loadMenuItems(); }