This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The getPopupPresenter seems to be called when the action is created. This loads all the recent project. Will try to find some decent solution.
1. You need to associate the URL, not the live Project, with each menu item. 2. You need to delay creation of the menu until it is needed. Re. #2, be sure to ask Tim for advice on making sure your solution actually works on Macs.
Could just be a trivial JMenuItem subclass that wraps the URL and finds its icon and text on demand. It's never going to be disabled or do anything complicated like that. If you're supplying the parent JMenu as the presenter, not just the contents of the submenu, and want to resolve all the menu items when the popup is about to be shown, listen on the ButtonModel of the JMenu - that will actually work everywhere (addNotify() or createPopupMenu() will *not* work everywhere).
Checking in projectui/src/org/netbeans/modules/project/ui/OpenProjectList.java; /cvs/projects/projectui/src/org/netbeans/modules/project/ui/OpenProjectList.java,v <-- OpenProjectList.java new revision: 1.21; previous revision: 1.20 done Processing log script arguments... More commits to come... Checking in projectui/src/org/netbeans/modules/project/ui/actions/RecentProjects.java; /cvs/projects/projectui/src/org/netbeans/modules/project/ui/actions/RecentProjects.java,v <-- RecentProjects.java new revision: 1.7; previous revision: 1.6 done
Petr used PopupMenuListener. Tim, does that work on Macs? Can you check please? (Open some projects then close them one by one and make sure File -> Recent Projects shows the right contents.)
Verified.