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.

Bug 135752 - Recent files API should be public
Summary: Recent files API should be public
Status: NEW
Alias: None
Product: utilities
Classification: Unclassified
Component: Open File (show other bugs)
Version: 7.2
Hardware: All All
: P2 blocker with 2 votes (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-24 20:37 UTC by scwells72
Modified: 2013-03-06 09:39 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description scwells72 2008-05-24 20:37:43 UTC
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:

RecentFiles.getRecentFiles()
RecentFiles.HistoryItem
OpenFile.open()
Comment 1 pjdm 2012-09-20 12:57:47 UTC
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.)
Comment 2 markuszeller 2013-02-15 16:32:38 UTC
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 :)
Comment 3 Stanislav Aubrecht 2013-03-06 09:37:01 UTC
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?
Comment 4 Stanislav Aubrecht 2013-03-06 09:39:35 UTC
(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
> filename.
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.