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 58991

Summary: Disabling/Enabling FolderLookup recursivity
Product: platform Reporter: Martin Roskanin <mroskanin>
Component: LookupAssignee: Jaroslav Tulach <jtulach>
Status: RESOLVED WONTFIX    
Severity: blocker CC: jglick, jtulach
Priority: P3 Keywords: API
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on: 169338    
Bug Blocks:    
Attachments: Mentioned testRecursivity test addition into FolderLookupTest

Description Martin Roskanin 2005-05-17 14:51:50 UTC
FolderLookup work recursively now.
If there is an instance file in folder structure like:
"AAA/BBB/java-lang-String.instance"
then FolderLookup finds this file also using FolderLookup over parent "AAA"
folder FO.

There should be possibility to specify (or enable/disable) the recursivity
behaviour of FolderLookup.

I am attaching test, that consider a factory:
public static Lookup folderLookup (FileObject fo, boolean recursive);
for obtaining recursivity dependent lookup
Comment 1 Martin Roskanin 2005-05-17 14:53:40 UTC
Created attachment 22164 [details]
Mentioned testRecursivity test addition into FolderLookupTest
Comment 2 Jaroslav Tulach 2005-05-18 08:43:21 UTC
Radek, this seems like another request for Lookup for a folder in system 
filesystem. 
 
I think adding FolderLookup.folderLookup static factory method is good idea, 
there should be no problems implementing it, as for non-recursive folder one 
only needs subclass FolderLookup and override acceptFolder & acceptContainer 
to return null. 
 
I would like to see the factory method in org.openide.options package. For 
Settings.contextLookup(String name), but I am affraid we cannot implement it 
right now, as there would be unwanted behaviour of autosave, which we probably 
do not want to preserve in future. 
 
Comment 3 Antonin Nebuzelsky 2008-04-15 17:12:09 UTC
Reassigning to new module owner jskrivanek.
Comment 4 Jaroslav Tulach 2008-11-21 23:09:44 UTC
In case somebody needs this, it is enough to subclass FolderLookup and override acceptFolder method. Anyway the whole 
FolderLookup is deprecated, people are supposed to use Lookups.forPath instead.
Comment 5 Jesse Glick 2009-10-14 15:45:20 UTC
For reference, working patch was in issue #169338 but was rejected during API review.