The RecentFiles functionality that feeds the "File>Open Recent File" should be made public. I've written a NetBeans
module to show a quicklist of recent files, but it required me to crack open the RecentFiles API using the global
classloader and reflection to access the centralized list maintained by that feature. Obviously this leaves me quite
fragile. In particular, I'm using the following APIs:
Consider the following situation faced by my application.
1. A new PERSISTENCE_NEVER TopComponent is opened (via a New Document menu, for example). This TopComponent does not yet have a related DataObject, so no related file is added to the recent files list.
2. The user modifies the document and saves it (using Save As to specify a file). This causes a DataObject to be created and added to the TopComponent's lookup. The TopComponent remains open.
3. The user closes the application.
At this point, the user would expect to see the file in the recent files list when the application is next run. However, at step 3 no TopComponent closing event is fired, so the file is not added to the recent files list.
Making the RecentFiles API public should allow applications to manually add (and remove) files to the recent list in circumstances other than the opening and closing of a TopComponent. (For instance, a tutorial application might want to pre-load the recent list with particular files.)
Following suggestions I would find useful for my work:
1) Recent Files should also have the project name in front / behind the filename.
2) Having much larger amount of last used files. On using multiple projects, this is quickly reached.
3) Having even a own list window for recent used files. Maybe eben with timestamp and project filter.... you got the idea :)
Making RecentFiles API public would mean refactoring RecentFiles out of utilities module otherwise other impl classes would be made public as well.
scwells72, perhaps we can grant friend access to your module. Are your sources in the contrib repository?
(In reply to comment #2)
> Following suggestions I would find useful for my work:
> 1) Recent Files should also have the project name in front / behind the
Recent files is in utilities module which cannot have dependency on Projects API
> 2) Having much larger amount of last used files. On using multiple projects,
> this is quickly reached.
Agree it would be nice have this configurable in Options or at least customizable in platform apps through some branding resource.
> 3) Having even a own list window for recent used files. Maybe eben with
> timestamp and project filter.... you got the idea :)
I'd rather have such new ui implemented directly in NetBeans than making the API public and let others implement it.
Btw, another nice enhancement would be to have separate recent files lists per project group.