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 251822 - Asynchronous alternative to LogicalViewProvider.findPath
Summary: Asynchronous alternative to LogicalViewProvider.findPath
Status: NEW
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.1
Hardware: PC All
: P3 normal (vote)
Assignee: Martin Kozeny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-14 11:54 UTC by attila.kelemen
Modified: 2015-04-14 11:54 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 attila.kelemen 2015-04-14 11:54:46 UTC
The current LogicalViewProvider.findPath definition does not allow to reliably return nodes when nodes are created asynchronously (Children.create(XXX, true)). Not even with Children.getNodes(true). The reason for this is because Children.getNodes(true) waits only for the node keys to be created and not necessarily for nodes. Note that Children.getNodes cannot (or rather should not) be fixed to wait for the node creation as it would be extremly dead-lock prone. 

Another reason for the new API is that if nodes are slow to be created (which is probably the reason why they are asynchronously created in the first place), waiting for this method might block the UI, which is not user-friendly.

My proposal is that LogicalViewProvider (or rather a new LogicalViewProvider2 to preserve backward compatibility) should provide a findPath method which notifies the caller through a passed callback. Given that asynchronous calls can be expected to take some time, a cancellation mechanism should be used to allow the asynchronous call to be canceled.

Note that this API might imply that Children should have an asynchronous way to retrieve its children. Otherwise, it could be very inconvenient to implement the new LogicalViewProvider interface.