@Override
	public void menuSelected(MenuEvent event) {
		removeAll();
		ArrayList<File> list = new ArrayList<>();
		for (File file : RECENTS) {
			if (file.canRead()) {
				list.add(file);
				add(new JMenuItem(new OpenDataFileCommand(PathUtils.getLeafName(file.getName(), false), file)));
				if (list.size() == MAX_RECENTS) {
					break;
				}
			}
		}
		RECENTS.clear();
		RECENTS.addAll(list);

		if (getRecentCount() > 0) {
			addSeparator();
		}
		JMenuItem item = new JMenuItem(ClearRecentFilesMenuCommand.INSTANCE);
		ClearRecentFilesMenuCommand.INSTANCE.adjust();
		add(item);
	}