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 algorithm currently used for the File -> Open Recent File list is as follows (see org.netbeans.modules.openfile.RecentFiles$WindowRegistryL.propertyChange()). If a TopComponent is being closed, add its file to the list. If a TopComponent is being opened, remove its file from the list. This algorithm works well with persistent TopComponents. However, my application has multiple instances of TopComponents with persistenceType = TopComponent.PERSISTENCE_NEVER. When a user opens a TopComponent then closes the application, the PROP_TC_CLOSED property is not fired, so WindowRegistryL does not get an opportunity to record the TopComponent's file in the recent files list. This does not matter for a persistent TopComponent, because it is re-opened automatically when the application next runs. However, a non-persistent TopComponent is not automatically re-opened, so not being in the recent files list is a problem. A suggested solution is to modify the algorithm in WindowRegistryL.propertyChange() as follows. If a TopComponent is being closed, add its file to the list. If a TopComponent is being opened: if getPersistenceType()==TopComponent.PERSISTENCE_NEVER: add its file to the list. else: remove its file from the list. This algorithm will leave a file in the list when it is opened; I don't see this as a problem. (One low-priority solution to this might be to not display a file in the recent files menu if an open TopComponent has a DataObject that matches that file.)
Recent files should listen to IDE exit events (or window system save events) and add all non-persistent opened documents to the list during that event. I think it's better solution than showing already opened documents in the list as suggested above.
(In reply to comment #1) > Recent files should listen to IDE exit events (or window system save events) > and add all non-persistent opened documents to the list during that event. Thank you, Standa, I'll implement it that way.
http://hg.netbeans.org/core-main/rev/050efc23b3d1 Fixed. Thank you for reporting and commenting.
Integrated into 'main-golden', will be available in build *201303112300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/050efc23b3d1 User: Jaroslav Havlin <jhavlin@netbeans.org> Log: #218695: Alternative algorithm for recent files