"The current project has been changed, Save current changes?" ,"Save Changes?", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
edu.umd.cs.findbugs.L10N.getLocalString("dlg.save_current_changes", "The current project has been changed, Save current changes?") ,edu.umd.cs.findbugs.L10N.getLocalString("dlg.save_changes", "Save Changes?"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
	private void addRecentProjectToMenu(final File f)	{		if (!f.exists())		{			if (MainFrame.DEBUG) System.err.println("a recent project was not found, removing it from menu");			return;		}		final JMenuItem item=new JMenuItem(f.getName().substring(0,f.getName().length()-4));		item.addActionListener(new ActionListener(){			public void actionPerformed(ActionEvent e)			{				try				{					setCursor(new Cursor(Cursor.WAIT_CURSOR));					if (!f.exists())					{						JOptionPane.showMessageDialog(null,"This project can no longer be found");						GUISaveState.getInstance().projectNotFound(f);						return;					}					GUISaveState.getInstance().projectReused(f);//Move to front in GUISaveState, so it will be last thing to be removed from the list					//Move to front of recent projects menu, so GUISaveState matches with the project menu seen by the user					boolean exists=false;					for (int x=0; x< recentProjectsMenu.getItemCount(); x++)					{						if (item.getText().equalsIgnoreCase(recentProjectsMenu.getItem(x).getText()))						{							exists=true;							recentProjectsMenu.remove(x);							recentProjectsMenu.insert(item, 0);//Move to front						}					}					if (!exists)						throw new IllegalStateException ("User used a recent projects menu item that didn't exist.");										projectDirectory=f.getParentFile();					File fasFile=new File(projectDirectory.getAbsolutePath() + File.separator + projectDirectory.getName() + ".fas");					try 					{						ProjectSettings.loadInstance(new FileInputStream(fasFile));					} catch (FileNotFoundException exception) 					{						//Silently make a new instance						ProjectSettings.newInstance();					}										final File extraFinalReferenceToXmlFile=f;					new Thread(new Runnable(){						public void run()						{							updateDesignationDisplay();							if (curProject != null && projectChanged)							{								int response = JOptionPane.showConfirmDialog(MainFrame.this, 										"The current project has been changed, Save current changes?"										,"Save Changes?", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);								if (response == JOptionPane.YES_OPTION)								{									if (projectDirectory!=null)										save(projectDirectory);									else										projectSaveAs();								}								else if (response == JOptionPane.CANCEL_OPTION)									return;								//IF no, do nothing.							}														BugTreeModel model=(BugTreeModel)tree.getModel();//							Debug.println("please wait called by open menu item");							BugTreeModel.pleaseWait();							MainFrame.this.setRebuilding(true);							Project newProject = new Project();							BugSet bs=BugLoader.loadBugs(newProject, extraFinalReferenceToXmlFile);							MainFrame.this.setRebuilding(false);							if (bs!=null)							{								displayer.clearCache();								model.getOffListenerList();								model.changeSet(bs);								curProject=newProject;								MainFrame.getInstance().updateStatusBar();								MainFrame.this.setTitle("FindBugs: " + curProject.getProjectFileName());							}																												setProjectChanged(false);							editProjectMenuItem.setEnabled(true);							clearSourcePane();						}					}).start();				}				finally				{					setCursor(new Cursor(Cursor.DEFAULT_CURSOR));				}			}		});		item.setFont(item.getFont().deriveFont(Driver.getFontSize()));				boolean exists=false;		for (int x=0; x< recentProjectsMenu.getItemCount(); x++)		{			if (item.getText().equalsIgnoreCase(recentProjectsMenu.getItem(x).getText()))			{				exists=true;				recentProjectsMenu.remove(x);				recentProjectsMenu.insert(item, 0);//Move to front			}		}		if (!exists)			recentProjectsMenu.insert(item,0);			}